Skip to content

Commit

Permalink
Update to Next.js 15
Browse files Browse the repository at this point in the history
  • Loading branch information
marnym committed Dec 8, 2024
1 parent 5f71e63 commit 5b19e5d
Show file tree
Hide file tree
Showing 5 changed files with 315 additions and 174 deletions.
5 changes: 4 additions & 1 deletion app/[category]/[contentPage]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export const generateStaticParams = async () => {
}))
}

const ContentPage = async ({ params }: { params: { contentPage: string } }) => {
const ContentPage = async (props: {
params: Promise<{ contentPage: string }>
}) => {
const params = await props.params
const page = await fetchContentPage(params.contentPage)
return <Page page={page} />
}
Expand Down
5 changes: 4 additions & 1 deletion app/medlem/[privatePage]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import Page from '@components/Page'
import { authOptions } from '@lib/nextauth'
import Unauthorized from '@components/Unauthorized'

const PrivatePage = async ({ params }: { params: { privatePage: string } }) => {
const PrivatePage = async (props: {
params: Promise<{ privatePage: string }>
}) => {
const params = await props.params
const slug = params.privatePage
const session = await getServerSession(authOptions)
const page = await fetchPrivatePage(session?.user.token, slug)
Expand Down
3 changes: 2 additions & 1 deletion app/nyheter/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export async function generateStaticParams() {
}

/** Page for a single Post */
const Page = async ({ params }: { params: { slug: string } }) => {
const Page = async (props: { params: Promise<{ slug: string }> }) => {
const params = await props.params
const post = await fetchPost(params.slug)

return (
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"private": true,
"scripts": {
"dev": "NODE_OPTIONS='--dns-result-order=ipv4first' next dev",
"dev": "NODE_OPTIONS='--dns-result-order=ipv4first' next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "prettier -c app components lib models utils && next lint",
Expand All @@ -22,12 +22,12 @@
"framer-motion": "^11.2.0",
"googleapis": "^137.1.0",
"marked": "^12.0.2",
"next": "^14.2.3",
"next": "15.0.4",
"next-auth": "^4.24.7",
"qs": "^6.12.1",
"react": "^18.3.1",
"react": "19.0.0",
"react-calendar": "^5.0.0",
"react-dom": "^18.3.1",
"react-dom": "19.0.0",
"react-google-drive-picker": "^1.2.2",
"react-icons": "^5.2.1",
"sharp": "^0.32.6"
Expand All @@ -39,15 +39,15 @@
"@types/marked": "^6.0.0",
"@types/node": "20.12.12",
"@types/qs": "^6.9.7",
"@types/react": "18.3.2",
"@types/react": "19.0.1",
"@types/react-textfit": "^1.1.0",
"@types/react-window": "^1.8.5",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"autoprefixer": "^10.4.8",
"encoding": "^0.1.13",
"eslint": "8",
"eslint-config-next": "^14.2.3",
"eslint-config-next": "15.0.4",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
Expand All @@ -56,5 +56,8 @@
"prettier-plugin-tailwindcss": "^0.5.4",
"tailwindcss": "^3.1.8",
"typescript": "5.4.5"
},
"resolutions": {
"@types/react": "19.0.1"
}
}
Loading

0 comments on commit 5b19e5d

Please sign in to comment.