Skip to content

Commit

Permalink
fix: handle unlimited supply, show royalties of the collection, and r…
Browse files Browse the repository at this point in the history
…oute back to the details page after a mint.
  • Loading branch information
kespinola committed Jun 15, 2023
1 parent 0ea280f commit c137bd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/app/(project)/projects/[project]/drops/MintEdition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export default function MintEdition({ project, drop }: MintEditionProps) {
{ query: GetCollectionHolders, variables: { project, drop } },
{ query: GetCollectionPurchases, variables: { project, drop } },
],
onCompleted: () => {
router.back();
}
}
);

Expand Down
12 changes: 8 additions & 4 deletions src/app/(project)/projects/[project]/drops/[drop]/Drop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,18 @@ export default function Drop({ children, project, drop }: DropProps): JSX.Elemen
<div className="w-full text-xs font-medium">
<div className="flex items-center justify-between">
<span className="text-white">
{`Status: ${dropQuery.data?.project?.drop?.status} - ${dropQuery.data?.project?.drop?.collection?.totalMints}/
${dropQuery.data?.project?.drop?.collection?.supply}`}
Status: {dropQuery.data?.project?.drop?.status} -
{dropQuery.data?.project?.drop?.collection?.totalMints}
{dropQuery.data?.project?.drop?.collection?.supply &&
`/ ${dropQuery.data?.project?.drop?.collection?.supply}`}
<span className="text-gray-500"> - minted</span>
</span>
{inTheFuture(startTime) ? (
<span className="text-gray-400">{daysUntil(startTime)} to start</span>
) : (
<span>{`${percent}%`}</span>
dropQuery.data?.project?.drop?.collection?.supply && (
<span>{`${percent}%`}</span>
)
)}
</div>
<div className="w-full rounded-full h-[12px] bg-stone-800 mt-1 relative overflow-hidden">
Expand Down Expand Up @@ -245,7 +249,7 @@ export default function Drop({ children, project, drop }: DropProps): JSX.Elemen
<div className="basis-1/2 h-full flex flex-col px-4 gap-2 text-sm">
<div className="flex items-center justify-between gap-2">
<span className="text-gray-400">Royalties</span>
<span>{dropData?.collection.sellerFeeBasisPoints}</span>
<span>{dropData?.collection.royalties}</span>
</div>
<div className="flex items-center justify-between gap-2">
<span className="text-gray-400">Royalties recipients</span>
Expand Down
1 change: 1 addition & 0 deletions src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function PurchaseStatusPill({ status, className }: PurchaseStatusPillProps) {
className={clsx('rounded-full py-1 px-3 text-xs font-medium max-w-min', className, {
'bg-blue-400 bg-opacity-20 text-blue-400': status === CreationStatus.Pending,
'bg-green-400 bg-opacity-20 text-green-400': status === CreationStatus.Created,
'bg-red-500 bg-opacity-20 text-red-500': status === CreationStatus.Failed,
})}
>
{label}
Expand Down

0 comments on commit c137bd4

Please sign in to comment.