From ffe8c106d862bd4487fc6e22b60856b63642578c Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Mon, 24 Feb 2025 19:55:17 +0800 Subject: [PATCH] refactor(playground/problem): restructure layout props and add route nesting --- .../(app)/playground/@problem/{ => @description}/page.tsx | 2 +- src/app/(app)/playground/@problem/layout.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/app/(app)/playground/@problem/{ => @description}/page.tsx (75%) diff --git a/src/app/(app)/playground/@problem/page.tsx b/src/app/(app)/playground/@problem/@description/page.tsx similarity index 75% rename from src/app/(app)/playground/@problem/page.tsx rename to src/app/(app)/playground/@problem/@description/page.tsx index d22ffd8..10ab28c 100644 --- a/src/app/(app)/playground/@problem/page.tsx +++ b/src/app/(app)/playground/@problem/@description/page.tsx @@ -1,6 +1,6 @@ import MdxPreview from "@/components/mdx-preview"; import { DEFAULT_PROBLEM } from "@/config/problem"; -export default function DescriptionPage() { +export default function ProblemDescriptionPage() { return ; } diff --git a/src/app/(app)/playground/@problem/layout.tsx b/src/app/(app)/playground/@problem/layout.tsx index b88a49e..e5b1f75 100644 --- a/src/app/(app)/playground/@problem/layout.tsx +++ b/src/app/(app)/playground/@problem/layout.tsx @@ -3,10 +3,10 @@ import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; interface ProblemLayoutProps { - children: React.ReactNode; + description: React.ReactNode; } -export default function ProblemLayout({ children }: ProblemLayoutProps) { +export default function ProblemLayout({ description }: ProblemLayoutProps) { return ( @@ -26,7 +26,7 @@ export default function ProblemLayout({ children }: ProblemLayoutProps) { - {children} + {description} );