Skip to content

Commit 1d8e153

Browse files
committed
it passes typecheck and lint
1 parent b87f2e1 commit 1d8e153

File tree

2 files changed

+223
-235
lines changed

2 files changed

+223
-235
lines changed

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

Lines changed: 94 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -8,131 +8,119 @@ import { ThirdwebProvider } from "thirdweb/react";
88
import { type MintableModuleFormValues, MintableModuleUI } from "./Mintable";
99

1010
const meta = {
11-
title: "Modules/Mintable",
12-
component: Component,
13-
parameters: {
14-
layout: "centered",
15-
},
11+
title: "Modules/Mintable",
12+
component: Component,
13+
parameters: {
14+
layout: "centered",
15+
},
1616
} satisfies Meta<typeof Component>;
1717

1818
export default meta;
1919
type Story = StoryObj<typeof meta>;
2020

2121
export const Desktop: Story = {
22-
args: {},
22+
args: {},
2323
};
2424

2525
export const Mobile: Story = {
26-
args: {},
27-
parameters: {
28-
viewport: mobileViewport("iphone14"),
29-
},
26+
args: {},
27+
parameters: {
28+
viewport: mobileViewport("iphone14"),
29+
},
3030
};
3131

3232
const testAddress1 = "0x1F846F6DAE38E1C88D71EAA191760B15f38B7A37";
3333

