mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
* feat(deployed-form): added deployed form input * styling consolidation, finishing touches on form * updated docs * remove unused files with knip * added more form fields * consolidated more test utils * remove unused/unneeded zustand stores, refactored stores for consistency * improvement(files): uncolorized plan name * feat(emcn): button-group * feat(emcn): tag input, tooltip shortcut * improvement(emcn): modal padding, api, chat, form * fix: deleted migrations * feat(form): added migrations * fix(emcn): tag input * fix: failing tests on build * add suplementary hover and fix bg color in date picker * fix: build errors --------- Co-authored-by: Emir Karabeg <emirkarabeg@berkeley.edu>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
'use client'
|
|
|
|
import { usePathname } from 'next/navigation'
|
|
import type { ThemeProviderProps } from 'next-themes'
|
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
|
|
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
|
const pathname = usePathname()
|
|
|
|
// Force light mode on public/marketing pages, allow user preference elsewhere
|
|
const isLightModePage =
|
|
pathname === '/' ||
|
|
pathname.startsWith('/login') ||
|
|
pathname.startsWith('/signup') ||
|
|
pathname.startsWith('/reset-password') ||
|
|
pathname.startsWith('/sso') ||
|
|
pathname.startsWith('/terms') ||
|
|
pathname.startsWith('/privacy') ||
|
|
pathname.startsWith('/invite') ||
|
|
pathname.startsWith('/verify') ||
|
|
pathname.startsWith('/careers') ||
|
|
pathname.startsWith('/changelog') ||
|
|
pathname.startsWith('/chat') ||
|
|
pathname.startsWith('/studio') ||
|
|
pathname.startsWith('/resume') ||
|
|
pathname.startsWith('/form')
|
|
|
|
return (
|
|
<NextThemesProvider
|
|
attribute='class'
|
|
defaultTheme='dark'
|
|
enableSystem
|
|
disableTransitionOnChange
|
|
storageKey='sim-theme'
|
|
forcedTheme={isLightModePage ? 'light' : undefined}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</NextThemesProvider>
|
|
)
|
|
}
|