From fe99f589a4afbbf650c5958f4a1ca4180e1b69ca Mon Sep 17 00:00:00 2001 From: Nikita Yutanov Date: Mon, 15 Jan 2024 19:36:25 +0300 Subject: [PATCH] Fix nft mint with price --- .../collection-header/collection-header.tsx | 16 ++++++++++++++-- .../components/collection-header/nft 350.svg | 1 - .../components/collection/collection.tsx | 2 ++ .../collections/components/mint-nft/mint-nft.tsx | 5 +++-- 4 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 frontend/src/features/collections/components/collection-header/nft 350.svg diff --git a/frontend/src/features/collections/components/collection-header/collection-header.tsx b/frontend/src/features/collections/components/collection-header/collection-header.tsx index 9f08131..30f8578 100644 --- a/frontend/src/features/collections/components/collection-header/collection-header.tsx +++ b/frontend/src/features/collections/components/collection-header/collection-header.tsx @@ -15,12 +15,24 @@ type Props = { owner: HexString; tokensCount: number; tokensLimit: string | null; + mintPrice: string; name: string; description: string; socials: Record; }; -function CollectionHeader({ id, banner, logo, owner, tokensCount, tokensLimit, name, description, socials }: Props) { +function CollectionHeader({ + id, + banner, + logo, + owner, + tokensCount, + tokensLimit, + name, + description, + mintPrice, + socials, +}: Props) { const socialEntries = Object.entries(socials).filter(([, value]) => !!value) as [string, string][]; const renderSocials = () => @@ -57,7 +69,7 @@ function CollectionHeader({ id, banner, logo, owner, tokensCount, tokensLimit, n
    {renderSocials()}
- +
diff --git a/frontend/src/features/collections/components/collection-header/nft 350.svg b/frontend/src/features/collections/components/collection-header/nft 350.svg deleted file mode 100644 index 0615749..0000000 --- a/frontend/src/features/collections/components/collection-header/nft 350.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/features/collections/components/collection/collection.tsx b/frontend/src/features/collections/components/collection/collection.tsx index 0c7dd8b..11b5290 100644 --- a/frontend/src/features/collections/components/collection/collection.tsx +++ b/frontend/src/features/collections/components/collection/collection.tsx @@ -1,4 +1,5 @@ import { HexString } from '@gear-js/api'; +import { withoutCommas } from '@gear-js/react-hooks'; import { Button } from '@gear-js/vara-ui'; import { useParams } from 'react-router-dom'; @@ -38,6 +39,7 @@ function Collection() { tokensLimit={totalNumberOfTokens} name={config.name} description={config.description} + mintPrice={withoutCommas(config.paymentForMint)} socials={config.additionalLinks || {}} /> diff --git a/frontend/src/features/collections/components/mint-nft/mint-nft.tsx b/frontend/src/features/collections/components/mint-nft/mint-nft.tsx index d41b602..20a257b 100644 --- a/frontend/src/features/collections/components/mint-nft/mint-nft.tsx +++ b/frontend/src/features/collections/components/mint-nft/mint-nft.tsx @@ -6,12 +6,13 @@ import { useCollectionSendMessage } from '@/hooks'; type Props = { collectionId: HexString; + value: string; }; -function Component({ collectionId }: Props) { +function Component({ collectionId, value }: Props) { const sendMessage = useCollectionSendMessage(collectionId); - const handleClick = () => sendMessage({ payload: { Mint: null } }); + const handleClick = () => sendMessage({ payload: { Mint: null }, value }); return