From 83b06cc5846588ec3523152774b9f684ec132614 Mon Sep 17 00:00:00 2001 From: Maruf Bepary Date: Mon, 28 Oct 2024 20:10:54 +0000 Subject: [PATCH 1/2] Upgraded to NextJS 15 and all other dependencies - Had to fix breaking changes with Next 15 --- app/blogs/[blogKey]/page.tsx | 17 +- app/certificates/[certificateKey]/page.tsx | 31 +- .../[courseKey]/[moduleKey]/page.tsx | 23 +- app/education/[courseKey]/page.tsx | 119 +- app/experience/[roleKey]/page.tsx | 97 +- app/more/page.tsx | 19 +- app/projects/[projectKey]/page.tsx | 28 +- app/skills/[skillKey]/page.tsx | 28 +- package.json | 30 +- yarn.lock | 2502 ++++++++--------- 10 files changed, 1342 insertions(+), 1552 deletions(-) diff --git a/app/blogs/[blogKey]/page.tsx b/app/blogs/[blogKey]/page.tsx index cde7064d..d9b83833 100644 --- a/app/blogs/[blogKey]/page.tsx +++ b/app/blogs/[blogKey]/page.tsx @@ -20,10 +20,8 @@ import { notFound } from "next/navigation"; import { MdKeyboardArrowLeft } from "react-icons/md"; import ContentsSection from "./components/ContentsSection"; -type BlogPageProps = { - params: { blogKey: string }; - searchParams: { [key: string]: string | string[] | undefined }; -}; +type Params = Promise<{ blogKey: string }>; +type SearchParams = Promise<{ [key: string]: string | string[] | undefined }>; /** * Generates the metadata for the blog page. @@ -36,9 +34,10 @@ type BlogPageProps = { * @see https://nextjs.org/docs/app/building-your-application/optimizing/metadata */ export async function generateMetadata( - { params, searchParams }: BlogPageProps, + props: { params: Params; searchParams: SearchParams }, parent: ResolvingMetadata ): Promise { + const params = await props.params; const blogKey: string = params.blogKey; const blog: BlogInterface = blogsDatabaseMap[blogKey]; @@ -76,11 +75,12 @@ export const generateStaticParams = async () => { * - The skills covered in the blog * - Related materials * - * @param params The parameters for the blog page + * @param props The props for the blog page * @returns Content of the blog and the skills used */ -const BlogPage: React.FC = ({ params }) => { - const blogKey: string = params.blogKey; +const BlogPage: React.FC<{ params: Params }> = async ({ params }) => { + const resolvedParams = await params; + const blogKey: string = resolvedParams.blogKey; const basePath: string = BLOG_PAGE.path; const blogData: BlogInterface = blogsDatabaseMap[blogKey]; const blogContent: string | undefined = getMarkdownFromFileSystem( @@ -188,7 +188,6 @@ const BlogPage: React.FC = ({ params }) => { - {/* Buttons */}