Skip to content

Commit

Permalink
Add collection list nfts preview
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitayutanov committed Jan 15, 2024
1 parent fe99f58 commit 20a15d2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,17 @@

border-top: 1px solid #f3f3f3;
}

.nfts {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 1px;

// opacity: 25%;

img {
max-width: 100%;
height: auto;
object-fit: cover;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ function CollectionCard({ id }: Props) {
const collection = useCollection(id);
const { config, collectionOwner, tokens, totalNumberOfTokens } = collection || {};

const renderNFTs = () =>
tokens?.map(([nftId, { mediaUrl }]) => (
<li key={nftId}>
<img src={getIpfsLink(mediaUrl)} alt="" />
</li>
));

return config && collectionOwner && tokens !== undefined && totalNumberOfTokens !== undefined ? (
<li className={styles.collection}>
<Link to={generatePath(ROUTE.COLLECTION, { id })}>
Expand All @@ -41,6 +48,8 @@ function CollectionCard({ id }: Props) {
<div className={styles.cards}>
<MintLimitInfoCard heading={totalNumberOfTokens} text={tokens.length} color="dark" />
</div>

<ul className={styles.nfts}>{renderNFTs()}</ul>
</Link>
</li>
) : null;
Expand Down

0 comments on commit 20a15d2

Please sign in to comment.