Add theme to state and cookies
This commit is contained in:
parent
7d248cf91b
commit
c49e930861
2 changed files with 12 additions and 9 deletions
1
types/UserCookie.d.ts
vendored
1
types/UserCookie.d.ts
vendored
|
|
@ -3,4 +3,5 @@ interface UserCookie {
|
||||||
element: string
|
element: string
|
||||||
language: string
|
language: string
|
||||||
gender: number
|
gender: number
|
||||||
|
theme: string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,21 @@
|
||||||
import { proxy } from 'valtio'
|
import { proxy } from 'valtio'
|
||||||
|
|
||||||
|
export type UserState = {
|
||||||
|
id: string
|
||||||
|
username: string
|
||||||
|
picture: string
|
||||||
|
element: string
|
||||||
|
gender: number
|
||||||
|
language: string
|
||||||
|
theme: string
|
||||||
|
}
|
||||||
|
|
||||||
interface AccountState {
|
interface AccountState {
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
|
|
||||||
account: {
|
account: {
|
||||||
authorized: boolean
|
authorized: boolean
|
||||||
user:
|
user: UserState | undefined
|
||||||
| {
|
|
||||||
id: string
|
|
||||||
username: string
|
|
||||||
picture: string
|
|
||||||
element: string
|
|
||||||
gender: number
|
|
||||||
}
|
|
||||||
| undefined
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue