Skip to content

Commit c91ea0f

Browse files
committed
implemented functionality of Claimable
1 parent 0269675 commit c91ea0f

File tree

3 files changed

+554
-14
lines changed

3 files changed

+554
-14
lines changed

apps/dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"preinstall": "npx only-allow pnpm",
7-
"dev": "next dev --turbo",
7+
"dev": "next dev",
88
"build": "next build",
99
"start": "next start",
1010
"format": "biome format ./src --write",

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/Mintable.tsx

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from "@/components/ui/accordion";
99
import { Alert, AlertTitle } from "@/components/ui/alert";
1010
import { Button } from "@/components/ui/button";
11+
import { Checkbox, CheckboxWithLabel } from "@/components/ui/checkbox";
1112
import {
1213
Form,
1314
FormControl,
@@ -47,6 +48,7 @@ export type UpdateFormValues = {
4748
// TODO - add form validation with zod schema for mint form
4849

4950
export type MintFormValues = NFTMetadataInputLimited & {
51+
useNextTokenId: boolean;
5052
recipient: string;
5153
amount: number;
5254
supply: number;
@@ -292,6 +294,7 @@ function MintNFTSection(props: {
292294
}) {
293295
const form = useForm<MintFormValues>({
294296
values: {
297+
useNextTokenId: false,
295298
supply: 1,
296299
customImage: "",
297300
customAnimationUrl: "",
@@ -313,6 +316,8 @@ function MintNFTSection(props: {
313316
});
314317
};
315318

319+
const useNextTokenId = form.watch("useNextTokenId");
320+
316321
return (
317322
<Form {...form}>
318323
<form onSubmit={form.handleSubmit(onSubmit)}>
@@ -426,19 +431,39 @@ function MintNFTSection(props: {
426431
/>
427432
)}
428433

429-
{!props.isErc721 && !props.isSequentialTokenIdInstalled && (
430-
<FormField
431-
control={form.control}
432-
name="tokenId"
433-
render={({ field }) => (
434-
<FormItem className="flex-1">
435-
<FormLabel>Token ID</FormLabel>
436-
<FormControl>
437-
<Input {...field} />
438-
</FormControl>
439-
</FormItem>
440-
)}
441-
/>
434+
{!props.isErc721 && (
435+
<div className="relative flex-1">
436+
<FormField
437+
control={form.control}
438+
name="tokenId"
439+
render={({ field }) => (
440+
<FormItem className="flex-1">
441+
<FormLabel>Token ID</FormLabel>
442+
<FormControl>
443+
<Input {...field} disabled={useNextTokenId} />
444+
</FormControl>
445+
</FormItem>
446+
)}
447+
/>
448+
449+
<FormField
450+
control={form.control}
451+
name="useNextTokenId"
452+
render={({ field }) => (
453+
<FormItem className="absolute top-0 right-0 flex items-center gap-2">
454+
<CheckboxWithLabel>
455+
<Checkbox
456+
className="mt-0"
457+
checked={field.value}
458+
onCheckedChange={field.onChange}
459+
/>
460+
Use next token ID
461+
</CheckboxWithLabel>
462+
<FormMessage />
463+
</FormItem>
464+
)}
465+
/>
466+
</div>
442467
)}
443468
</div>
444469

0 commit comments

Comments
 (0)