From 7c5abf9f5bc6d4a3e6f07fb93d4dbbd920e403df Mon Sep 17 00:00:00 2001 From: lloydrichards Date: Sun, 15 Oct 2023 13:14:08 +0200 Subject: [PATCH] revert(routing): :fire: remove intercepted routes --- src/app/(posts)/PostsNavigation.tsx | 6 ++--- src/app/@modal/(.)projects/[slug]/page.tsx | 27 ---------------------- src/app/@modal/[...catchAll]/page.tsx | 3 --- src/app/@modal/_(.)blogs/[slug]/page.tsx | 27 ---------------------- src/app/@modal/_(.)labs/[slug]/page.tsx | 27 ---------------------- src/app/@modal/default.tsx | 7 ------ src/app/layout.tsx | 3 --- src/app/page.tsx | 15 ++++-------- src/app/projects/page.tsx | 1 - 9 files changed, 7 insertions(+), 109 deletions(-) delete mode 100644 src/app/@modal/(.)projects/[slug]/page.tsx delete mode 100644 src/app/@modal/[...catchAll]/page.tsx delete mode 100644 src/app/@modal/_(.)blogs/[slug]/page.tsx delete mode 100644 src/app/@modal/_(.)labs/[slug]/page.tsx delete mode 100644 src/app/@modal/default.tsx diff --git a/src/app/(posts)/PostsNavigation.tsx b/src/app/(posts)/PostsNavigation.tsx index 7b53f65..194d7b8 100644 --- a/src/app/(posts)/PostsNavigation.tsx +++ b/src/app/(posts)/PostsNavigation.tsx @@ -17,7 +17,7 @@ interface PostsListItemProps { post: Lab | Blog; className?: string; } -const PostListItem: FC = ({ post, className }) => { +const PostListItem: FC = ({ post }) => { return ( @@ -25,7 +25,7 @@ const PostListItem: FC = ({ post, className }) => { className={cn(navigationMenuTriggerStyle(), "w-full gap-2")} > -

{post.title}

+

{post.title}

{formatDate(new Date(post.date))}

@@ -37,7 +37,7 @@ interface PostIconProps { type: "Lab" | "Blog"; className?: string; } -const PostIcon: FC = ({ type, className }) => { +const PostIcon: FC = ({ type }) => { switch (type) { case "Lab": return ; diff --git a/src/app/@modal/(.)projects/[slug]/page.tsx b/src/app/@modal/(.)projects/[slug]/page.tsx deleted file mode 100644 index 892d2cd..0000000 --- a/src/app/@modal/(.)projects/[slug]/page.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { ProjectPageProps } from "@/app/projects/[slug]/page"; -import { Mdx } from "@/components/Mdx"; -import { Modal } from "@/components/layout/modal/Modal"; -import { allProjects } from "contentlayer/generated"; -import Link from "next/link"; -import { notFound } from "next/navigation"; - -const getProjectFromParams = async (slug: string) => { - const project = allProjects.find((project) => project.slugAsParams === slug); - if (!project) notFound(); - return project; -}; - -const ProjectModal = async ({ params }: ProjectPageProps) => { - const project = await getProjectFromParams(params.slug); - return ( - -
-

{project.title}

- Full Screen - -
-
- ); -}; - -export default ProjectModal; diff --git a/src/app/@modal/[...catchAll]/page.tsx b/src/app/@modal/[...catchAll]/page.tsx deleted file mode 100644 index 1fd97c2..0000000 --- a/src/app/@modal/[...catchAll]/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function CatchAll() { - return null; -} diff --git a/src/app/@modal/_(.)blogs/[slug]/page.tsx b/src/app/@modal/_(.)blogs/[slug]/page.tsx deleted file mode 100644 index dda444c..0000000 --- a/src/app/@modal/_(.)blogs/[slug]/page.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { BlogPageProps } from "@/app/(posts)/blogs/[slug]/page"; -import { Mdx } from "@/components/Mdx"; -import { Modal } from "@/components/layout/modal/Modal"; -import { allBlogs } from "contentlayer/generated"; -import Link from "next/link"; -import { notFound } from "next/navigation"; - -const getBlogFromParams = async (slug: string) => { - const blog = allBlogs.find((blog) => blog.slugAsParams === slug); - if (!blog) notFound(); - return blog; -}; - -const BlogModal = async ({ params }: BlogPageProps) => { - const blog = await getBlogFromParams(params.slug); - return ( - -
-

{blog.title}

- Full Screen - -
-
- ); -}; - -export default BlogModal; diff --git a/src/app/@modal/_(.)labs/[slug]/page.tsx b/src/app/@modal/_(.)labs/[slug]/page.tsx deleted file mode 100644 index a0c67cd..0000000 --- a/src/app/@modal/_(.)labs/[slug]/page.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { LabPageProps } from "@/app/(posts)/labs/[slug]/page"; -import { Mdx } from "@/components/Mdx"; -import { Modal } from "@/components/layout/modal/Modal"; -import { allLabs } from "contentlayer/generated"; -import Link from "next/link"; -import { notFound } from "next/navigation"; - -const getLabFromParams = async (slug: string) => { - const lab = allLabs.find((lab) => lab.slugAsParams === slug); - if (!lab) notFound(); - return lab; -}; - -const LabModal = async ({ params }: LabPageProps) => { - const lab = await getLabFromParams(params.slug); - return ( - -
-

{lab.title}

- Full Screen - -
-
- ); -}; - -export default LabModal; diff --git a/src/app/@modal/default.tsx b/src/app/@modal/default.tsx deleted file mode 100644 index dc6be5e..0000000 --- a/src/app/@modal/default.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import type { FC } from "react"; - -const Default: FC = () => { - return null; -}; - -export default Default; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1684d76..ccce3b0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -49,10 +49,8 @@ export const metadata = { export default function RootLayout({ children, - modal, }: { children: React.ReactNode; - modal: React.ReactNode; }) { return ( {children} - {modal}