Skip to content

Commit 2d2aff4

Browse files
committed
last fixes for switching PropertiesFormValues to shadcnui + tailwind
1 parent 2a102e2 commit 2d2aff4

File tree

5 files changed

+117
-119
lines changed

5 files changed

+117
-119
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export type UploadMetadataFormValues = NFTMetadataInputLimited & {
3838
supply: number;
3939
customImage: string;
4040
customAnimationUrl: string;
41+
attributes: { trait_type: string; value: string }[];
4142
tokenId?: string;
4243
};
4344

@@ -121,6 +122,7 @@ function UploadMetadataNFTSection(props: {
121122
supply: 1,
122123
customImage: "",
123124
customAnimationUrl: "",
125+
attributes: [{ trait_type: "", value: "" }],
124126
},
125127
reValidateMode: "onChange",
126128
});

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export type MintFormValues = NFTMetadataInputLimited & {
5454
supply: number;
5555
customImage: string;
5656
customAnimationUrl: string;
57+
attributes: { trait_type: string; value: string }[];
5758
tokenId?: string;
5859
};
5960

@@ -305,6 +306,7 @@ function MintNFTSection(props: {
305306
customImage: "",
306307
customAnimationUrl: "",
307308
recipient: "",
309+
attributes: [{ trait_type: "", value: "" }],
308310
amount: 1,
309311
},
310312
reValidateMode: "onChange",

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

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ChakraProviderSetup } from "@/components/ChakraProviderSetup";
21
import { Checkbox } from "@/components/ui/checkbox";
32
import type { Meta, StoryObj } from "@storybook/react";
43
import { useMutation } from "@tanstack/react-query";
@@ -59,32 +58,30 @@ function Component() {
5958

6059
// TODO - remove ChakraProviderSetup after converting the chakra components used in BatchMetadataModuleUI
6160
return (
62-
<ChakraProviderSetup>
63-
<div className="container flex max-w-[1150px] flex-col gap-10 py-10">
64-
<div className="flex items-center gap-5">
65-
<CheckboxWithLabel
66-
value={isOwner}
67-
onChange={setIsOwner}
68-
id="isOwner"
69-
label="Is Owner"
70-
/>
71-
</div>
72-
73-
<BadgeContainer label="Default">
74-
<BatchMetadataModuleUI
75-
contractInfo={contractInfo}
76-
moduleAddress="0x0000000000000000000000000000000000000000"
77-
uploadMetadata={uploadMetadataStub}
78-
uninstallButton={{
79-
onClick: async () => removeMutation.mutateAsync(),
80-
isPending: removeMutation.isPending,
81-
}}
82-
isOwnerAccount={isOwner}
83-
/>
84-
</BadgeContainer>
85-
<Toaster richColors />
61+
<div className="container flex max-w-[1150px] flex-col gap-10 py-10">
62+
<div className="flex items-center gap-5">
63+
<CheckboxWithLabel
64+
value={isOwner}
65+
onChange={setIsOwner}
66+
id="isOwner"
67+
label="Is Owner"
68+
/>
8669
</div>
87-
</ChakraProviderSetup>
70+
71+
<BadgeContainer label="Default">
72+
<BatchMetadataModuleUI
73+
contractInfo={contractInfo}
74+
moduleAddress="0x0000000000000000000000000000000000000000"
75+
uploadMetadata={uploadMetadataStub}
76+
uninstallButton={{
77+
onClick: async () => removeMutation.mutateAsync(),
78+
isPending: removeMutation.isPending,
79+
}}
80+
isOwnerAccount={isOwner}
81+
/>
82+
</BadgeContainer>
83+
<Toaster richColors />
84+
</div>
8885
);
8986
}
9087

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

