add WIP callout to item page

This commit is contained in:
Emi Matchu 2020-10-10 02:17:21 -07:00
parent e7359ab51b
commit 1eca5d1e27
2 changed files with 47 additions and 30 deletions

View file

@ -42,6 +42,7 @@ import {
import OutfitPreview from "./components/OutfitPreview"; import OutfitPreview from "./components/OutfitPreview";
import SpeciesColorPicker from "./components/SpeciesColorPicker"; import SpeciesColorPicker from "./components/SpeciesColorPicker";
import { useLocalStorage } from "./util"; import { useLocalStorage } from "./util";
import WIPCallout from "./components/WIPCallout";
function ItemPage() { function ItemPage() {
const { itemId } = useParams(); const { itemId } = useParams();
@ -59,6 +60,7 @@ export function ItemPageContent({ itemId, isEmbedded }) {
<ItemPageHeader itemId={itemId} isEmbedded={isEmbedded} /> <ItemPageHeader itemId={itemId} isEmbedded={isEmbedded} />
<ItemPageOwnWantButtons itemId={itemId} /> <ItemPageOwnWantButtons itemId={itemId} />
{!isEmbedded && <ItemPageOutfitPreview itemId={itemId} />} {!isEmbedded && <ItemPageOutfitPreview itemId={itemId} />}
<WIPCallout>Trade lists coming soon!</WIPCallout>
</VStack> </VStack>
); );
} }

View file

@ -4,9 +4,8 @@ import { Box, Flex, Tooltip } from "@chakra-ui/core";
import WIPXweeImg from "../../images/wip-xwee.png"; import WIPXweeImg from "../../images/wip-xwee.png";
import WIPXweeImg2x from "../../images/wip-xwee@2x.png"; import WIPXweeImg2x from "../../images/wip-xwee@2x.png";
function WIPCallout({ details }) { function WIPCallout({ children, details }) {
return ( let content = (
<Tooltip label={<Box textAlign="center">{details}</Box>} placement="bottom">
<Flex <Flex
alignItems="center" alignItems="center"
border="1px solid" border="1px solid"
@ -17,7 +16,6 @@ function WIPCallout({ details }) {
paddingRight="4" paddingRight="4"
paddingY="1" paddingY="1"
fontSize="sm" fontSize="sm"
tabIndex="0"
> >
<Box <Box
as="img" as="img"
@ -28,13 +26,30 @@ function WIPCallout({ details }) {
height="36px" height="36px"
marginRight="2" marginRight="2"
/> />
{children || (
<>
<Box display={{ base: "none", md: "block" }}> <Box display={{ base: "none", md: "block" }}>
We're working on this page! We're working on this page!
</Box> </Box>
<Box display={{ base: "block", md: "none" }}>WIP!</Box> <Box display={{ base: "block", md: "none" }}>WIP!</Box>
</>
)}
</Flex> </Flex>
);
if (details) {
content = (
<Tooltip
label={<Box textAlign="center">{details}</Box>}
placement="bottom"
shouldWrapChildren
>
{content}
</Tooltip> </Tooltip>
); );
} }
return content;
}
export default WIPCallout; export default WIPCallout;