Skip to content

Commit 4ede522

Browse files
committed
fix(ui): address PR review comments - restore StatusPageLayout wrapper, improve whitelabel detection
1 parent 0725c98 commit 4ede522

File tree

9 files changed

+34
-14
lines changed

9 files changed

+34
-14
lines changed

apps/sim/app/(auth)/components/branded-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const BrandedButton = forwardRef<HTMLButtonElement, BrandedButtonProps>(
3434
ref
3535
) => {
3636
const brand = useBrandConfig()
37-
const isWhitelabeled = brand.name !== 'Sim'
37+
const isWhitelabeled = brand.isWhitelabeled
3838
const [isHovered, setIsHovered] = useState(false)
3939

4040
const handleMouseEnter = (e: React.MouseEvent<HTMLButtonElement>) => {
Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use client'
22

33
import type { ReactNode } from 'react'
4+
import AuthBackground from '@/app/(auth)/components/auth-background'
5+
import Navbar from '@/app/(home)/components/navbar/navbar'
46
import { SupportFooter } from './support-footer'
57

68
export interface StatusPageLayoutProps {
@@ -17,15 +19,24 @@ export function StatusPageLayout({
1719
showSupportFooter = true,
1820
}: StatusPageLayoutProps) {
1921
return (
20-
<>
21-
<div className='flex flex-col items-center justify-center'>
22-
<div className='space-y-1 text-center'>
23-
<h1 className='font-[500] text-[#ECECEC] text-[32px] tracking-tight'>{title}</h1>
24-
<p className='font-[380] text-[#999] text-[16px]'>{description}</p>
22+
<AuthBackground className='dark font-[430] font-season'>
23+
<main className='relative flex min-h-full flex-col text-[#ECECEC]'>
24+
<header className='shrink-0 bg-[#1C1C1C]'>
25+
<Navbar logoOnly />
26+
</header>
27+
<div className='relative z-30 flex flex-1 items-center justify-center px-4 pb-24'>
28+
<div className='w-full max-w-lg px-4'>
29+
<div className='flex flex-col items-center justify-center'>
30+
<div className='space-y-1 text-center'>
31+
<h1 className='font-[500] text-[#ECECEC] text-[32px] tracking-tight'>{title}</h1>
32+
<p className='font-[380] text-[#999] text-[16px]'>{description}</p>
33+
</div>
34+
{children && <div className='mt-8 w-full max-w-[410px] space-y-3'>{children}</div>}
35+
</div>
36+
</div>
2537
</div>
26-
{children && <div className='mt-8 w-full max-w-[410px] space-y-3'>{children}</div>}
27-
</div>
28-
{showSupportFooter && <SupportFooter position='absolute' />}
29-
</>
38+
{showSupportFooter && <SupportFooter position='absolute' />}
39+
</main>
40+
</AuthBackground>
3041
)
3142
}

apps/sim/app/not-found.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use client'
2-
31
import Link from 'next/link'
42
import AuthBackground from '@/app/(auth)/components/auth-background'
53
import Navbar from '@/app/(home)/components/navbar/navbar'

apps/sim/components/emails/_styles/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { getBrandConfig } from '@/ee/whitelabeling'
88
/** Color tokens from globals.css (light mode), brand-aware for whitelabeled instances */
99
function buildColors() {
1010
const brand = getBrandConfig()
11-
const isWhitelabeled = brand.name !== 'Sim'
11+
const isWhitelabeled = brand.isWhitelabeled
1212
const accentColor =
1313
isWhitelabeled && brand.theme?.primaryColor ? brand.theme.primaryColor : '#33C482'
1414

apps/sim/components/emails/components/email-footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function EmailFooter({
2828
showUnsubscribe = true,
2929
}: EmailFooterProps) {
3030
const brand = getBrandConfig()
31-
const isWhitelabeled = brand.name !== 'Sim'
31+
const isWhitelabeled = brand.isWhitelabeled
3232

3333
const footerLinkStyle = {
3434
color: colors.textMuted,

apps/sim/ee/whitelabeling/branding.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ const getThemeColors = (): ThemeColors => {
2323
* Supports runtime configuration via Docker/Kubernetes
2424
*/
2525
export const getBrandConfig = (): BrandConfig => {
26+
const hasCustomBrand = Boolean(
27+
getEnv('NEXT_PUBLIC_BRAND_NAME') ||
28+
getEnv('NEXT_PUBLIC_BRAND_LOGO_URL') ||
29+
getEnv('NEXT_PUBLIC_BRAND_PRIMARY_COLOR')
30+
)
31+
2632
return {
2733
name: getEnv('NEXT_PUBLIC_BRAND_NAME') || defaultBrandConfig.name,
2834
logoUrl: getEnv('NEXT_PUBLIC_BRAND_LOGO_URL') || defaultBrandConfig.logoUrl,
@@ -34,6 +40,7 @@ export const getBrandConfig = (): BrandConfig => {
3440
termsUrl: getEnv('NEXT_PUBLIC_TERMS_URL') || defaultBrandConfig.termsUrl,
3541
privacyUrl: getEnv('NEXT_PUBLIC_PRIVACY_URL') || defaultBrandConfig.privacyUrl,
3642
theme: getThemeColors(),
43+
isWhitelabeled: hasCustomBrand,
3744
}
3845
}
3946

apps/sim/ee/whitelabeling/inject-theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function generateThemeCSS(): string {
1515

1616
if (process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR) {
1717
cssVars.push(`--brand-primary-hex: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
18+
// Override tertiary-2 so Run/Deploy buttons and other tertiary-styled elements use the brand color
1819
cssVars.push(`--brand-tertiary-2: ${process.env.NEXT_PUBLIC_BRAND_PRIMARY_COLOR};`)
1920
}
2021

apps/sim/lib/branding/defaults.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ export const defaultBrandConfig: BrandConfig = {
1919
accentHoverColor: '#a66fff',
2020
backgroundColor: '#0c0c0c',
2121
},
22+
isWhitelabeled: false,
2223
}

apps/sim/lib/branding/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ export interface BrandConfig {
1616
termsUrl?: string
1717
privacyUrl?: string
1818
theme?: ThemeColors
19+
/** Whether this instance has custom branding applied (any brand env var is set) */
20+
isWhitelabeled: boolean
1921
}

0 commit comments

Comments
 (0)