From c1f870651f1ff1c55b5ffd8cafbe41ab3f8a17b0 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Mon, 4 Nov 2024 19:53:26 +0800 Subject: [PATCH] feat: add basic problems layout --- .../(main)/problems/[slug]/@answer/page.tsx | 12 ++++++ .../(main)/problems/[slug]/@console/page.tsx | 12 ++++++ .../problems/[slug]/@description/page.tsx | 12 ++++++ src/app/(main)/problems/[slug]/layout.tsx | 42 +++++++++++++++++++ src/app/(main)/problems/[slug]/page.tsx | 3 ++ src/app/layout.tsx | 2 +- 6 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/app/(main)/problems/[slug]/@answer/page.tsx create mode 100644 src/app/(main)/problems/[slug]/@console/page.tsx create mode 100644 src/app/(main)/problems/[slug]/@description/page.tsx create mode 100644 src/app/(main)/problems/[slug]/layout.tsx create mode 100644 src/app/(main)/problems/[slug]/page.tsx diff --git a/src/app/(main)/problems/[slug]/@answer/page.tsx b/src/app/(main)/problems/[slug]/@answer/page.tsx new file mode 100644 index 0000000..5050135 --- /dev/null +++ b/src/app/(main)/problems/[slug]/@answer/page.tsx @@ -0,0 +1,12 @@ +export default async function AnswerPage({ + params, +}: { + params: Promise<{ slug: string }>; +}) { + const slug = (await params).slug; + return ( +
+

Answer Page: {slug}

+
+ ); +} diff --git a/src/app/(main)/problems/[slug]/@console/page.tsx b/src/app/(main)/problems/[slug]/@console/page.tsx new file mode 100644 index 0000000..af667c1 --- /dev/null +++ b/src/app/(main)/problems/[slug]/@console/page.tsx @@ -0,0 +1,12 @@ +export default async function ConsolePage({ + params, +}: { + params: Promise<{ slug: string }>; +}) { + const slug = (await params).slug; + return ( +
+

Console Page: {slug}

+
+ ); +} diff --git a/src/app/(main)/problems/[slug]/@description/page.tsx b/src/app/(main)/problems/[slug]/@description/page.tsx new file mode 100644 index 0000000..08f06a5 --- /dev/null +++ b/src/app/(main)/problems/[slug]/@description/page.tsx @@ -0,0 +1,12 @@ +export default async function DescriptionPage({ + params, +}: { + params: Promise<{ slug: string }>; +}) { + const slug = (await params).slug; + return ( +
+

Description Page: {slug}

+
+ ); +} diff --git a/src/app/(main)/problems/[slug]/layout.tsx b/src/app/(main)/problems/[slug]/layout.tsx new file mode 100644 index 0000000..76421d3 --- /dev/null +++ b/src/app/(main)/problems/[slug]/layout.tsx @@ -0,0 +1,42 @@ +import { + ResizableHandle, + ResizablePanel, + ResizablePanelGroup, +} from "@/components/ui/resizable"; + +export default async function ProblemLayout({ + children, + description, + answer, + console, +}: { + children: React.ReactNode; + description: React.ReactNode; + answer: React.ReactNode; + console: React.ReactNode; +}) { + return ( +
+ {children} + + + {description} + + + + {answer} + + + + {console} + + +
+ ); +} diff --git a/src/app/(main)/problems/[slug]/page.tsx b/src/app/(main)/problems/[slug]/page.tsx new file mode 100644 index 0000000..e4cb366 --- /dev/null +++ b/src/app/(main)/problems/[slug]/page.tsx @@ -0,0 +1,3 @@ +export default function ProblemPage() { + return null; +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 318fb29..da612b7 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -27,7 +27,7 @@ export default function RootLayout({
-
{children}
+
{children}