generated from nhcarrigan/template
Compare commits
5 Commits
v0.1.2
..
c3e85c3768
| Author | SHA1 | Date | |
|---|---|---|---|
|
c3e85c3768
|
|||
|
2c16736bdf
|
|||
|
0dc572c6fa
|
|||
|
9fcc5bb836
|
|||
|
fc93efd245
|
@@ -26,9 +26,7 @@ const bonusLabel: Record<string, string> = {
|
|||||||
*/
|
*/
|
||||||
const CraftingPanel = (): JSX.Element => {
|
const CraftingPanel = (): JSX.Element => {
|
||||||
const { state, craftRecipe, formatNumber } = useGame();
|
const { state, craftRecipe, formatNumber } = useGame();
|
||||||
const [ activeZoneId, setActiveZoneId ] = useState(() => {
|
const [ activeZoneId, setActiveZoneId ] = useState("verdant_vale");
|
||||||
return sessionStorage.getItem("elysium_craft_zone") ?? "verdant_vale";
|
|
||||||
});
|
|
||||||
const [ pendingRecipeId, setPendingRecipeId ] = useState<string | null>(null);
|
const [ pendingRecipeId, setPendingRecipeId ] = useState<string | null>(null);
|
||||||
|
|
||||||
if (state === null) {
|
if (state === null) {
|
||||||
@@ -70,11 +68,6 @@ const CraftingPanel = (): JSX.Element => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleZoneSelect(zoneId: string): void {
|
|
||||||
setActiveZoneId(zoneId);
|
|
||||||
sessionStorage.setItem("elysium_craft_zone", zoneId);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleCraft(recipeId: string): Promise<void> {
|
async function handleCraft(recipeId: string): Promise<void> {
|
||||||
setPendingRecipeId(recipeId);
|
setPendingRecipeId(recipeId);
|
||||||
try {
|
try {
|
||||||
@@ -92,7 +85,7 @@ const CraftingPanel = (): JSX.Element => {
|
|||||||
|
|
||||||
<ZoneSelector
|
<ZoneSelector
|
||||||
activeZoneId={activeZoneId}
|
activeZoneId={activeZoneId}
|
||||||
onSelectZone={handleZoneSelect}
|
onSelectZone={setActiveZoneId}
|
||||||
zones={zones}
|
zones={zones}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user