diff --git a/utils/accountState.tsx b/utils/accountState.tsx new file mode 100644 index 00000000..3fdb86f4 --- /dev/null +++ b/utils/accountState.tsx @@ -0,0 +1,19 @@ +import { proxy } from "valtio"; + +interface AccountState { + [key: string]: any + + account: { + authorized: boolean, + language: 'en' | 'jp' + } +} + +export const initialAccountState: AccountState = { + account: { + authorized: false, + language: 'en' + } +} + +export const accountState = proxy(initialAccountState) diff --git a/utils/state.tsx b/utils/appState.tsx similarity index 86% rename from utils/state.tsx rename to utils/appState.tsx index 42f66db4..8ed49ba3 100644 --- a/utils/state.tsx +++ b/utils/appState.tsx @@ -1,9 +1,8 @@ import { proxy } from "valtio"; -interface State { - app: { - authenticated: boolean - }, +interface AppState { + [key: string]: any + party: { id: string | undefined, editable: boolean, @@ -27,10 +26,7 @@ interface State { } } -const state: State = { - app: { - authenticated: false - }, +export const initialAppState: AppState = { party: { id: undefined, editable: false, @@ -54,4 +50,4 @@ const state: State = { } } -export default proxy(state) \ No newline at end of file +export const appState = proxy(initialAppState) \ No newline at end of file