* Revert "feat: temporary remove dark mode :( (#2168)" This reverts commit 222b4ad897c275dab0eaec3c8a8472bf3df7afc4. * fix: revert darkmode and fix darkmode for import model * fix: prettier format import model --------- Co-authored-by: Louis <louis@jan.ai>
37 lines
796 B
TypeScript
37 lines
796 B
TypeScript
'use client'
|
|
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import { ThemeProvider } from 'next-themes'
|
|
|
|
import { motion as m } from 'framer-motion'
|
|
|
|
import { useBodyClass } from '@/hooks/useBodyClass'
|
|
|
|
import { useUserConfigs } from '@/hooks/useUserConfigs'
|
|
|
|
export default function ThemeWrapper({ children }: PropsWithChildren) {
|
|
const [config] = useUserConfigs()
|
|
|
|
useBodyClass(config.primaryColor || 'primary-yellow')
|
|
|
|
return (
|
|
<ThemeProvider attribute="class" enableSystem>
|
|
<m.div
|
|
initial={{ opacity: 0, y: -10 }}
|
|
animate={{
|
|
opacity: 1,
|
|
y: 0,
|
|
transition: {
|
|
duration: 0.5,
|
|
type: 'spring',
|
|
stiffness: 200,
|
|
},
|
|
}}
|
|
>
|
|
{children}
|
|
</m.div>
|
|
</ThemeProvider>
|
|
)
|
|
}
|