add temporary toast explaining outfit is static
This commit is contained in:
parent
b998e12ce4
commit
433d255391
1 changed files with 25 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue