File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 22 Badge ,
33 Heading ,
44 HStack ,
5+ SimpleGrid ,
56 Skeleton ,
67 Stack ,
78 Text ,
@@ -63,13 +64,15 @@ function Collections({
6364 < Heading size = { "md" } > Collections</ Heading > { " " }
6465 < Badge > { collections . length } </ Badge >
6566 </ HStack >
66- { collections . map ( ( collection ) => (
67- < CollectionCard
68- collection = { collection }
69- setHref = { setHref }
70- key = { collection . id }
71- > </ CollectionCard >
72- ) ) }
67+ < SimpleGrid columns = { { base : 1 , md : 2 } } gap = { 2 } >
68+ { collections . map ( ( collection ) => (
69+ < CollectionCard
70+ collection = { collection }
71+ setHref = { setHref }
72+ key = { collection . id }
73+ > </ CollectionCard >
74+ ) ) }
75+ </ SimpleGrid >
7376 </ Stack >
7477 ) ;
7578 }
Original file line number Diff line number Diff line change 33 DataList ,
44 HStack ,
55 IconButton ,
6+ Image ,
67 Stack ,
78 Text ,
89} from "@chakra-ui/react" ;
@@ -56,6 +57,9 @@ export function CollectionCard({
5657} ) {
5758 const selfHref = getSelfHref ( collection ) ;
5859 const dispatch = useLayersDispatch ( ) ;
60+ const thumbnail = Object . values ( collection . assets || { } ) . find ( ( asset ) =>
61+ asset . roles ?. includes ( "thumbnail" )
62+ ) ;
5963
6064 return (
6165 < Card . Root size = { "sm" } >
@@ -64,8 +68,9 @@ export function CollectionCard({
6468 </ Card . Header >
6569 < Card . Body >
6670 < Stack >
71+ { thumbnail && < Image src = { thumbnail . href } > </ Image > }
6772 < Text lineClamp = { 3 } > { collection . description } </ Text >
68- < DataList . Root orientation = { "horizontal" } >
73+ < DataList . Root >
6974 < DataList . Item >
7075 < DataList . ItemLabel > Bounding box</ DataList . ItemLabel >
7176 < DataList . ItemValue >
You can’t perform that action at this time.
0 commit comments