Skip to content

Commit 21ec87b

Browse files
authored
Merge pull request #149 from marcodejongh/upgrade_nextjs
Upgrade nextjs
2 parents 42ce83c + c1ff796 commit 21ec87b

File tree

23 files changed

+1145
-799
lines changed

23 files changed

+1145
-799
lines changed

app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/layout.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { PeerProvider } from '@/app/components/connection-manager/peer-context';
1414
import { PartyProvider } from '@/app/components/party-manager/party-context';
1515

1616
interface BoardLayoutProps {
17-
params: BoardRouteParametersWithUuid;
17+
params: Promise<BoardRouteParametersWithUuid>;
1818
searchParams: {
1919
query?: string;
2020
page?: string;
@@ -35,7 +35,13 @@ interface BoardLayoutProps {
3535
};
3636
}
3737

38-
export default async function BoardLayout({ children, params }: PropsWithChildren<BoardLayoutProps>) {
38+
export default async function BoardLayout(props: PropsWithChildren<BoardLayoutProps>) {
39+
const params = await props.params;
40+
41+
const {
42+
children
43+
} = props;
44+
3945
// Parse the route parameters
4046
const parsedParams: ParsedBoardRouteParameters = parseBoardRouteParams(params);
4147

app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/layout.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ import { parseBoardRouteParams } from '@/app/lib/url-utils';
1111
import { fetchBoardDetails } from '@/app/components/rest-api/api';
1212

1313
interface LayoutProps {
14-
params: BoardRouteParametersWithUuid;
14+
params: Promise<BoardRouteParametersWithUuid>;
1515
}
1616

17-
export default async function ListLayout({ children, params }: PropsWithChildren<LayoutProps>) {
17+
export default async function ListLayout(props: PropsWithChildren<LayoutProps>) {
18+
const params = await props.params;
19+
20+
const {
21+
children
22+
} = props;
23+
1824
const parsedParams: ParsedBoardRouteParameters = parseBoardRouteParams(params);
1925

2026
const { board_name, layout_id, set_ids, size_id } = parsedParams;

app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/page.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import { parseBoardRouteParams, parsedRouteSearchParamsToSearchParams } from '@/
66
import ClimbsList from '@/app/components/board-page/climbs-list';
77
import { fetchBoardDetails, fetchClimbs } from '@/app/components/rest-api/api';
88

9-
export default async function DynamicResultsPage({
10-
params,
11-
searchParams,
12-
}: {
13-
params: BoardRouteParametersWithUuid;
14-
searchParams: SearchRequestPagination;
15-
}) {
9+
export default async function DynamicResultsPage(
10+
props: {
11+
params: Promise<BoardRouteParametersWithUuid>;
12+
searchParams: Promise<SearchRequestPagination>;
13+
}
14+
) {
15+
const searchParams = await props.searchParams;
16+
const params = await props.params;
1617
const parsedParams = parseBoardRouteParams(params);
1718

1819
try {

app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/view/[climb_uuid]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import ClimbCard from '@/app/components/climb-card/climb-card';
77
import { Col, Row } from 'antd';
88
import ClimbInfoColumn from '@/app/components/climb-info/climb-info-drawer';
99

10-
export default async function DynamicResultsPage({ params }: { params: BoardRouteParametersWithUuid }) {
10+
export default async function DynamicResultsPage(props: { params: Promise<BoardRouteParametersWithUuid> }) {
11+
const params = await props.params;
1112
const parsedParams = parseBoardRouteParams(params);
1213

1314
try {

app/[board_name]/[layout_id]/[size_id]/[set_ids]/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import AngleSelection from '@/app/components/setup-wizard/angle-selection';
22
import { BoardName } from '@/app/lib/types';
33
import React from 'react';
44

5-
export default async function LayoutsPage({ params: { board_name } }: { params: { board_name: BoardName } }) {
5+
export default async function LayoutsPage(props: { params: Promise<{ board_name: BoardName }> }) {
6+
const params = await props.params;
7+
8+
const {
9+
board_name
10+
} = params;
11+
612
return <AngleSelection board_name={board_name} />;
713
}

app/[board_name]/[layout_id]/[size_id]/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import { fetchSets } from '@/app/components/rest-api/api';
33
import SetsSelection from '@/app/components/setup-wizard/sets-selection';
44
import { BoardName, LayoutId, Size } from '@/app/lib/types';
55

6-
export default async function LayoutsPage({
7-
params,
8-
}: {
9-
params: { board_name: BoardName; layout_id: LayoutId; size_id: Size };
10-
}) {
6+
export default async function LayoutsPage(
7+
props: {
8+
params: Promise<{ board_name: BoardName; layout_id: LayoutId; size_id: Size }>;
9+
}
10+
) {
11+
const params = await props.params;
1112
const sets = await fetchSets(params.board_name, params.layout_id, params.size_id);
1213
return <SetsSelection sets={sets} />;
1314
}

app/[board_name]/[layout_id]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import SizeSelection from '@/app/components/setup-wizard/size-selection';
33
import { fetchSizes } from '@/app/components/rest-api/api';
44
import { BoardName, LayoutId } from '@/app/lib/types';
55

6-
export default async function LayoutsPage({ params }: { params: { board_name: BoardName; layout_id: LayoutId } }) {
6+
export default async function LayoutsPage(props: { params: Promise<{ board_name: BoardName; layout_id: LayoutId }> }) {
7+
const params = await props.params;
78
const sizes = await fetchSizes(params.board_name, params.layout_id);
89
return <SizeSelection sizes={sizes} />;
910
}

app/[board_name]/layout.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
'use client';
2-
import React from 'react';
2+
import React, { use } from 'react';
33
import { PropsWithChildren } from 'react';
44
import { ParsedBoardRouteParameters, BoardRouteParametersWithUuid } from '@/app/lib/types';
55
import { parseBoardRouteParams } from '@/app/lib/url-utils'; // Assume this utility helps with parsing
66

77
import { BoardProvider } from '../components/board-provider/board-provider-context';
88

99
interface BoardLayoutProps {
10-
params: BoardRouteParametersWithUuid;
10+
params: Promise<BoardRouteParametersWithUuid>;
1111
}
1212

13-
export default function BoardLayout({ children, params }: PropsWithChildren<BoardLayoutProps>) {
13+
export default async function BoardLayout(props: PropsWithChildren<BoardLayoutProps>) {
14+
const params = await props.params;
15+
16+
const {
17+
children
18+
} = props;
19+
1420
// Parse the route parameters
1521
const parsedParams: ParsedBoardRouteParameters = parseBoardRouteParams(params);
1622

app/[board_name]/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import LayoutSelection from '../components/setup-wizard/layout-selection';
55
import { fetchLayouts } from '../components/rest-api/api';
66
import { BoardName } from '../lib/types';
77

8-
export default async function LayoutsPage({ params: { board_name } }: { params: { board_name: BoardName } }) {
8+
export default async function LayoutsPage(props: { params: Promise<{ board_name: BoardName }> }) {
9+
const params = await props.params;
10+
11+
const {
12+
board_name
13+
} = params;
14+
915
const layouts = await fetchLayouts(board_name);
1016
return <LayoutSelection layouts={layouts} boardName={board_name} />;
1117
}

app/api/internal/shared-sync/[board_name]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const maxDuration = 300;
99
// This is a simple way to secure the endpoint, should be replaced with a better solution
1010
const CRON_SECRET = process.env.CRON_SECRET;
1111

12-
export async function GET(request: Request, { params }: { params: BoardRouteParameters }) {
12+
export async function GET(request: Request, props: { params: Promise<BoardRouteParameters> }) {
13+
const params = await props.params;
1314
try {
1415
const { board_name }: ParsedBoardRouteParameters = parseBoardRouteParams(params);
1516
console.log(`Starting shared sync for ${board_name}`);

0 commit comments

Comments
 (0)