Skip to content

Commit

Permalink
Merge pull request #354 from reservoirprotocol/ted/fix-free-mint
Browse files Browse the repository at this point in the history
Fix mint button logic for free mint
  • Loading branch information
ted-palmer authored Oct 24, 2023
2 parents 384f45f + 3564609 commit e93e757
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pages/[chain]/collection/[contract].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ const CollectionPage: NextPage<Props> = ({ id, ssr }) => {
(stage) => stage.kind === 'public'
)

const mintPrice = mintData?.price?.amount?.decimal
? mintData?.price?.amount?.decimal === 0
? 'Free'
: `${
mintData?.price?.amount?.decimal
} ${mintData?.price?.currency?.symbol?.toUpperCase()}`
: undefined
const mintPrice =
typeof mintData?.price?.amount?.decimal === 'number' &&
mintData?.price?.amount?.decimal !== null &&
mintData?.price?.amount?.decimal !== undefined
? mintData?.price?.amount?.decimal === 0
? 'Free'
: `${
mintData?.price?.amount?.decimal
} ${mintData?.price?.currency?.symbol?.toUpperCase()}`
: undefined

let tokenQuery: Parameters<typeof useDynamicTokens>['0'] = {
limit: 20,
Expand Down

1 comment on commit e93e757

@vercel
Copy link

@vercel vercel bot commented on e93e757 Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.