MCPcopy Index your code
hub / github.com/simstudioai/sim / BrandedLayout

Function BrandedLayout

apps/sim/components/branded-layout.tsx:10–43  ·  view source on GitHub ↗
({ children }: BrandedLayoutProps)

Source from the content-addressed store, hash-verified

8}
9
10export function BrandedLayout({ children }: BrandedLayoutProps) {
11 useEffect(() => {
12 const config = getBrandConfig()
13
14 // Update document title
15 if (config.name !== 'Sim') {
16 document.title = config.name
17 }
18
19 // Update favicon
20 if (config.faviconUrl) {
21 const faviconLink = document.querySelector("link[rel*='icon']") as HTMLLinkElement
22 if (faviconLink) {
23 faviconLink.href = config.faviconUrl
24 }
25 }
26
27 // Load custom CSS if provided
28 if (config.customCssUrl) {
29 const customCssId = 'custom-brand-css'
30 let customCssLink = document.getElementById(customCssId) as HTMLLinkElement
31
32 if (!customCssLink) {
33 customCssLink = document.createElement('link')
34 customCssLink.id = customCssId
35 customCssLink.rel = 'stylesheet'
36 customCssLink.href = config.customCssUrl
37 document.head.appendChild(customCssLink)
38 }
39 }
40 }, [])
41
42 return <>{children}</>
43}

Callers

nothing calls this directly

Calls 1

getBrandConfigFunction · 0.90

Tested by

no test coverage detected