3434
function Component() {
35-
const [isOwner, setIsOwner] = useState(true);
36-
async function updateStub(values: MintableModuleFormValues) {
37-
console.log("submitting", values);
38-
await new Promise((resolve) => setTimeout(resolve, 1000));
39-
}
35+
const [isOwner, setIsOwner] = useState(true);
36+
async function updateStub(values: MintableModuleFormValues) {
37+
console.log("submitting", values);
38+
await new Promise((resolve) => setTimeout(resolve, 1000));
39+
}
4040

41-
async function mintStub(values: {
42-
tokenId: string;
43-
amount: string;
44-
recipient: string;
45-
}) {
46-
console.log("submitting", values);
47-
await new Promise((resolve) => setTimeout(resolve, 1000));
48-
}
41+
const removeMutation = useMutation({
42+
mutationFn: async () => {
43+
await new Promise((resolve) => setTimeout(resolve, 1000));
44+
},
45+
onSuccess() {
46+
toast.success("Module removed successfully");
47+
},
48+
});
4949

50-
const removeMutation = useMutation({
51-
mutationFn: async () => {
52-
await new Promise((resolve) => setTimeout(resolve, 1000));
53-
},
54-
onSuccess() {
55-
toast.success("Module removed successfully");
56-
},
57-
});
50+
const contractInfo = {
51+
name: "Module Name",
52+
description:
53+
"lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore ",
54+
publisher: "0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024",
55+
version: "1.0.0",
56+
};
5857

59-
const contractInfo = {
60-
name: "Module Name",
61-
description:
62-
"lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore ",
63-
publisher: "0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024",
64-
version: "1.0.0",
65-
};
58+
return (
59+
<ThirdwebProvider>
60+
<div className="container flex max-w-[1150px] flex-col gap-10 py-10">
61+
<div className="items-top flex space-x-2">
62+
<Checkbox
63+
id="terms1"
64+
checked={isOwner}
65+
onCheckedChange={(v) => setIsOwner(!!v)}
66+
/>
67+
<div className="grid gap-1.5 leading-none">
68+
<label
69+
htmlFor="terms1"
70+
className="font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
71+
>
72+
Is Owner
73+
</label>
74+
</div>
75+
</div>
6676

67-
return (
68-
<ThirdwebProvider>
69-
<div className="container flex max-w-[1150px] flex-col gap-10 py-10">
70-
<div className="items-top flex space-x-2">
71-
<Checkbox
72-
id="terms1"
73-
checked={isOwner}
74-
onCheckedChange={(v) => setIsOwner(!!v)}
75-
/>
76-
<div className="grid gap-1.5 leading-none">
77-
<label
78-
htmlFor="terms1"
79-
className="font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
80-
>
81-
Is Owner
82-
</label>
83-
</div>
84-
</div>
77+
<BadgeContainer label="Empty Primary Sale Recipient">
78+
<MintableModuleUI
79+
contractInfo={contractInfo}
80+
moduleAddress="0x0000000000000000000000000000000000000000"
81+
isPending={false}
82+
primarySaleRecipient={""}
83+
update={updateStub}
84+
uninstallButton={{
85+
onClick: async () => removeMutation.mutateAsync(),
86+
isPending: removeMutation.isPending,
87+
}}
88+
isOwnerAccount={isOwner}
89+
/>
90+
</BadgeContainer>
8591

86-
<BadgeContainer label="Empty Primary Sale Recipient">
87-
<MintableModuleUI
88-
contractInfo={contractInfo}
89-
moduleAddress="0x0000000000000000000000000000000000000000"
90-
isPending={false}
91-
primarySaleRecipient={""}
92-
update={updateStub}
93-
mint={mintStub}
94-
uninstallButton={{
95-
onClick: async () => removeMutation.mutateAsync(),
96-
isPending: removeMutation.isPending,
97-
}}
98-
isOwnerAccount={isOwner}
99-
/>
100-
</BadgeContainer>
92+
<BadgeContainer label="Filled Primary Sale Recipient">
93+
<MintableModuleUI
94+
contractInfo={contractInfo}
95+
moduleAddress="0x0000000000000000000000000000000000000000"
96+
isPending={false}
97+
primarySaleRecipient={testAddress1}
98+
update={updateStub}
99+
uninstallButton={{
100+
onClick: () => removeMutation.mutateAsync(),
101+
isPending: removeMutation.isPending,
102+
}}
103+
isOwnerAccount={isOwner}
104+
/>
105+
</BadgeContainer>
101106

102-
<BadgeContainer label="Filled Primary Sale Recipient">
103-
<MintableModuleUI
104-
contractInfo={contractInfo}
105-
moduleAddress="0x0000000000000000000000000000000000000000"
106-
isPending={false}
107-
primarySaleRecipient={testAddress1}
108-
update={updateStub}
109-
mint={mintStub}
110-
uninstallButton={{
111-
onClick: () => removeMutation.mutateAsync(),
112-
isPending: removeMutation.isPending,
113-
}}
114-
isOwnerAccount={isOwner}
115-
/>
116-
</BadgeContainer>
107+
<BadgeContainer label="Pending">
108+
<MintableModuleUI
109+
contractInfo={contractInfo}
110+
moduleAddress="0x0000000000000000000000000000000000000000"
111+
isPending={true}
112+
primarySaleRecipient={testAddress1}
113+
update={updateStub}
114+
uninstallButton={{
115+
onClick: () => removeMutation.mutateAsync(),
116+
isPending: removeMutation.isPending,
117+
}}
118+
isOwnerAccount={isOwner}
119+
/>
120+
</BadgeContainer>
117121

118-
<BadgeContainer label="Pending">
119-
<MintableModuleUI
120-
contractInfo={contractInfo}
121-
moduleAddress="0x0000000000000000000000000000000000000000"
122-
isPending={true}
123-
primarySaleRecipient={testAddress1}
124-
update={updateStub}
125-
mint={mintStub}
126-
uninstallButton={{
127-
onClick: () => removeMutation.mutateAsync(),
128-
isPending: removeMutation.isPending,
129-
}}
130-
isOwnerAccount={isOwner}
131-
/>
132-
</BadgeContainer>
133-
134-
<Toaster richColors />
135-
</div>
136-
</ThirdwebProvider>
137-
);
122+
<Toaster richColors />
123+
</div>
124+
</ThirdwebProvider>
125+
);
138126
}

0 commit comments

Comments
 (0)