Skip to content

Commit 537d556

Browse files
authored
99-upgrade-the-next-js-to-the-latest-version upgraded nextjs version (#100)
1 parent f66837b commit 537d556

File tree

15 files changed

+1873
-681
lines changed

15 files changed

+1873
-681
lines changed

nextjs/app/account/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { redirect } from 'next/navigation';
44
import { getSubscription, getUser } from '@/utils/supabase/queries';
55

66
export default async function Account() {
7-
const supabase = createClient();
7+
const supabase = await createClient();
88
const [user, subscription] = await Promise.all([
99
getUser(supabase),
1010
getSubscription(supabase)

nextjs/app/api/auth_callback/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function GET(request: NextRequest) {
1212

1313
try {
1414
if (code) {
15-
const supabase = createClient();
15+
const supabase = await createClient();
1616
const { error } = await supabase.auth.exchangeCodeForSession(code);
1717
if (error) throw error;
1818
} else if (errorMessage) {

nextjs/app/api/reset_password/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function GET(request: NextRequest) {
1212

1313
try {
1414
if (code) {
15-
const supabase = createClient();
15+
const supabase = await createClient();
1616
const { error } = await supabase.auth.exchangeCodeForSession(code);
1717
if (error) throw error;
1818
} else if (errorMessage) {

nextjs/app/auth/[id]/page.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ import { Navbar } from '@/components/landing/Navbar';
44
import { AuthForm } from '@/components/misc/AuthForm';
55
import { AuthState } from '@/utils/types';
66

7-
export default async function SignIn({
8-
params
9-
}: {
10-
params: { id: string };
11-
searchParams: { disable_button: boolean };
12-
}) {
7+
export default async function SignIn(
8+
props: {
9+
params: Promise<{ id: string }>;
10+
searchParams: Promise<{ disable_button: boolean }>;
11+
}
12+
) {
13+
const params = await props.params;
1314
if (!Object.values(AuthState).includes(params.id as AuthState)) {
1415
redirect('/auth');
1516
}
1617
const currState = params.id as AuthState;
1718

1819
// Check if the user is already logged in and redirect to the account page if so
19-
const supabase = createClient();
20+
const supabase = await createClient();
2021
const {
2122
data: { user }
2223
} = await supabase.auth.getUser();

nextjs/app/layout.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import { PHProvider } from './providers';
66
import { ThemeProvider } from '@/components/landing/theme-provider';
77
import dynamic from 'next/dynamic';
88
import { Toaster } from '@/components/ui/toaster';
9+
import PostHogPageViewWrapper from '@/components/misc/PostHogPageViewWrapper';
910

10-
const PostHogPageView = dynamic(() => import('./PostHogPageView'), {
11-
ssr: false
12-
});
1311

1412
const meta = {
1513
title: 'Next.js Subscription Starter',
@@ -57,7 +55,7 @@ export default async function RootLayout({ children }: PropsWithChildren) {
5755
<ThemeProvider>
5856
<PHProvider>
5957
<body>
60-
<PostHogPageView />
58+
<PostHogPageViewWrapper />
6159
<main
6260
id="skip"
6361
className="min-h-[calc(100dvh-4rem)] md:min-h[calc(100dvh-5rem)]"

nextjs/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Testimonials } from '@/components/landing/Testimonials';
1616
import { createClient } from '@/utils/supabase/server';
1717

1818
export default async function LandingPage() {
19-
const supabase = createClient();
19+
const supabase = await createClient();
2020

2121
const {
2222
data: { user }

nextjs/components/landing/HowItWorks.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
GiftIcon
88
} from '@/components/landing/Icons';
99

10+
import type { JSX } from "react";
11+
1012
interface FeatureProps {
1113
icon: JSX.Element;
1214
title: string;

nextjs/components/landing/Services.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
} from '@/components/ui/card';
88
import { MagnifierIcon, WalletIcon, ChartIcon } from './Icons';
99

10+
import type { JSX } from "react";
11+
1012
interface ServiceProps {
1113
title: string;
1214
description: string;

nextjs/components/landing/Sponsors.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use client';
22
import { Radar } from 'lucide-react';
33

4+
import type { JSX } from "react";
5+
46
interface SponsorProps {
57
icon: JSX.Element;
68
name: string;

nextjs/components/misc/AccountPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export default function AccountPage({
7171
router.push('/');
7272
router.refresh();
7373
};
74-
console.log(subscription);
7574

7675
return (
7776
<div className="flex min-h-screen w-full flex-col">

0 commit comments

Comments
 (0)