Skip to content

Commit b80ae7a

Browse files
committed
temp
1 parent 52cbcd2 commit b80ae7a

File tree

46 files changed

+2015
-997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2015
-997
lines changed

apps/dashboard/.storybook/preview.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Inter as interFont } from "next/font/google";
77
// biome-ignore lint/style/useImportType: <explanation>
88
import React from "react";
99
import { useEffect } from "react";
10+
import { Toaster } from "sonner";
1011
import { Button } from "../src/@/components/ui/button";
1112

1213
const queryClient = new QueryClient();
@@ -79,7 +80,13 @@ function StoryLayout(props: {
7980
</div>
8081

8182
<div className="flex min-w-0 grow flex-col">{props.children}</div>
83+
<ToasterSetup />
8284
</div>
8385
</QueryClientProvider>
8486
);
8587
}
88+
89+
function ToasterSetup() {
90+
const { theme } = useTheme();
91+
return <Toaster richColors theme={theme === "light" ? "light" : "dark"} />;
92+
}

apps/dashboard/src/@/components/blocks/pricing-card.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ type PricingCardProps = {
3131
ctaHint?: string;
3232
highlighted?: boolean;
3333
current?: boolean;
34-
canTrialGrowth?: boolean;
3534
activeTrialEndsAt?: string;
3635
redirectPath: string;
3736
redirectToCheckout: RedirectBillingCheckoutAction;
@@ -43,7 +42,6 @@ export const PricingCard: React.FC<PricingCardProps> = ({
4342
cta,
4443
highlighted = false,
4544
current = false,
46-
canTrialGrowth = false,
4745
activeTrialEndsAt,
4846
redirectPath,
4947
redirectToCheckout,
@@ -88,18 +86,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
8886
<div className="flex flex-col gap-0.5">
8987
<div className="flex items-center gap-2">
9088
<span className="font-semibold text-3xl text-foreground tracking-tight">
91-
{isCustomPrice ? (
92-
plan.price
93-
) : canTrialGrowth ? (
94-
<>
95-
<span className="text-muted-foreground line-through">
96-
${plan.price}
97-
</span>{" "}
98-
$0
99-
</>
100-
) : (
101-
`$${plan.price}`
102-
)}
89+
${plan.price}
10390
</span>
10491

10592
{!isCustomPrice && (

apps/dashboard/src/@3rdweb-sdk/react/hooks/useApi.ts

Lines changed: 71 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type Account = {
5454
// TODO - add image URL
5555
};
5656

57-
interface UpdateAccountInput {
57+
export interface UpdateAccountInput {
5858
name?: string;
5959
email?: string;
6060
linkWallet?: boolean;
@@ -379,39 +379,40 @@ export function useUserOpUsagePeriod(args: {
379379
});
380380
}
381381

382-
export function useUpdateAccount() {
383-
const queryClient = useQueryClient();
384-
const address = useActiveAccount()?.address;
382+
export async function updateAccountClient(input: UpdateAccountInput) {
383+
type Result = {
384+
data: object;
385+
error?: { message: string };
386+
};
385387

386-
return useMutation({
387-
mutationFn: async (input: UpdateAccountInput) => {
388-
type Result = {
389-
data: object;
390-
error?: { message: string };
391-
};
388+
const res = await apiServerProxy<Result>({
389+
pathname: "/v1/account",
390+
method: "PUT",
391+
headers: {
392+
"Content-Type": "application/json",
393+
},
394+
body: JSON.stringify(input),
395+
});
392396

393-
const res = await apiServerProxy<Result>({
394-
pathname: "/v1/account",
395-
method: "PUT",
396-
headers: {
397-
"Content-Type": "application/json",
398-
},
399-
body: JSON.stringify(input),
400-
});
397+
if (!res.ok) {
398+
throw new Error(res.error);
399+
}
401400

402-
if (!res.ok) {
403-
throw new Error(res.error);
404-
}
401+
const json = res.data;
405402

406-
const json = res.data;
403+
if (json.error) {
404+
throw new Error(json.error.message);
405+
}
407406

408-
if (json.error) {
409-
throw new Error(json.error.message);
410-
}
407+
return json.data;
408+
}
411409

412-
return json.data;
413-
},
410+
export function useUpdateAccount() {
411+
const queryClient = useQueryClient();
412+
const address = useActiveAccount()?.address;
414413

414+
return useMutation({
415+
mutationFn: updateAccountClient,
415416
onSuccess: () => {
416417
return queryClient.invalidateQueries({
417418
queryKey: accountKeys.me(address || ""),
@@ -460,94 +461,61 @@ export function useUpdateNotifications() {
460461
});
461462
}
462463

463-
export function useConfirmEmail() {
464-
const address = useActiveAccount()?.address;
465-
const queryClient = useQueryClient();
464+
export const verifyEmailClient = async (input: ConfirmEmailInput) => {
465+
type Result = {
466+
error?: { message: string };
467+
data: { team: Team; account: Account };
468+
};
466469

467-
return useMutation({
468-
mutationFn: async (input: ConfirmEmailInput) => {
469-
type Result = {
470-
error?: { message: string };
471-
data: { team: Team; account: Account };
472-
};
470+
const res = await apiServerProxy<Result>({
471+
pathname: "/v1/account/confirmEmail",
472+
method: "PUT",
473+
headers: {
474+
"Content-Type": "application/json",
475+
},
476+
body: JSON.stringify(input),
477+
});
473478

474-
const res = await apiServerProxy<Result>({
475-
pathname: "/v1/account/confirmEmail",
476-
method: "PUT",
477-
headers: {
478-
"Content-Type": "application/json",
479-
},
480-
body: JSON.stringify(input),
481-
});
479+
if (!res.ok) {
480+
throw new Error(res.error);
481+
}
482482

483-
if (!res.ok) {
484-
throw new Error(res.error);
485-
}
483+
const json = res.data;
486484

487-
const json = res.data;
485+
if (json.error) {
486+
throw new Error(json.error.message);
487+
}
488488

489-
if (json.error) {
490-
throw new Error(json.error.message);
491-
}
489+
return json.data;
490+
};
492491

493-
return json.data;
494-
},
495-
onSuccess: async () => {
496-
// invalidate related cache, since could be relinking account
497-
return Promise.all([
498-
queryClient.invalidateQueries({
499-
queryKey: apiKeys.keys(address || ""),
500-
}),
501-
queryClient.invalidateQueries({
502-
queryKey: accountKeys.usage(address || ""),
503-
}),
504-
queryClient.invalidateQueries({
505-
queryKey: accountKeys.me(address || ""),
506-
}),
507-
]);
492+
export const resendEmailClient = async () => {
493+
type Result = {
494+
error?: { message: string };
495+
data: object;
496+
};
497+
498+
const res = await apiServerProxy<Result>({
499+
pathname: "/v1/account/resendEmailConfirmation",
500+
method: "POST",
501+
headers: {
502+
"Content-Type": "application/json",
508503
},
504+
body: JSON.stringify({}),
509505
});
510-
}
511-
512-
export function useResendEmailConfirmation() {
513-
const address = useActiveAccount()?.address;
514-
const queryClient = useQueryClient();
515506

516-
return useMutation({
517-
mutationFn: async () => {
518-
type Result = {
519-
error?: { message: string };
520-
data: object;
521-
};
522-
523-
const res = await apiServerProxy<Result>({
524-
pathname: "/v1/account/resendEmailConfirmation",
525-
method: "POST",
526-
headers: {
527-
"Content-Type": "application/json",
528-
},
529-
body: JSON.stringify({}),
530-
});
531-
532-
if (!res.ok) {
533-
throw new Error(res.error);
534-
}
507+
if (!res.ok) {
508+
throw new Error(res.error);
509+
}
535510

536-
const json = res.data;
511+
const json = res.data;
537512

538-
if (json.error) {
539-
throw new Error(json.error.message);
540-
}
513+
if (json.error) {
514+
throw new Error(json.error.message);
515+
}
541516

542-
return json.data;
543-
},
544-
onSuccess: () => {
545-
return queryClient.invalidateQueries({
546-
queryKey: accountKeys.me(address || ""),
547-
});
548-
},
549-
});
550-
}
517+
return json.data;
518+
};
551519

552520
export function useCreateApiKey() {
553521
const address = useActiveAccount()?.address;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getThirdwebClient } from "@/constants/thirdweb.server";
33
import type { Meta, StoryObj } from "@storybook/react";
44
import { useMutation } from "@tanstack/react-query";
55
import { useState } from "react";
6-
import { Toaster, toast } from "sonner";
6+
import { toast } from "sonner";
77
import { BadgeContainer, mobileViewport } from "stories/utils";
88
import { ZERO_ADDRESS } from "thirdweb";
99
import { ConnectButton, ThirdwebProvider } from "thirdweb/react";
@@ -109,7 +109,6 @@ function Component() {
109109
contractChainId={1}
110110
/>
111111
</BadgeContainer>
112-
<Toaster richColors />
113112
</div>
114113
</ErrorProvider>
115114
</ThirdwebProvider>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { Meta, StoryObj } from "@storybook/react";
1111
import { useMutation } from "@tanstack/react-query";
1212
import { subDays } from "date-fns";
1313
import { useState } from "react";
14-
import { Toaster, toast } from "sonner";
14+
import { toast } from "sonner";
1515
import { mobileViewport } from "stories/utils";
1616
import { NATIVE_TOKEN_ADDRESS, ZERO_ADDRESS } from "thirdweb";
1717
import { ConnectButton, ThirdwebProvider } from "thirdweb/react";
@@ -196,8 +196,6 @@ function Component() {
196196
isValidTokenId={true}
197197
noClaimConditionSet={noClaimConditionSet}
198198
/>
199-
200-
<Toaster richColors />
201199
</div>
202200
</ThirdwebProvider>
203201
);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getThirdwebClient } from "@/constants/thirdweb.server";
1111
import type { Meta, StoryObj } from "@storybook/react";
1212
import { useMutation } from "@tanstack/react-query";
1313
import { useState } from "react";
14-
import { Toaster, toast } from "sonner";
14+
import { toast } from "sonner";
1515
import { BadgeContainer, mobileViewport } from "stories/utils";
1616
import { ConnectButton, ThirdwebProvider } from "thirdweb/react";
1717
import { accountStub } from "../../../../../../../stories/stubs";
@@ -175,8 +175,6 @@ function Component() {
175175
contractChainId={1}
176176
/>
177177
</BadgeContainer>
178-
179-
<Toaster richColors />
180178
</div>
181179
</ThirdwebProvider>
182180
);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Checkbox } from "@/components/ui/checkbox";
22
import type { Meta, StoryObj } from "@storybook/react";
33
import { useMutation } from "@tanstack/react-query";
44
import { useState } from "react";
5-
import { Toaster } from "sonner";
65
import { BadgeContainer, mobileViewport } from "stories/utils";
76
import { ThirdwebProvider } from "thirdweb/react";
87
import { ModuleCardUI } from "./module-card";
@@ -120,8 +119,6 @@ function Component() {
120119
</div>
121120
</ModuleCardUI>
122121
</BadgeContainer>
123-
124-
<Toaster richColors />
125122
</div>
126123
</ThirdwebProvider>
127124
);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getThirdwebClient } from "@/constants/thirdweb.server";
33
import type { Meta, StoryObj } from "@storybook/react";
44
import { useMutation } from "@tanstack/react-query";
55
import { useState } from "react";
6-
import { Toaster, toast } from "sonner";
6+
import { toast } from "sonner";
77
import { BadgeContainer, mobileViewport } from "stories/utils";
88
import { ConnectButton, ThirdwebProvider } from "thirdweb/react";
99
import { accountStub } from "../../../../../../../stories/stubs";
@@ -98,8 +98,6 @@ function Component() {
9898
twAccount={accountStub()}
9999
/>
100100
</BadgeContainer>
101-
102-
<Toaster richColors />
103101
</div>
104102
</ThirdwebProvider>
105103
);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getThirdwebClient } from "@/constants/thirdweb.server";
33
import type { Meta, StoryObj } from "@storybook/react";
44
import { useMutation } from "@tanstack/react-query";
55
import { useState } from "react";
6-
import { Toaster, toast } from "sonner";
6+
import { toast } from "sonner";
77
import { BadgeContainer, mobileViewport } from "stories/utils";
88
import { ConnectButton, ThirdwebProvider } from "thirdweb/react";
99
import { accountStub } from "../../../../../../../stories/stubs";
@@ -168,8 +168,6 @@ function Component() {
168168
twAccount={twAccount}
169169
/>
170170
</BadgeContainer>
171-
172-
<Toaster richColors />
173171
</div>
174172
</ThirdwebProvider>
175173
);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getThirdwebClient } from "@/constants/thirdweb.server";
33
import type { Meta, StoryObj } from "@storybook/react";
44
import { useMutation } from "@tanstack/react-query";
55
import { useState } from "react";
6-
import { Toaster, toast } from "sonner";
6+
import { toast } from "sonner";
77
import { BadgeContainer, mobileViewport } from "stories/utils";
88
import { ConnectButton, ThirdwebProvider } from "thirdweb/react";
99
import { accountStub } from "../../../../../../../stories/stubs";
@@ -139,8 +139,6 @@ function Component() {
139139
twAccount={accountStub()}
140140
/>
141141
</BadgeContainer>
142-
143-
<Toaster richColors />
144142
</div>
145143
</ThirdwebProvider>
146144
);

0 commit comments

Comments
 (0)