Lines changed: 89 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ChakraProviderSetup } from "@/components/ChakraProviderSetup";
21
import { Checkbox } from "@/components/ui/checkbox";
32
import type { Meta, StoryObj } from "@storybook/react";
43
import { useMutation } from "@tanstack/react-query";
@@ -71,98 +70,96 @@ function Component() {
7170

7271
// TODO - remove ChakraProviderSetup after converting the chakra components used in MintableModuleUI
7372
return (
74-
<ChakraProviderSetup>
75-
<div className="container flex max-w-[1150px] flex-col gap-10 py-10">
76-
<div className="flex items-center gap-5">
77-
<CheckboxWithLabel
78-
value={isOwner}
79-
onChange={setIsOwner}
80-
id="isOwner"
81-
label="Is Owner"
82-
/>
83-
84-
<CheckboxWithLabel
85-
value={isErc721}
86-
onChange={setIsErc721}
87-
id="isErc721"
88-
label="isErc721"
89-
/>
90-
91-
<CheckboxWithLabel
92-
value={isSequentialTokenIdInstalled}
93-
onChange={setIsSequentialTokenIdInstalled}
94-
id="isSequentialTokenIdInstalled"
95-
label="isSequentialTokenIdInstalled"
96-
/>
97-
98-
<CheckboxWithLabel
99-
value={isBatchMetadataInstalled}
100-
onChange={setIsBatchMetadataInstalled}
101-
id="isBatchMetadataInstalled"
102-
label="isBatchMetadataInstalled"
103-
/>
104-
</div>
105-
106-
<BadgeContainer label="Empty Primary Sale Recipient">
107-
<MintableModuleUI
108-
contractInfo={contractInfo}
109-
moduleAddress="0x0000000000000000000000000000000000000000"
110-
isPending={false}
111-
primarySaleRecipient={""}
112-
updatePrimaryRecipient={updatePrimaryRecipientStub}
113-
mint={mintStub}
114-
uninstallButton={{
115-
onClick: async () => removeMutation.mutateAsync(),
116-
isPending: removeMutation.isPending,
117-
}}
118-
isOwnerAccount={isOwner}
119-
isErc721={isErc721}
120-
isSequentialTokenIdInstalled={isSequentialTokenIdInstalled}
121-
isBatchMetadataInstalled={isBatchMetadataInstalled}
122-
/>
123-
</BadgeContainer>
124-
125-
<BadgeContainer label="Filled Primary Sale Recipient">
126-
<MintableModuleUI
127-
contractInfo={contractInfo}
128-
moduleAddress="0x0000000000000000000000000000000000000000"
129-
isPending={false}
130-
primarySaleRecipient={testAddress1}
131-
updatePrimaryRecipient={updatePrimaryRecipientStub}
132-
mint={mintStub}
133-
uninstallButton={{
134-
onClick: () => removeMutation.mutateAsync(),
135-
isPending: removeMutation.isPending,
136-
}}
137-
isOwnerAccount={isOwner}
138-
isErc721={isErc721}
139-
isSequentialTokenIdInstalled={isSequentialTokenIdInstalled}
140-
isBatchMetadataInstalled={isBatchMetadataInstalled}
141-
/>
142-
</BadgeContainer>
143-
144-
<BadgeContainer label="Pending">
145-
<MintableModuleUI
146-
contractInfo={contractInfo}
147-
moduleAddress="0x0000000000000000000000000000000000000000"
148-
isPending={true}
149-
primarySaleRecipient={testAddress1}
150-
updatePrimaryRecipient={updatePrimaryRecipientStub}
151-
mint={mintStub}
152-
uninstallButton={{
153-
onClick: () => removeMutation.mutateAsync(),
154-
isPending: removeMutation.isPending,
155-
}}
156-
isOwnerAccount={isOwner}
157-
isErc721={isErc721}
158-
isSequentialTokenIdInstalled={isSequentialTokenIdInstalled}
159-
isBatchMetadataInstalled={isBatchMetadataInstalled}
160-
/>
161-
</BadgeContainer>
162-
163-
<Toaster richColors />
73+
<div className="container flex max-w-[1150px] flex-col gap-10 py-10">
74+
<div className="flex items-center gap-5">
75+
<CheckboxWithLabel
76+
value={isOwner}
77+
onChange={setIsOwner}
78+
id="isOwner"
79+
label="Is Owner"
80+
/>
81+
82+
<CheckboxWithLabel
83+
value={isErc721}
84+
onChange={setIsErc721}
85+
id="isErc721"
86+
label="isErc721"
87+
/>
88+
89+
<CheckboxWithLabel
90+
value={isSequentialTokenIdInstalled}
91+
onChange={setIsSequentialTokenIdInstalled}
92+
id="isSequentialTokenIdInstalled"
93+
label="isSequentialTokenIdInstalled"
94+
/>
95+
96+
<CheckboxWithLabel
97+
value={isBatchMetadataInstalled}
98+
onChange={setIsBatchMetadataInstalled}
99+
id="isBatchMetadataInstalled"
100+
label="isBatchMetadataInstalled"
101+
/>
164102
</div>
165-
</ChakraProviderSetup>
103+
104+
<BadgeContainer label="Empty Primary Sale Recipient">
105+
<MintableModuleUI
106+
contractInfo={contractInfo}
107+
moduleAddress="0x0000000000000000000000000000000000000000"
108+
isPending={false}
109+
primarySaleRecipient={""}
110+
updatePrimaryRecipient={updatePrimaryRecipientStub}
111+
mint={mintStub}
112+
uninstallButton={{
113+
onClick: async () => removeMutation.mutateAsync(),
114+
isPending: removeMutation.isPending,
115+
}}
116+
isOwnerAccount={isOwner}
117+
isErc721={isErc721}
118+
isSequentialTokenIdInstalled={isSequentialTokenIdInstalled}
119+
isBatchMetadataInstalled={isBatchMetadataInstalled}
120+
/>
121+
</BadgeContainer>
122+
123+
<BadgeContainer label="Filled Primary Sale Recipient">
124+
<MintableModuleUI
125+
contractInfo={contractInfo}
126+
moduleAddress="0x0000000000000000000000000000000000000000"
127+
isPending={false}
128+
primarySaleRecipient={testAddress1}
129+
updatePrimaryRecipient={updatePrimaryRecipientStub}
130+
mint={mintStub}
131+
uninstallButton={{
132+
onClick: () => removeMutation.mutateAsync(),
133+
isPending: removeMutation.isPending,
134+
}}
135+
isOwnerAccount={isOwner}
136+
isErc721={isErc721}
137+
isSequentialTokenIdInstalled={isSequentialTokenIdInstalled}
138+
isBatchMetadataInstalled={isBatchMetadataInstalled}
139+
/>
140+
</BadgeContainer>
141+
142+
<BadgeContainer label="Pending">
143+
<MintableModuleUI
144+
contractInfo={contractInfo}
145+
moduleAddress="0x0000000000000000000000000000000000000000"
146+
isPending={true}
147+
primarySaleRecipient={testAddress1}
148+
updatePrimaryRecipient={updatePrimaryRecipientStub}
149+
mint={mintStub}
150+
uninstallButton={{
151+
onClick: () => removeMutation.mutateAsync(),
152+
isPending: removeMutation.isPending,
153+
}}
154+
isOwnerAccount={isOwner}
155+
isErc721={isErc721}
156+
isSequentialTokenIdInstalled={isSequentialTokenIdInstalled}
157+
isBatchMetadataInstalled={isBatchMetadataInstalled}
158+
/>
159+
</BadgeContainer>
160+
161+
<Toaster richColors />
162+
</div>
166163
);
167164
}
168165

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function PropertiesFormControl<
7979

8080
<FormField
8181
control={form.control}
82-
name={`attributes.${index}.trait_type` as Path<TFieldValues>}
82+
name={`attributes.${index}.value` as Path<TFieldValues>}
8383
render={({ field }) => (
8484
<FormItem className="grow">
8585
<FormControl>

0 commit comments

Comments
 (0)