From 5bd633b0420c30369cc79f4e1456491f2983e549 Mon Sep 17 00:00:00 2001 From: bigint <69431456+bigint@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:03:02 +0530 Subject: [PATCH 1/2] fix: tokens metadata for creators token --- .../LensOpenActions/CollectModule/index.tsx | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/apps/web/src/components/Publication/LensOpenActions/CollectModule/index.tsx b/apps/web/src/components/Publication/LensOpenActions/CollectModule/index.tsx index 28837220c239..e04a46bc4a0e 100644 --- a/apps/web/src/components/Publication/LensOpenActions/CollectModule/index.tsx +++ b/apps/web/src/components/Publication/LensOpenActions/CollectModule/index.tsx @@ -5,6 +5,7 @@ import Slug from '@components/Shared/Slug'; import { BanknotesIcon, ClockIcon, + CurrencyDollarIcon, PhotoIcon, PuzzlePieceIcon, RectangleStackIcon, @@ -20,6 +21,7 @@ import type { SimpleCollectOpenActionSettings } from '@hey/lens'; import { FollowModuleType } from '@hey/lens'; +import getAllTokens from '@hey/lib/api/getAllTokens'; import formatAddress from '@hey/lib/formatAddress'; import getAssetSymbol from '@hey/lib/getAssetSymbol'; import getProfile from '@hey/lib/getProfile'; @@ -47,6 +49,11 @@ const CollectModule: FC = ({ publication, openAction }) => { ? publication?.mirrorOn : publication; + const { data: allowedTokens } = useQuery({ + queryKey: ['getAllTokens'], + queryFn: () => getAllTokens() + }); + const [showCollectorsModal, setShowCollectorsModal] = useState(false); const [countOpenActions, setCountOpenActions] = useState( targetPublication.stats.countOpenActions @@ -66,6 +73,8 @@ const CollectModule: FC = ({ publication, openAction }) => { const isMultirecipientFeeCollectModule = collectModule.__typename === 'MultirecipientFeeCollectOpenActionSettings'; const percentageCollected = (countOpenActions / collectLimit) * 100; + const enabledTokens = allowedTokens?.map((t) => t.symbol); + const isTokenEnabled = enabledTokens?.includes(currency); const { data: usdPrice } = useQuery({ queryKey: ['getRedstonePrice', currency], @@ -108,18 +117,22 @@ const CollectModule: FC = ({ publication, openAction }) => { {amount ? (
- {currency} + {isTokenEnabled ? ( + {currency} + ) : ( + + )} {amount} {currency} - {usdPrice ? ( + {isTokenEnabled && usdPrice ? ( <> ยท From 375e8bb1b6e6df28e6a3913c0009d2a29e44dcb3 Mon Sep 17 00:00:00 2001 From: bigint <69431456+bigint@users.noreply.github.com> Date: Sun, 3 Dec 2023 19:04:10 +0530 Subject: [PATCH 2/2] fix: avatar on fee recipient list --- .../Publication/LensOpenActions/CollectModule/Splits.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/web/src/components/Publication/LensOpenActions/CollectModule/Splits.tsx b/apps/web/src/components/Publication/LensOpenActions/CollectModule/Splits.tsx index bae4d468ef84..79ffacb9595c 100644 --- a/apps/web/src/components/Publication/LensOpenActions/CollectModule/Splits.tsx +++ b/apps/web/src/components/Publication/LensOpenActions/CollectModule/Splits.tsx @@ -3,7 +3,7 @@ import { POLYGONSCAN_URL } from '@hey/data/constants'; import type { Profile, RecipientDataOutput } from '@hey/lens'; import { useProfilesQuery } from '@hey/lens'; import formatAddress from '@hey/lib/formatAddress'; -import getLennyURL from '@hey/lib/getLennyURL'; +import getAvatar from '@hey/lib/getAvatar'; import getProfile from '@hey/lib/getProfile'; import getStampFyiURL from '@hey/lib/getStampFyiURL'; import Link from 'next/link'; @@ -54,11 +54,7 @@ const Splits: FC = ({ recipients }) => { <> Avatar {profile ? (