Skip to content

Commit d2079ac

Browse files
committed
DO NOT MERGE - Use Next.js 15 in Dashboard
1 parent 9c3ff94 commit d2079ac

File tree

133 files changed

+1229
-1117
lines changed

Some content is hidden

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

133 files changed

+1229
-1117
lines changed

apps/dashboard/package.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"@tanstack/react-query": "5.59.13",
5454
"@tanstack/react-table": "^8.17.3",
5555
"@thirdweb-dev/service-utils": "workspace:*",
56+
"@vercel/functions": "^1.4.2",
5657
"@vercel/og": "^0.6.2",
5758
"abitype": "1.0.6",
5859
"chakra-react-select": "^4.7.6",
@@ -69,7 +70,7 @@
6970
"ipaddr.js": "^2.2.0",
7071
"lottie-react": "^2.4.0",
7172
"lucide-react": "0.452.0",
72-
"next": "14.2.15",
73+
"next": "15.0.0",
7374
"next-plausible": "^3.12.0",
7475
"next-seo": "^6.5.0",
7576
"next-themes": "^0.3.0",
@@ -107,8 +108,8 @@
107108
"devDependencies": {
108109
"@chakra-ui/cli": "^2.4.1",
109110
"@chromatic-com/storybook": "2.0.2",
110-
"@next/bundle-analyzer": "14.2.15",
111-
"@next/eslint-plugin-next": "14.2.15",
111+
"@next/bundle-analyzer": "15.0.0",
112+
"@next/eslint-plugin-next": "15.0.0",
112113
"@playwright/test": "1.47.2",
113114
"@storybook/addon-essentials": "8.3.5",
114115
"@storybook/addon-interactions": "8.3.5",
@@ -124,8 +125,8 @@
124125
"@types/papaparse": "^5.3.15",
125126
"@types/pluralize": "^0.0.33",
126127
"@types/qrcode": "^1.5.5",
127-
"@types/react": "^18.3.11",
128-
"@types/react-dom": "^18.3.1",
128+
"@types/react": "18.3.11",
129+
"@types/react-dom": "18.3.1",
129130
"@types/react-table": "^7.7.20",
130131
"@types/spdx-correct": "^3.1.3",
131132
"@types/swagger-ui-react": "^4.18.3",
@@ -143,5 +144,11 @@
143144
"storybook": "8.3.5",
144145
"tailwindcss": "3.4.13",
145146
"typescript": "5.6.3"
147+
},
148+
"pnpm": {
149+
"overrides": {
150+
"@types/react": "18.3.11",
151+
"@types/react-dom": "18.3.1"
152+
}
146153
}
147154
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type Project = {
2121
};
2222

