Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
chore: bump to Next.js 15 & React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianAndersen committed Dec 13, 2024
1 parent 5279f75 commit a2472f6
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 137 deletions.
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "https://github.com/boklisten/bl-next/issues",
"email": "[email protected]",
"scripts": {
"dev": "next dev",
"dev": "next dev --turbopack",
"build": "next build",
"serve": "next start",
"prettier": "prettier --write '**/*.{js,ts,tsx,md,json,yml,css}' --ignore-path=.gitignore",
Expand All @@ -33,9 +33,9 @@
"@yudiel/react-qr-scanner": "^2.0.8",
"draft-js": "^0.11.7",
"moment": "^2.30.1",
"next": "^14.2.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"next": "15.1.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-draft-wysiwyg": "^1.15.0",
"react-hook-form": "^7.54.1",
"react-jwt": "^1.2.2",
Expand All @@ -54,7 +54,7 @@
"@testing-library/react": "^16.1.0",
"@types/draft-js": "^0.11.18",
"@types/node": "22.10.2",
"@types/react": "18.3.4",
"@types/react": "19.0.1",
"@types/react-draft-wysiwyg": "^1.13.8",
"@types/sanitize-html": "^2.13.0",
"@types/string-similarity": "^4.0.2",
Expand Down
7 changes: 3 additions & 4 deletions src/app/auth/email/confirm/[confirmationId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ export const metadata: Metadata = {
"Bekreft din e-postadresse, slik at du får viktig informasjon fra oss.",
};

export default function TokenPage({
params,
}: {
params: { confirmationId: string };
export default async function TokenPage(props: {
params: Promise<{ confirmationId: string }>;
}) {
const params = await props.params;
return (
<Card sx={{ paddingBottom: 4 }}>
<Container component="main" maxWidth="xs">
Expand Down
7 changes: 3 additions & 4 deletions src/app/auth/reset/[userId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ export const metadata: Metadata = {
description: "Lag et nytt passord, slik at du får tilgang på kontoen din.",
};

export default function PasswordResetPage({
params,
}: {
params: { userId: string };
export default async function PasswordResetPage(props: {
params: Promise<{ userId: string }>;
}) {
const params = await props.params;
return (
<Card sx={{ paddingBottom: 4 }}>
<Container component="main" maxWidth="xs">
Expand Down
8 changes: 5 additions & 3 deletions src/app/info/branch/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import LinkableBranchInfo from "@/components/LinkableBranchInfo";
import BL_CONFIG from "@/utils/bl-config";
import { assertBlApiError } from "@/utils/types";

type Params = { params: { id: string } };
type Params = { params: Promise<{ id: string }> };

export const generateStaticParams = async () => {
try {
Expand All @@ -22,7 +22,8 @@ export const generateStaticParams = async () => {

export const dynamic = "force-dynamic";

export async function generateMetadata({ params }: Params): Promise<Metadata> {
export async function generateMetadata(props: Params): Promise<Metadata> {
const params = await props.params;
const branchData = await BlFetcher.get<Branch[]>(
`${BL_CONFIG.collection.branch}/${params.id}`,
);
Expand Down Expand Up @@ -59,7 +60,8 @@ async function getBranchData(branchId: string): Promise<BranchData> {
return branchData;
}

const BranchPage = async ({ params }: Params) => {
const BranchPage = async (props: Params) => {
const params = await props.params;
const { branch, openingHours } = await getBranchData(params.id);

return (
Expand Down
5 changes: 4 additions & 1 deletion src/app/matches/[matchId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export const metadata: Metadata = {
description: "Overlevering av bøker",
};

const MatchDetailPage = ({ params }: { params: { matchId: string } }) => {
const MatchDetailPage = async (props: {
params: Promise<{ matchId: string }>;
}) => {
const params = await props.params;
return <MatchDetail matchId={params.matchId} />;
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/info/EditableQna.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const QuestionWithAnswer = ({
deleteQuestion: (questionId: string) => void;
}) => {
const [edit, setEdit] = useState(false);
const questionInput = useRef();
const answerInput = useRef();
const questionInput = useRef(undefined);
const answerInput = useRef(undefined);
const [hydrated, setHydrated] = useState(false);
useEffect(() => {
setHydrated(true);
Expand Down
1 change: 1 addition & 0 deletions src/components/user/fields/DatePickerField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type DatePickerFieldProps<T extends FieldValues> = DatePickerProps<Moment> & {
};

const DatePickerField = forwardRef(
// @ts-expect-error type should be fixed
<T extends FieldValues>(
{ control, name, handleChange, ...props }: DatePickerFieldProps<T>,
ref: Ref<HTMLInputElement>,
Expand Down
Loading

0 comments on commit a2472f6

Please sign in to comment.