From c49e9308617f66ab05f56e9940786cb9faaa75f6 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 25 Dec 2022 16:04:01 -0800 Subject: [PATCH] Add theme to state and cookies --- types/UserCookie.d.ts | 1 + utils/accountState.tsx | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/types/UserCookie.d.ts b/types/UserCookie.d.ts index df04aadc..15a6c840 100644 --- a/types/UserCookie.d.ts +++ b/types/UserCookie.d.ts @@ -3,4 +3,5 @@ interface UserCookie { element: string language: string gender: number + theme: string } diff --git a/utils/accountState.tsx b/utils/accountState.tsx index 5ad320d8..fe2d3249 100644 --- a/utils/accountState.tsx +++ b/utils/accountState.tsx @@ -1,19 +1,21 @@ import { proxy } from 'valtio' +export type UserState = { + id: string + username: string + picture: string + element: string + gender: number + language: string + theme: string +} + interface AccountState { [key: string]: any account: { authorized: boolean - user: - | { - id: string - username: string - picture: string - element: string - gender: number - } - | undefined + user: UserState | undefined } }