From ab952ddec441659011e6636a1fd54b03aaa169df Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 23 Feb 2022 01:50:47 -0800 Subject: [PATCH] State object --- utils/state.tsx | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 utils/state.tsx diff --git a/utils/state.tsx b/utils/state.tsx new file mode 100644 index 00000000..3f13a184 --- /dev/null +++ b/utils/state.tsx @@ -0,0 +1,57 @@ +import { proxy } from "valtio"; + +interface State { + app: { + authenticated: boolean + }, + party: { + id: string | undefined, + editable: boolean, + element: number, + extra: boolean + }, + grid: { + weapons: { + mainWeapon: GridWeapon | undefined, + allWeapons: GridWeapon[] + }, + summons: { + mainSummon: GridSummon | undefined, + friendSummon: GridSummon | undefined, + allSummons: GridSummon[] + }, + characters: GridCharacter[] + }, + search: { + sourceItem: GridCharacter | GridWeapon | GridSummon | undefined + } +} + +const state: State = { + app: { + authenticated: false + }, + party: { + id: undefined, + editable: false, + element: 0, + extra: false + }, + grid: { + weapons: { + mainWeapon: undefined, + allWeapons: Array() + }, + summons: { + mainSummon: undefined, + friendSummon: undefined, + allSummons: Array() + }, + characters: Array() + }, + search: { + sourceItem: undefined + } +} + +export default proxy(state) \ No newline at end of file