Add changeTheme util
This commit is contained in:
parent
b6d7c403a3
commit
6d8786e370
1 changed files with 9 additions and 0 deletions
9
utils/changeTheme.tsx
Normal file
9
utils/changeTheme.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { useTheme } from 'next-themes'
|
||||||
|
import { accountState } from '~utils/accountState'
|
||||||
|
|
||||||
|
export default function changeTheme() {
|
||||||
|
const { theme, setTheme } = useTheme()
|
||||||
|
if (accountState.account.user) {
|
||||||
|
setTheme(accountState.account.user.theme)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue