diff --git a/src/OutfitResetModal.js b/src/OutfitResetModal.js index ba90cdf..97989da 100644 --- a/src/OutfitResetModal.js +++ b/src/OutfitResetModal.js @@ -12,6 +12,7 @@ import { ModalFooter, FormErrorMessage, FormControl, + Box, } from "@chakra-ui/core"; function OutfitResetModal({ isOpen, onClose, dispatchToOutfit }) { @@ -36,6 +37,17 @@ function OutfitResetModal({ isOpen, onClose, dispatchToOutfit }) { onComplete ); + const clearOutfit = () => { + dispatchToOutfit({ + type: "reset", + name: "", + wornItemIds: [], + closetedItemIds: [], + }); + onClose(); + setPetName(""); + }; + return ( @@ -56,10 +68,11 @@ function OutfitResetModal({ isOpen, onClose, dispatchToOutfit }) { - + Choose a pet from Neopets.com, and we'll pull their outfit data into here for you to play with! + + + diff --git a/src/useOutfitState.js b/src/useOutfitState.js index 164e81a..9658443 100644 --- a/src/useOutfitState.js +++ b/src/useOutfitState.js @@ -150,8 +150,8 @@ const outfitStateReducer = (apolloClient) => (baseState, action) => { const { name, speciesId, colorId, wornItemIds, closetedItemIds } = action; return { name, - speciesId: String(speciesId), - colorId: String(colorId), + speciesId: String(speciesId || baseState.speciesId), + colorId: String(colorId || baseState.colorId), wornItemIds: new Set(wornItemIds.map(String)), closetedItemIds: new Set(closetedItemIds.map(String)), };