Skip to content

Commit 18cdd92

Browse files
committed
WIP - Remove legacy dashboard
1 parent d831cbf commit 18cdd92

File tree

335 files changed

+1633
-4162
lines changed

Some content is hidden

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

335 files changed

+1633
-4162
lines changed

apps/dashboard/redirects.js

Lines changed: 64 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
1+
const legacyDashboardToTeamRedirects = [
2+
{
3+
source: "/dashboard",
4+
destination: "/team",
5+
permanent: false,
6+
},
7+
{
8+
source: "/dashboard/contracts/:path*",
9+
destination: "/team/~/contracts", // TODO - add this page
10+
permanent: false,
11+
},
12+
{
13+
source: "/dashboard/engine/:path*",
14+
destination: "/team/~/~/engine/:path*", // TODO - move the engines to team page
15+
permanent: false,
16+
},
17+
{
18+
source: "/dashboard/settings/api-keys",
19+
destination: "/team/~/~/projects",
20+
permanent: false,
21+
},
22+
{
23+
source: "/dashboard/settings/devices",
24+
destination: "/account/devices", // TODO - add this page
25+
permanent: false,
26+
},
27+
{
28+
source: "/dashboard/settings/billing",
29+
destination: "/team/~/~/settings/billing",
30+
permanent: false,
31+
},
32+
{
33+
source: "/dashboard/settings/gas-credits",
34+
destination: "/team/~/~/settings/credits",
35+
permanent: false,
36+
},
37+
{
38+
source: "/dashboard/settings/usage",
39+
destination: "/team/~/~/usage",
40+
permanent: false,
41+
},
42+
{
43+
source: "/dashboard/settings/storage",
44+
destination: "/team/~/~/usage/storage", // TODO - add this page
45+
permanent: false,
46+
},
47+
{
48+
source: "/dashboard/settings/notifications",
49+
destination: "/team/~/~/settings/notifications",
50+
permanent: false,
51+
},
52+
// rest of the /dashboard/* routes
53+
{
54+
source: "/dashboard/:path*",
55+
destination: "/team",
56+
permanent: false,
57+
},
58+
];
59+
160
/** @type {import('next').NextConfig['redirects']} */
2-
function redirects() {
61+
async function redirects() {
362
return [
463
{
564
source: "/portal/:match*",
@@ -11,16 +70,6 @@ function redirects() {
1170
destination: "/solutions/chains",
1271
permanent: true,
1372
},
14-
{
15-
source: "/dashboard/publish/:path*",
16-
destination: "/contracts/publish/:path*",
17-
permanent: false,
18-
},
19-
{
20-
source: "/dashboard/mumbai/publish/:path*",
21-
destination: "/contracts/publish/:path*",
22-
permanent: false,
23-
},
2473
{
2574
source: "/contracts/release",
2675
destination: "/contracts/publish",
@@ -97,133 +146,28 @@ function redirects() {
97146
destination: "/polygon-zkevm",
98147
permanent: false,
99148
},
100-
{
101-
source: "/settings",
102-
destination: "/dashboard/settings/api-keys",
103-
permanent: false,
104-
},
105-
// backwards compat: page moved to pages/settings/api-key
106-
{
107-
source: "/dashboard/api-keys",
108-
destination: "/dashboard/settings/api-keys",
109-
permanent: false,
110-
},
111149
// backwards compat: page moved to pages/settings/devices
112-
{
113-
source: "/dashboard/settings/account",
114-
destination: "/dashboard/settings/devices",
115-
permanent: false,
116-
},
150+
117151
{
118152
source: "/template/nft-drop",
119153
destination: "/template/erc721",
120154
permanent: false,
121155
},
122156
{
123157
source: "/create-api-key",
124-
destination: "/dashboard/settings/api-keys",
158+
destination: "/team/~/~/projects",
125159
permanent: false,
126160
},
127161
{
128162
source: "/dashboard/settings",
129-
destination: "/dashboard/settings/api-keys",
130-
permanent: false,
131-
},
132-
{
133-
source: "/dashboard/connect",
134-
destination: "/dashboard/connect/analytics",
163+
destination: "/team/~/~/settings",
135164
permanent: false,
136165
},
137166
{
138167
source: "/dashboard/connect/playground",
139168
destination: "https://playground.thirdweb.com/connect/sign-in/button",
140169
permanent: false,
141170
},
142-
{
143-
source: "/dashboard/wallet",
144-
destination: "https://playground.thirdweb.com/connect/sign-in/button",
145-
permanent: false,
146-
},
147-
{
148-
source: "/dashboard/rpc",
149-
destination: "/dashboard/infrastructure/rpc-edge",
150-
permanent: false,
151-
},
152-
{
153-
source: "/dashboard/storage",
154-
destination: "/dashboard/infrastructure/storage",
155-
permanent: false,
156-
},
157-
{
158-
source: "/smart-wallet",
159-
destination: "/account-abstraction",
160-
permanent: false,
161-
},
162-
{
163-
source: "/dashboard/published",
164-
destination: "/dashboard/publish",
165-
permanent: false,
166-
},
167-
{
168-
source: "/dashboard/wallets",
169-
destination: "https://playground.thirdweb.com/connect/sign-in/button",
170-
permanent: false,
171-
},
172-
{
173-
source: "/dashboard/wallets/analytics",
174-
destination: "/dashboard/connect/analytics",
175-
permanent: false,
176-
},
177-
{
178-
source: "/dashboard/wallets/embedded",
179-
destination: "/dashboard/connect/embedded-wallets",
180-
permanent: false,
181-
},
182-
{
183-
source: "/dashboard/wallets/smart-wallet",
184-
destination: "/dashboard/connect/account-abstraction",
185-
permanent: false,
186-
},
187-
{
188-
source: "/dashboard/wallets/connect",
189-
destination: "https://playground.thirdweb.com/connect/sign-in/button",
190-
permanent: false,
191-
},
192-
{
193-
source: "/dashboard/infrastructure",
194-
destination: "/dashboard/settings/storage",
195-
permanent: false,
196-
},
197-
{
198-
source: "/dashboard/infrastructure/storage",
199-
destination: "/dashboard/settings/storage",
200-
permanent: false,
201-
},
202-
{
203-
source: "/dashboard/infrastructure/rpc-edge",
204-
destination: "/chainlist",
205-
permanent: false,
206-
},
207-
{
208-
source: "/dashboard/contracts",
209-
destination: "/dashboard/contracts/deploy",
210-
permanent: false,
211-
},
212-
{
213-
source: "/solidity-sdk",
214-
destination: "/build",
215-
permanent: false,
216-
},
217-
{
218-
source: "/connect-wallet",
219-
destination: "/connect",
220-
permanent: false,
221-
},
222-
{
223-
source: "/wallet-sdk",
224-
destination: "https://portal.thirdweb.com/wallet-sdk/latest",
225-
permanent: false,
226-
},
227171
{
228172
source: "/solutions/commerce",
229173
destination: "/solutions/loyalty",
@@ -244,27 +188,12 @@ function redirects() {
244188
destination: "/optimism",
245189
permanent: false,
246190
},
247-
{
248-
source: "/dashboard/payments/settings",
249-
destination: "/dashboard/connect/pay",
250-
permanent: false,
251-
},
252-
{
253-
source: "/dashboard/payments/contracts",
254-
destination: "/dashboard/connect/pay",
255-
permanent: false,
256-
},
257191
// Redirecting as ambassadors lives in community now
258192
{
259193
source: "/ambassadors",
260194
destination: "/community/ambassadors",
261195
permanent: false,
262196
},
263-
{
264-
source: "/dashboard/connect/embedded-wallets",
265-
destination: "/dashboard/connect/in-app-wallets",
266-
permanent: false,
267-
},
268197
{
269198
source: "/embedded-wallets",
270199
destination: "/in-app-wallets",
@@ -321,6 +250,7 @@ function redirects() {
321250
destination: "/account-abstraction",
322251
permanent: false,
323252
},
253+
...legacyDashboardToTeamRedirects,
324254
];
325255
}
326256

apps/dashboard/src/@/api/team.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@ export type Team = {
1313
bannedAt?: string;
1414
image?: string;
1515
billingPlan: "pro" | "growth" | "free";
16-
billingStatus: "validPayment" | (string & {}); // what's the other value?
17-
billingEmail: string;
18-
// billingExternalId: string;
19-
// billingType: "STRIPE" | ??
20-
// billingCustomerPayload: ?? | null
21-
// paymentAttemptCount: number
22-
// trialPeriodEndedAt: string | null;
16+
billingStatus: "validPayment" | (string & {}) | null;
17+
billingEmail: string | null;
2318
};
2419

2520
export async function getTeamBySlug(slug: string) {

apps/dashboard/src/@/components/DashboardTypeCookieSetter.tsx

Lines changed: 0 additions & 15 deletions
This file was deleted.

apps/dashboard/src/@/components/blocks/Avatars/GradientAvatar.stories.tsx

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import { useState } from "react";
33
import { BadgeContainer } from "../../../../stories/utils";
4+
import { getThirdwebClient } from "../../../constants/thirdweb.server";
45
import { Button } from "../../ui/button";
56
import { GradientAvatar } from "./GradientAvatar";
67

@@ -17,29 +18,74 @@ export const Desktop: Story = {
1718
args: {},
1819
};
1920

21+
const client = getThirdwebClient();
22+
2023
function Story() {
2124
return (
2225
<div className="flex flex-col gap-10 p-10">
2326
<p> All images below are set with size-6 className </p>
2427

2528
<BadgeContainer label="No Src, No id - Skeleton">
26-
<GradientAvatar id={undefined} src={undefined} className="size-6" />
29+
<GradientAvatar
30+
id={undefined}
31+
src={undefined}
32+
className="size-6"
33+
client={client}
34+
/>
2735
</BadgeContainer>
2836

2937
<BadgeContainer label="No Src, id=foo - Skeleton">
30-
<GradientAvatar id={"foo"} src={undefined} className="size-6" />
38+
<GradientAvatar
39+
id={"foo"}
40+
src={undefined}
41+
className="size-6"
42+
client={client}
43+
/>
3144
</BadgeContainer>
3245

33-
<BadgeContainer label="Invalid/Empty Src, id=foo - Gradient">
34-
<GradientAvatar id={"foo"} src={""} className="size-6" />
46+
<BadgeContainer label="Invalid Src, id=foo - Gradient">
47+
<GradientAvatar
48+
id={"foo"}
49+
src={""}
50+
className="size-6"
51+
client={client}
52+
/>
3553
</BadgeContainer>
3654

37-
<BadgeContainer label="Invalid/Empty Src, id=bar - Gradient">
38-
<GradientAvatar id={"bar"} src={""} className="size-6" />
55+
<BadgeContainer label="Invalid Src, id=bar - Gradient">
56+
<GradientAvatar
57+
id={"bar"}
58+
src={""}
59+
className="size-6"
60+
client={client}
61+
/>
3962
</BadgeContainer>
4063

4164
<BadgeContainer label="Empty/Invalid Src, No id - default fallback">
42-
<GradientAvatar src="invalid-src" id={undefined} className="size-6" />
65+
<GradientAvatar
66+
src="invalid-src"
67+
id={undefined}
68+
className="size-6"
69+
client={client}
70+
/>
71+
</BadgeContainer>
72+
73+
<BadgeContainer label="Valid Src, https">
74+
<GradientAvatar
75+
src="https://picsum.photos/200/300"
76+
id={undefined}
77+
className="size-6"
78+
client={client}
79+
/>
80+
</BadgeContainer>
81+
82+
<BadgeContainer label="Valid Src, ipfs">
83+
<GradientAvatar
84+
src="ipfs://QmZbeJYEs7kCJHyQxjxU2SJUtjSAr4m87wzJFJUyWomKdj/Smily.svg"
85+
id={undefined}
86+
className="size-6"
87+
client={client}
88+
/>
4389
</BadgeContainer>
4490

4591
<ToggleTest />
@@ -74,14 +120,20 @@ function ToggleTest() {
74120
<p> Src+ID is: {data ? "set" : "not set"} </p>
75121

76122
<BadgeContainer label="Valid Src">
77-
<GradientAvatar src={data?.src} id={data?.id} className="size-6" />
123+
<GradientAvatar
124+
src={data?.src}
125+
id={data?.id}
126+
className="size-6"
127+
client={client}
128+
/>
78129
</BadgeContainer>
79130

80131
<BadgeContainer label="invalid Src">
81132
<GradientAvatar
82133
className="size-6"
83134
src={data ? "invalid-src" : undefined}
84135
id={undefined}
136+
client={client}
85137
/>
86138
</BadgeContainer>
87139
</div>

0 commit comments

Comments
 (0)