From d29abf5cd13201ea296c4db88b9c2a41a4108923 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 12 Sep 2020 18:13:11 -0700 Subject: [PATCH] add skeletons for item page header It looks nice, but also particularly means we can handle the loading for the preview separately, get that started faster and iterate better on it in dev! --- src/app/ItemPage.js | 65 ++++++++++++++++++++++++++-------- src/app/components/ItemCard.js | 8 +++-- 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/src/app/ItemPage.js b/src/app/ItemPage.js index 8dd58d0..295e174 100644 --- a/src/app/ItemPage.js +++ b/src/app/ItemPage.js @@ -3,7 +3,7 @@ import { AspectRatio, Badge, Box, - Center, + Skeleton, VStack, useColorModeValue, } from "@chakra-ui/core"; @@ -25,6 +25,15 @@ import OutfitPreview from "./components/OutfitPreview"; function ItemPage() { const { itemId } = useParams(); + return ( + + + + + ); +} + +function ItemPageHeader({ itemId }) { const { loading, error, data } = useQuery( gql` query ItemPage($itemId: ID!) { @@ -43,9 +52,41 @@ function ItemPage() { if (loading) { return ( -
- -
+ + + + + + Item name goes here + + + + + + + + Jellyneo + + + Shop Wiz + + + Super Wiz + + + Trades + + + Auctions + + + + ); } @@ -56,16 +97,12 @@ function ItemPage() { const { item } = data; return ( - - - - - ); -} - -function ItemPageHeader({ item }) { - return ( - + - NC + + NC + ); } export function NpBadge() { + // NOTE: display:block helps with some layout consistency, overriding the + // default of inline-block. return ( - NP + NP ); }