Faisal Amir 635435fbb8
Revert feat: temporary remove dark mode (#2221)
* 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>
2024-03-04 14:46:10 +07:00

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>
)
}