2323
export async function getProjects(teamSlug: string) {
24-
const cookiesManager = cookies();
24+
const cookiesManager = await cookies();
2525
const activeAccount = cookiesManager.get(COOKIE_ACTIVE_ACCOUNT)?.value;
2626
const token = activeAccount
2727
? cookiesManager.get(COOKIE_PREFIX_TOKEN + activeAccount)?.value
@@ -46,7 +46,7 @@ export async function getProjects(teamSlug: string) {
4646
}
4747

4848
export async function getProject(teamSlug: string, projectSlug: string) {
49-
const cookiesManager = cookies();
49+
const cookiesManager = await cookies();
5050
const activeAccount = cookiesManager.get(COOKIE_ACTIVE_ACCOUNT)?.value;
5151
const token = activeAccount
5252
? cookiesManager.get(COOKIE_PREFIX_TOKEN + activeAccount)?.value

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type Team = {
2323
};
2424

2525
export async function getTeamBySlug(slug: string) {
26-
const cookiesManager = cookies();
26+
const cookiesManager = await cookies();
2727
const activeAccount = cookiesManager.get(COOKIE_ACTIVE_ACCOUNT)?.value;
2828
const token = activeAccount
2929
? cookiesManager.get(COOKIE_PREFIX_TOKEN + activeAccount)?.value
@@ -45,7 +45,7 @@ export async function getTeamBySlug(slug: string) {
4545
}
4646

4747
export async function getTeams() {
48-
const cookiesManager = cookies();
48+
const cookiesManager = await cookies();
4949
const activeAccount = cookiesManager.get(COOKIE_ACTIVE_ACCOUNT)?.value;
5050
const token = activeAccount
5151
? cookiesManager.get(COOKIE_PREFIX_TOKEN + activeAccount)?.value
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import { cookies } from "next/headers";
1+
import { type UnsafeUnwrappedCookies, cookies } from "next/headers";
22

33
export const COOKIE_ACTIVE_ACCOUNT = "tw_active_account";
44
export const COOKIE_PREFIX_TOKEN = "tw_token_";
55

66
export function getActiveAccountCookie() {
7-
return cookies().get(COOKIE_ACTIVE_ACCOUNT)?.value;
7+
return (cookies() as unknown as UnsafeUnwrappedCookies).get(
8+
COOKIE_ACTIVE_ACCOUNT,
9+
)?.value;
810
}
911

1012
export function getJWTCookie(address: string) {
11-
return cookies().get(COOKIE_PREFIX_TOKEN + address)?.value;
13+
return (cookies() as unknown as UnsafeUnwrappedCookies).get(
14+
COOKIE_PREFIX_TOKEN + address,
15+
)?.value;
1216
}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/chain-header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type ChainHeaderProps = {
1717
export function ChainHeader(props: ChainHeaderProps) {
1818
return (
1919
// force the banner image to be 4:1 aspect ratio and full-width on mobile devices
20-
<div className="flex flex-col">
20+
(<div className="flex flex-col">
2121
{!props.headerImageUrl && <div className="h-8 md:hidden" />}
2222
<div
2323
className={cn(
@@ -27,11 +27,11 @@ export function ChainHeader(props: ChainHeaderProps) {
2727
>
2828
{props.headerImageUrl && (
2929
// eslint-disable-next-line @next/next/no-img-element
30-
<img
30+
(<img
3131
src={props.headerImageUrl}
3232
alt=""
3333
className="h-full w-full object-cover object-center"
34-
/>
34+
/>)
3535
)}
3636
</div>
3737
{/* below header */}
@@ -65,6 +65,6 @@ export function ChainHeader(props: ChainHeaderProps) {
6565
</div>
6666
</div>
6767
</div>
68-
</div>
68+
</div>)
6969
);
7070
}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ import { ChainHeader } from "./components/server/chain-header";
3232

3333
// TODO: improve the behavior when clicking "Get started with thirdweb", currently just redirects to the dashboard
3434

35-
export async function generateMetadata({
36-
params,
37-
}: { params: { chain_id: string } }): Promise<Metadata> {
35+
export async function generateMetadata(props: { params: Promise<{ chain_id: string }> }): Promise<Metadata> {
36+
const params = await props.params;
3837
const chain = await getChain(params.chain_id);
3938
const sanitizedChainName = chain.name.replace("Mainnet", "").trim();
4039
const title = `${sanitizedChainName}: RPC and Chain Settings`;
@@ -54,13 +53,18 @@ export async function generateMetadata({
5453
}
5554

5655
// this is the dashboard layout file
57-
export default async function ChainPageLayout({
58-
children,
59-
params,
60-
}: {
61-
children: React.ReactNode;
62-
params: { chain_id: string };
63-
}) {
56+
export default async function ChainPageLayout(
57+
props: {
58+
children: React.ReactNode;
59+
params: Promise<{ chain_id: string }>;
60+
}
61+
) {
62+
const params = await props.params;
63+
64+
const {
65+
children
66+
} = props;
67+
6468
const chain = await getChain(params.chain_id);
6569

6670
if (params.chain_id !== chain.slug) {

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/opengraph-image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const contentType = "image/png";
1818

1919
const TWLogo: React.FC = () => (
2020
// biome-ignore lint/a11y/noSvgWithoutTitle: not needed
21-
<svg
21+
(<svg
2222
width="255"
2323
height="37"
2424
viewBox="0 0 255 37"
@@ -55,7 +55,7 @@ const TWLogo: React.FC = () => (
5555
<rect width="59.9096" height="37" fill="white" />
5656
</clipPath>
5757
</defs>
58-
</svg>
58+
</svg>)
5959
);
6060

6161
// Image generation

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { ChainCTA } from "./components/server/cta-card";
1313
import { ExplorersSection } from "./components/server/explorer-section";
1414

1515
export default async function Page(props: {
16-
params: { chain_id: string };
16+
params: Promise<{ chain_id: string }>;
1717
}) {
18-
const chain = await getChain(props.params.chain_id);
18+
const chain = await getChain((await props.params).chain_id);
1919
const chainMetadata = await getChainMetadata(chain.chainId);
2020
const isDeprecated = chain.status === "deprecated";
2121

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/popular/page.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,35 @@ import { getChain } from "../../../utils";
77
export const dynamic = "force-dynamic";
88

99
export default async function Page(props: {
10-
params: { chain_id: string };
11-
searchParams: { page?: number; sortBy?: SortBy };
10+
params: Promise<{ chain_id: string }>;
11+
searchParams: Promise<{ page?: number; sortBy?: SortBy }>;
1212
}) {
13-
const chain = await getChain(props.params.chain_id);
13+
const chain = await getChain((await props.params).chain_id);
1414
const topContracts = await fetchTopContracts({
1515
chainId: chain.chainId,
16-
page: props.searchParams.page,
17-
sortBy: props.searchParams.sortBy,
16+
page: (await props.searchParams).page,
17+
sortBy: (await props.searchParams).sortBy,
1818
perPage: 15,
1919
timeRange: "month",
2020
});
2121

2222
return (
23-
<section className="mt-2">
23+
(<section className="mt-2">
2424
<h2 className="mb-2 font-semibold text-2xl tracking-tighter">
2525
Popular Contracts
2626
</h2>
27-
2827
<p className="text-muted-foreground text-sm">
2928
Explore contracts on Ethereum and sort them by your preferred metrics
3029
</p>
31-
3230
<div className="h-8" />
33-
3431
{topContracts.length > 0 && (
3532
<TrendingContractSection
3633
topContracts={topContracts}
3734
chainId={chain.chainId}
38-
searchParams={props.searchParams}
35+
searchParams={(await props.searchParams)}
3936
showPagination={true}
4037
/>
4138
)}
42-
4339
{topContracts.length === 0 && (
4440
<div className="flex h-[200px] items-center justify-center rounded-lg border border-border text-lg text-muted-foreground">
4541
<div className="flex items-center gap-2">
@@ -48,6 +44,6 @@ export default async function Page(props: {
4844
</div>
4945
</div>
5046
)}
51-
</section>
47+
</section>)
5248
);
5349
}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/marketplace-table.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export const MarketplaceTable: React.FC<MarketplaceTableProps> = ({
182182
>(null);
183183

184184
return (
185-
<Flex gap={4} direction="column">
185+
(<Flex gap={4} direction="column">
186186
<ButtonGroup size="sm" variant="outline" isAttached>
187187
<Button
188188
onClick={() => setListingsToShow("all")}
@@ -218,7 +218,7 @@ export const MarketplaceTable: React.FC<MarketplaceTableProps> = ({
218218
<Thead>
219219
{headerGroups.map((headerGroup, headerGroupIndex) => (
220220
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
221-
<Tr {...headerGroup.getHeaderGroupProps()} key={headerGroupIndex}>
221+
(<Tr {...headerGroup.getHeaderGroupProps()} key={headerGroupIndex}>
222222
{headerGroup.headers.map((column, columnIndex) => (
223223
<Th
224224
{...column.getHeaderProps()}
@@ -233,7 +233,7 @@ export const MarketplaceTable: React.FC<MarketplaceTableProps> = ({
233233
))}
234234
{/* // Need to add an empty header for the drawer button */}
235235
<Th border="none" />
236-
</Tr>
236+
</Tr>)
237237
))}
238238
</Thead>
239239
<Tbody {...getTableBodyProps()} position="relative">
@@ -324,6 +324,6 @@ export const MarketplaceTable: React.FC<MarketplaceTableProps> = ({
324324
</Select>
325325
</Flex>
326326
</div>
327-
</Flex>
327+
</Flex>)
328328
);
329329
};

0 commit comments

Comments
 (0)