From fa0ae3fbe15c2eb7fee897242ba1aa614a197933 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 12 Sep 2020 23:23:46 -0700 Subject: [PATCH] add item description to item page --- src/app/ItemPage.js | 63 ++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/app/ItemPage.js b/src/app/ItemPage.js index 505f5b4..9f62608 100644 --- a/src/app/ItemPage.js +++ b/src/app/ItemPage.js @@ -6,8 +6,10 @@ import { Button, Box, Skeleton, + SkeletonText, VisuallyHidden, VStack, + useBreakpointValue, useColorModeValue, useTheme, useToast, @@ -60,6 +62,7 @@ function ItemPageHeader({ itemId, isEmbedded }) { name isNc thumbnailUrl + description } } `, @@ -68,6 +71,8 @@ function ItemPageHeader({ itemId, isEmbedded }) { usePageTitle(data?.item?.name, { skip: isEmbedded }); + const numDescriptionLines = useBreakpointValue({ base: 2, md: 1 }); + if (error) { return {error.message}; } @@ -75,29 +80,45 @@ function ItemPageHeader({ itemId, isEmbedded }) { const item = data?.item; return ( - - - - - - - - {item?.name || "Item name here"} - + <> + + + - + + + + {item?.name || "Item name here"} + + + + - + + {item?.description || ( + + + + )} + + ); }