From 5546b21c27fa4a229bea5d368ec60f4abf07f25f Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 11 Sep 2020 21:53:57 -0700 Subject: [PATCH] use the same ItemCardList in items + modeling and make the grid items take the full two-column width --- src/app/ItemsPage.js | 9 +++++---- src/app/ModelingPage.js | 7 ++++--- src/app/components/ItemCard.js | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/app/ItemsPage.js b/src/app/ItemsPage.js index f33fedf..1e37134 100644 --- a/src/app/ItemsPage.js +++ b/src/app/ItemsPage.js @@ -8,6 +8,7 @@ import HangerSpinner from "./components/HangerSpinner"; import { Heading1 } from "./util"; import ItemCard, { ItemBadgeList, + ItemCardList, NcBadge, NpBadge, YouOwnThisBadge, @@ -78,7 +79,7 @@ function ItemsPage() { {isCurrentUser ? "Items you own" : `Items ${data.user.username} owns`} - + {data.user.itemsTheyOwn.map((item) => ( ))} - + {isCurrentUser ? "Items you want" : `Items ${data.user.username} wants`} - + {data.user.itemsTheyWant.map((item) => ( ))} - + ); } diff --git a/src/app/ModelingPage.js b/src/app/ModelingPage.js index 9685cb8..307cefe 100644 --- a/src/app/ModelingPage.js +++ b/src/app/ModelingPage.js @@ -8,6 +8,7 @@ import HangerSpinner from "./components/HangerSpinner"; import { Heading1, Heading2 } from "./util"; import ItemCard, { ItemBadgeList, + ItemCardList, YouOwnThisBadge, } from "./components/ItemCard"; @@ -72,7 +73,7 @@ function ItemModelsList() { ); return ( - + {items.map((item) => ( ))} - + ); } @@ -89,7 +90,7 @@ function ItemModelCard({ item, currentUserOwnsItem, ...props }) { ); - return ; + return ; } function ItemModelBadges({ item, currentUserOwnsItem }) { diff --git a/src/app/components/ItemCard.js b/src/app/components/ItemCard.js index 3adf7c5..0737d3f 100644 --- a/src/app/components/ItemCard.js +++ b/src/app/components/ItemCard.js @@ -4,6 +4,7 @@ import { Badge, Box, Image, + SimpleGrid, Tooltip, Wrap, useColorModeValue, @@ -27,6 +28,7 @@ function ItemCard({ item, badges, ...props }) { border="1px" borderColor={borderColor} className="item-card" + width="100%" {...props} > + {children} + + ); +} + export function ItemBadgeList({ children }) { return (