add temporary toast explaining outfit is static

This commit is contained in:
Matt Dunn-Rankin 2020-04-22 02:57:58 -07:00
parent b998e12ce4
commit 433d255391

View file

@ -17,15 +17,39 @@ import {
PseudoBox, PseudoBox,
Stack, Stack,
Text, Text,
useToast,
} from "@chakra-ui/core"; } from "@chakra-ui/core";
import useOutfitState from "./useOutfitState.js"; import useOutfitState from "./useOutfitState.js";
import { ITEMS } from "./data"; import { ITEMS } from "./data";
function WardrobePage() { function WardrobePage() {
const [data, wearItem] = useOutfitState(); const [data, wearItemRaw] = useOutfitState();
const [searchQuery, setSearchQuery] = React.useState(""); const [searchQuery, setSearchQuery] = React.useState("");
const toast = useToast();
const [hasSentToast, setHasSentToast] = React.useState(false);
const wearItem = React.useCallback(
(itemIdToAdd) => {
wearItemRaw(itemIdToAdd);
if (!hasSentToast) {
toast({
title: "Not yet implemented",
description:
"The outfit preview is static right now, we'll update it " +
"to change later! But the list animation is good, yeah? 😊",
status: "warning",
isClosable: true,
duration: 10000,
position: window.innerWidth < 992 ? "top" : "bottom-left",
});
setHasSentToast(true);
}
},
[toast, wearItemRaw, hasSentToast, setHasSentToast]
);
return ( return (
<Grid <Grid
// Fullscreen, split into a vertical stack on smaller screens // Fullscreen, split into a vertical stack on smaller screens