From 488299353a48d77429375691fd65f5cdcf320690 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 1 Aug 2020 12:50:01 -0700 Subject: [PATCH] add appearance layer support modal Just some metadata for now, want to add body modification next! --- .../ItemSupportAppearanceLayerModal.js | 87 +++++++++++++++++++ .../WardrobePage/support/ItemSupportDrawer.js | 54 ++++++++++-- 2 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 src/app/WardrobePage/support/ItemSupportAppearanceLayerModal.js diff --git a/src/app/WardrobePage/support/ItemSupportAppearanceLayerModal.js b/src/app/WardrobePage/support/ItemSupportAppearanceLayerModal.js new file mode 100644 index 0000000..16ef90f --- /dev/null +++ b/src/app/WardrobePage/support/ItemSupportAppearanceLayerModal.js @@ -0,0 +1,87 @@ +import * as React from "react"; +import { + Button, + Box, + HStack, + Modal, + ModalBody, + ModalCloseButton, + ModalContent, + ModalHeader, + ModalOverlay, +} from "@chakra-ui/core"; +import { ExternalLinkIcon } from "@chakra-ui/icons"; + +function ItemSupportAppearanceLayerModal({ item, itemLayer, isOpen, onClose }) { + return ( + + + + + Layer {itemLayer.id}: {item.name} + + + + + + ID: + + + {itemLayer.id} + + + Zone: + + + {itemLayer.zone.label} ({itemLayer.zone.id}) + + + Assets: + + + {itemLayer.svgUrl ? ( + + ) : ( + + )} + {itemLayer.imageUrl ? ( + + ) : ( + + )} + + + + + + + ); +} + +export default ItemSupportAppearanceLayerModal; diff --git a/src/app/WardrobePage/support/ItemSupportDrawer.js b/src/app/WardrobePage/support/ItemSupportDrawer.js index 431a758..22750e3 100644 --- a/src/app/WardrobePage/support/ItemSupportDrawer.js +++ b/src/app/WardrobePage/support/ItemSupportDrawer.js @@ -1,6 +1,7 @@ import * as React from "react"; import gql from "graphql-tag"; import { useQuery, useMutation } from "@apollo/client"; +import { css } from "emotion"; import { Badge, Box, @@ -20,9 +21,11 @@ import { Spinner, Stack, useBreakpointValue, + useDisclosure, } from "@chakra-ui/core"; -import { CheckCircleIcon, ExternalLinkIcon } from "@chakra-ui/icons"; +import { CheckCircleIcon, EditIcon, ExternalLinkIcon } from "@chakra-ui/icons"; +import ItemSupportAppearanceLayerModal from "./ItemSupportAppearanceLayerModal"; import { OutfitLayers } from "../../components/OutfitPreview"; import useOutfitAppearance from "../../components/useOutfitAppearance"; import useSupportSecret from "./useSupportSecret"; @@ -244,11 +247,12 @@ function ItemSupportAppearanceFields({ item, outfitState }) { return ( Appearance layers - + {itemLayers.map((itemLayer) => ( ))} @@ -257,9 +261,18 @@ function ItemSupportAppearanceFields({ item, outfitState }) { ); } -function ItemSupportAppearanceLayer({ biologyLayers, itemLayer }) { +function ItemSupportAppearanceLayer({ biologyLayers, itemLayer, item }) { + const { isOpen, onOpen, onClose } = useDisclosure(); + return ( - + - - {itemLayer.zone.label} - + {itemLayer.zone.label} Zone ID: {itemLayer.zone.id} Layer ID: {itemLayer.id} + &, + button:focus > & { + opacity: 1; + } + `} + background="rgba(255, 255, 255, 0.8)" + borderRadius="full" + position="absolute" + top="2" + right="2" + padding="2" + alignItems="center" + justifyContent="center" + width="32px" + height="32px" + > + + + ); }