From b478f35103da754886c3485303195ee06416b6ef Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 8 Jan 2021 00:35:09 -0800 Subject: [PATCH] Refactor OutfitCard a bit Preparing to make a skeleton version for loading! --- src/app/UserOutfitsPage.js | 62 ++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/src/app/UserOutfitsPage.js b/src/app/UserOutfitsPage.js index 608ef78..3e75a24 100644 --- a/src/app/UserOutfitsPage.js +++ b/src/app/UserOutfitsPage.js @@ -44,6 +44,14 @@ function UserOutfitsPageContent() { svgUrl imageUrl(size: $size) } + species { + id + name + } + color { + id + name + } ...PetAppearanceForGetVisibleLayers } itemAppearances { @@ -55,6 +63,10 @@ function UserOutfitsPageContent() { } ...ItemAppearanceForGetVisibleLayers } + wornItems { + id + name + } } } } @@ -96,11 +108,38 @@ function UserOutfitsPageContent() { } function OutfitCard({ outfit }) { - const thumbnailUrl = buildOutfitThumbnailUrl( - outfit.petAppearance, - outfit.itemAppearances + const image = ( + ); + return ( + + + + ); +} + +function OutfitCardLayout({ image, caption }) { const { brightBackground } = useCommonStyles(); return ( @@ -114,26 +153,17 @@ function OutfitCard({ outfit }) { width="calc(150px + 2em)" backgroundColor={brightBackground} transition="all 0.2s" - as={Link} - to={`/outfits/${outfit.id}`} - _hover={{ transform: `scale(1.05)` }} - _focus={{ - transform: `scale(1.05)`, - boxShadow: "outline", - outline: "none", - }} > - {outfit.name} + > + {image} + + {caption} ); }