From 3bdc7953df53bfa31b09a5d3a3cb48bd8aa6176f Mon Sep 17 00:00:00 2001 From: Sergey Kintsel Date: Sat, 7 Oct 2023 22:23:07 +0100 Subject: [PATCH] Update nfts drawer tab to match design --- .../AccountDrawerDisplay.test.tsx | 1 - .../AccountDrawer/AssetsPanel/AssetsPanel.tsx | 7 +---- .../AccountDrawer/AssetsPanel/NFTsGrid.tsx | 30 +++++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/AccountDrawer/AccountDrawerDisplay.test.tsx b/src/components/AccountDrawer/AccountDrawerDisplay.test.tsx index 75f4198e1e..7a5e70898c 100644 --- a/src/components/AccountDrawer/AccountDrawerDisplay.test.tsx +++ b/src/components/AccountDrawer/AccountDrawerDisplay.test.tsx @@ -151,7 +151,6 @@ describe("", () => { expect(screen.getByTestId("account-card-nfts-tab")).toBeInTheDocument(); screen.getByTestId("account-card-nfts-tab").click(); expect(screen.queryAllByTestId("account-card-nfts-tab")).toHaveLength(1); - expect(screen.getByText(mockNft.token.metadata?.name as string)).toBeInTheDocument(); }); it("should display accounts operations under operations tab if any", () => { diff --git a/src/components/AccountDrawer/AssetsPanel/AssetsPanel.tsx b/src/components/AccountDrawer/AssetsPanel/AssetsPanel.tsx index a215c5f67e..4c3fd2957c 100644 --- a/src/components/AccountDrawer/AssetsPanel/AssetsPanel.tsx +++ b/src/components/AccountDrawer/AssetsPanel/AssetsPanel.tsx @@ -70,12 +70,7 @@ export const AssetsPanel: React.FC<{ - + diff --git a/src/components/AccountDrawer/AssetsPanel/NFTsGrid.tsx b/src/components/AccountDrawer/AssetsPanel/NFTsGrid.tsx index 5a822edc30..db23c3a900 100644 --- a/src/components/AccountDrawer/AssetsPanel/NFTsGrid.tsx +++ b/src/components/AccountDrawer/AssetsPanel/NFTsGrid.tsx @@ -1,17 +1,24 @@ -import { AspectRatio, Heading, Image, SimpleGrid, SimpleGridProps } from "@chakra-ui/react"; +import { + AspectRatio, + Card, + CardBody, + Image, + SimpleGrid, + SimpleGridProps, +} from "@chakra-ui/react"; import { every } from "lodash"; import { FC } from "react"; import { Link } from "react-router-dom"; import { RawPkh } from "../../../types/Address"; import { fullId, thumbnailUri } from "../../../types/Token"; import { NFTBalance } from "../../../types/TokenBalance"; -import { truncate } from "../../../utils/format"; import { getIPFSurl } from "../../../utils/token/nftUtils"; import { NoNFTs } from "../../NoItems"; +import colors from "../../../style/colors"; export const NFTsGrid: FC< - { nftsByOwner: Record; showName?: boolean } & SimpleGridProps -> = ({ nftsByOwner, showName, ...rest }) => { + { nftsByOwner: Record } & SimpleGridProps +> = ({ nftsByOwner, ...rest }) => { const noNfts = every(nftsByOwner, nfts => !nfts || nfts.length === 0); if (noNfts) { return ; @@ -25,14 +32,13 @@ export const NFTsGrid: FC< const fallbackUrl = getIPFSurl(nft.displayUri); return ( - - - - {showName && nft.metadata.name && ( - - {truncate(nft.metadata.name, 12)} - - )} + + + + + + + ); });