From 4284cf62913ada6d24e6e2a73944f351d6ac3c45 Mon Sep 17 00:00:00 2001 From: jonty007 Date: Fri, 23 Aug 2024 16:10:08 +0530 Subject: [PATCH 1/3] nft gallery --- packages/nft/src/components/Gallery.tsx | 100 +++++++++++++++++------- 1 file changed, 71 insertions(+), 29 deletions(-) diff --git a/packages/nft/src/components/Gallery.tsx b/packages/nft/src/components/Gallery.tsx index ae898d0f7..638d444db 100644 --- a/packages/nft/src/components/Gallery.tsx +++ b/packages/nft/src/components/Gallery.tsx @@ -22,29 +22,25 @@ export type UserQuery = Partial<{ function NFTCard({ nft }: { nft: NFT }) { return ( -
- -
- -
-
-
- + <> +
+ +
{nft.name}
-
-

- {nft.artist} -

+

+ {nft.artist} +

+
-
+ ) } @@ -111,19 +107,65 @@ function ValueComponent({ rev, computer }: { rev: string; computer: Computer }) } function FromRevs({ revs, computer }: { revs: string[]; computer: any }) { + const cols: string[][] = [[], [], [], []] + + revs.forEach((rev, index) => { + const colNumber = index % 4 + cols[colNumber].push(rev) + }) return ( -
- {revs.map((rev) => ( -
- - - + <> +
+
+ {cols[0].map((rev) => ( +
+ + + +
+ ))}
- ))} -
+
+ {cols[1].map((rev) => ( +
+ + + +
+ ))} +
+
+ {cols[2].map((rev) => ( +
+ + + +
+ ))} +
+
+ {cols[3].map((rev) => ( +
+ + + +
+ ))} +
+
+ ) } @@ -206,7 +248,7 @@ export default function WithPagination(q: UserQuery) { const query = { ...q, ...params } query.offset = contractsPerPage * pageNum query.limit = contractsPerPage + 1 - query.order = 'DESC' + query.order = "DESC" const result = await computer.query(query) setIsNextAvailable(result.length > contractsPerPage) setRevs(result.slice(0, contractsPerPage)) From 2d076b6a9edf6583ca3d021d00d1d7e02de2dbcf Mon Sep 17 00:00:00 2001 From: jonty007 Date: Mon, 26 Aug 2024 16:30:45 +0530 Subject: [PATCH 2/3] Add border to gallery --- packages/nft/src/components/Gallery.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nft/src/components/Gallery.tsx b/packages/nft/src/components/Gallery.tsx index 638d444db..87ae440f3 100644 --- a/packages/nft/src/components/Gallery.tsx +++ b/packages/nft/src/components/Gallery.tsx @@ -23,9 +23,9 @@ export type UserQuery = Partial<{ function NFTCard({ nft }: { nft: NFT }) { return ( <> -
- -
+
+ +
Date: Mon, 26 Aug 2024 19:44:49 +0530 Subject: [PATCH 3/3] rounded corner fix --- packages/nft/src/components/Gallery.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nft/src/components/Gallery.tsx b/packages/nft/src/components/Gallery.tsx index 87ae440f3..a4abac745 100644 --- a/packages/nft/src/components/Gallery.tsx +++ b/packages/nft/src/components/Gallery.tsx @@ -24,7 +24,7 @@ function NFTCard({ nft }: { nft: NFT }) { return ( <>
- +