diff --git a/app/src/ItemList.js b/app/src/ItemList.js new file mode 100644 index 0000000..d324d8a --- /dev/null +++ b/app/src/ItemList.js @@ -0,0 +1,84 @@ +import React from "react"; +import { Box, Image, PseudoBox, Stack } from "@chakra-ui/core"; + +function ItemList({ items, wornItemIds, onWearItem }) { + return ( + + {items.map((item) => ( + + onWearItem(item.id)} + /> + + ))} + + ); +} + +function Item({ item, isWorn, onWear }) { + return ( + + + + {item.name} + + ); +} + +function ItemThumbnail({ src, isWorn }) { + return ( + + + + ); +} + +function ItemName({ children, isWorn }) { + return ( + + {children} + + ); +} + +export default ItemList; diff --git a/app/src/WardrobePage.js b/app/src/WardrobePage.js index 10e5004..760e1ea 100644 --- a/app/src/WardrobePage.js +++ b/app/src/WardrobePage.js @@ -20,6 +20,7 @@ import { useToast, } from "@chakra-ui/core"; +import ItemList from "./ItemList"; import useOutfitState from "./useOutfitState.js"; import { ITEMS } from "./data"; @@ -252,74 +253,6 @@ function ItemsForZone({ zoneName, items, wornItemId, onWearItem }) { ); } -function ItemList({ items, wornItemIds, onWearItem }) { - return ( - - {items.map((item) => ( - - onWearItem(item.id)} - /> - - ))} - - ); -} - -function Item({ item, isWorn, onWear }) { - return ( - - - - - - {item.name} - - - ); -} - function Heading1({ children, ...props }) { return (