-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Inventory Context replaced by Inventory Store (#949)
- Loading branch information
1 parent
11f8194
commit bd0a8a9
Showing
5 changed files
with
37 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
import type { UiCell } from "@/app/inventory/Common.ts"; | ||
import { create } from "zustand"; | ||
|
||
type InventoryStore = { | ||
currentListIndex: number; | ||
setCurrentListIndex: (payload: number) => void; | ||
weaponsPageData: Array<Array<UiCell>>; | ||
setWeaponsPageData: (payload: Array<Array<UiCell>>) => void; | ||
armorPageData: Array<Array<UiCell>>; | ||
setArmorPageData: (payload: Array<Array<UiCell>>) => void; | ||
inventoryPageData: Array<Array<UiCell>>; | ||
setInventoryPageData: (payload: Array<Array<UiCell>>) => void; | ||
}; | ||
|
||
export const useInventoryStore = create<InventoryStore>((set) => ({ | ||
currentListIndex: 0, | ||
setCurrentListIndex: (currentListIndex: number) => set({ currentListIndex }), | ||
weaponsPageData: [], | ||
armorPageData: [], | ||
inventoryPageData: [], | ||
setWeaponsPageData: (weaponsPageData: Array<Array<UiCell>>) => set({ weaponsPageData }), | ||
setArmorPageData: (armorPageData: Array<Array<UiCell>>) => set({ armorPageData }), | ||
setInventoryPageData: (inventoryPageData: Array<Array<UiCell>>) => set({ inventoryPageData }), | ||
})); |