From 2d8c4622787750c0e8c19e4f9aff83fb62308fd2 Mon Sep 17 00:00:00 2001 From: ikprk <168457495+ikprk@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:33:20 +0200 Subject: [PATCH] :face_exhaling: Small UI fixes (#6366) * Correct token symbol in table * Fix owner avatar in nft drawer * Add token symbol to the tab --- .../AmmTransactionsTable/AmmTransactionsTable.tsx | 9 ++++++--- .../NftPurchaseBottomDrawer.tsx | 5 ++--- .../studio/CrtDashboard/tabs/CrtMarketTab.tsx | 6 +++++- .../src/views/viewer/ChannelView/ChannelView.tsx | 14 +++++++++++++- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx b/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx index c5ef42b179..878129a6df 100644 --- a/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx +++ b/packages/atlas/src/components/_crt/AmmTransactionsTable/AmmTransactionsTable.tsx @@ -49,9 +49,10 @@ const tableEmptyState = { type AmmTransactionsTableProps = { data: FullAmmCurveFragment['transactions'] loading: boolean + symbol: string } -export const AmmTransactionsTable = ({ data, loading }: AmmTransactionsTableProps) => { +export const AmmTransactionsTable = ({ data, loading, symbol }: AmmTransactionsTableProps) => { const mappedData = useMemo( () => data.map((row) => ({ @@ -64,10 +65,12 @@ export const AmmTransactionsTable = ({ data, loading }: AmmTransactionsTableProp /> ), pricePerUnit: , - quantity: , + quantity: ( + + ), amount: , })), - [data] + [data, symbol] ) return ( diff --git a/packages/atlas/src/views/global/NftPurchaseBottomDrawer/NftPurchaseBottomDrawer.tsx b/packages/atlas/src/views/global/NftPurchaseBottomDrawer/NftPurchaseBottomDrawer.tsx index 0af7e2c802..b4a5fb1748 100644 --- a/packages/atlas/src/views/global/NftPurchaseBottomDrawer/NftPurchaseBottomDrawer.tsx +++ b/packages/atlas/src/views/global/NftPurchaseBottomDrawer/NftPurchaseBottomDrawer.tsx @@ -64,9 +64,8 @@ export const NftPurchaseBottomDrawer: FC = () => { const { userBid, canChangeBid, userBidUnlockDate } = useNftState(nft) const thumbnailUrls = nft?.video.thumbnailPhoto?.resolvedUrls const creatorAvatarUrls = nft?.video.channel.avatarPhoto?.resolvedUrls - const { urls: ownerMemberAvatarUrls } = getMemberAvatar( - nft?.owner.__typename === 'NftOwnerMember' ? nft.owner.member : null - ) + const { urls: ownerMemberAvatarUrls } = + nft?.owner.__typename === 'NftOwnerMember' ? getMemberAvatar(nft.owner.member) : { urls: creatorAvatarUrls } const mdMatch = useMediaMatch('md') const { accountBalance } = useSubscribeAccountBalance() const timestamp = useMsTimestamp({ shouldStop: !currentAction }) diff --git a/packages/atlas/src/views/studio/CrtDashboard/tabs/CrtMarketTab.tsx b/packages/atlas/src/views/studio/CrtDashboard/tabs/CrtMarketTab.tsx index 9b1e35dc04..dc45cf9830 100644 --- a/packages/atlas/src/views/studio/CrtDashboard/tabs/CrtMarketTab.tsx +++ b/packages/atlas/src/views/studio/CrtDashboard/tabs/CrtMarketTab.tsx @@ -100,7 +100,11 @@ export const CrtMarketTab = ({ token }: CrtMarketTabProps) => { }} /> - + ) } diff --git a/packages/atlas/src/views/viewer/ChannelView/ChannelView.tsx b/packages/atlas/src/views/viewer/ChannelView/ChannelView.tsx index b3c5fe17e9..401cbbfddd 100644 --- a/packages/atlas/src/views/viewer/ChannelView/ChannelView.tsx +++ b/packages/atlas/src/views/viewer/ChannelView/ChannelView.tsx @@ -7,6 +7,7 @@ import { useParams, useSearchParams } from 'react-router-dom' import { useChannelNftCollectors, useFullChannel } from '@/api/hooks/channel' import { useVideoCount } from '@/api/hooks/video' import { OwnedNftOrderByInput, VideoOrderByInput } from '@/api/queries/__generated__/baseTypes.generated' +import { useGetFullCreatorTokenQuery } from '@/api/queries/__generated__/creatorTokens.generated' import { useGetNftsCountQuery } from '@/api/queries/__generated__/nfts.generated' import { SvgActionCheck, SvgActionFilters, SvgActionFlag, SvgActionMore, SvgActionPlus } from '@/assets/icons' import { ChannelTitle } from '@/components/ChannelTitle' @@ -92,6 +93,10 @@ export const ChannelView: FC = () => { const filteredTabs = TABS.filter((tab) => tab === 'Token' ? !!tab && (isChannelOwner || !!channel?.creatorToken?.token.id) : !!tab ) + const { data: tokenData } = useGetFullCreatorTokenQuery({ + variables: { id: channel?.creatorToken?.token.id ?? '' }, + skip: !channel?.creatorToken?.token.id, + }) const { videoCount } = useVideoCount({ where: getPublicCryptoVideoFilter({ channel: { @@ -213,7 +218,14 @@ export const ChannelView: FC = () => { const mappedTabs = filteredTabs.map((tab) => ({ name: tab, - pillText: tab === 'Videos' ? videoCount : tab === 'NFTs' ? nftCountData?.ownedNftsConnection.totalCount : undefined, + pillText: + tab === 'Videos' + ? videoCount + : tab === 'NFTs' + ? nftCountData?.ownedNftsConnection.totalCount + : tab === 'Token' + ? tokenData?.creatorTokenById?.symbol ?? undefined + : undefined, })) const getChannelContent = (tab: (typeof TABS)[number]) => {