diff --git a/src/app/(dashboard)/dashboard/(task)/task/[...taskId]/page.tsx b/src/app/(dashboard)/dashboard/(task)/task/[...taskId]/page.tsx index 11708c0..c69d5a1 100644 --- a/src/app/(dashboard)/dashboard/(task)/task/[...taskId]/page.tsx +++ b/src/app/(dashboard)/dashboard/(task)/task/[...taskId]/page.tsx @@ -1,16 +1,5 @@ -import { ScrollArea } from "@/components/ui/scroll-area"; -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from "@/components/ui/resizable"; -import markdownStyles from "@/styles/markdown-styles.module.css"; import { tutorialData } from "@/constants/tutorial-data"; import { notFound } from "next/navigation"; -import { Button, buttonVariants } from "@/components/ui/button"; -import Link from "next/link"; -import { cn } from "@/lib/utils"; -import EditorWindow from "@/components/task/editor-window"; import { LANGUAGE_VERSIONS } from "@/constants/language-options"; import { markdownToHtml } from "@/lib/markdown-to-html"; import TaskPage from "@/components/task-page"; @@ -18,10 +7,6 @@ import TaskPage from "@/components/task-page"; const languages = Object.keys(LANGUAGE_VERSIONS); const Page = async ({ params }: { params: { taskId: string[] } }) => { - // const [activeMobileView, setActiveMobileView] = useState< - // "tutorial" | "code" | "output" - // >("tutorial"); - if (!params.taskId[0] || !languages.includes(params.taskId[0])) { notFound(); } diff --git a/src/components/task-page.tsx b/src/components/task-page.tsx index 33d2368..cb4eb09 100644 --- a/src/components/task-page.tsx +++ b/src/components/task-page.tsx @@ -8,20 +8,13 @@ import { ResizablePanelGroup, } from "@/components/ui/resizable"; import markdownStyles from "@/styles/markdown-styles.module.css"; -import { tutorialData } from "@/constants/tutorial-data"; -import { notFound } from "next/navigation"; import { Button, buttonVariants } from "@/components/ui/button"; import Link from "next/link"; import { cn } from "@/lib/utils"; import EditorWindow from "@/components/task/editor-window"; -import { LANGUAGE_VERSIONS } from "@/constants/language-options"; -import { markdownToHtml } from "@/lib/markdown-to-html"; -import Header from "./task/header"; import Image from "next/image"; import ThemeToggle from "./layout/ThemeToggle/theme-toggle"; -const languages = Object.keys(LANGUAGE_VERSIONS); - interface LangTutorial { id: number; language: string; @@ -55,27 +48,6 @@ const TaskPage = ({ "tutorial" | "code" | "output" >("tutorial"); - // if (!params.taskId[0] || !languages.includes(params.taskId[0])) { - // notFound(); - // } - - // const langTutorial = tutorialData.find( - // (t) => t.language === params.taskId[0], - // )!; - - // const tutorial = langTutorial.tutorial.find( - // (t) => t.id === (Number(params.taskId[1]) || 1), - // ); - - // const tutorialIndex = langTutorial.tutorial.findIndex( - // (t) => t.id === (Number(params.taskId[1]) || 1), - // ); - - // if (!tutorial || tutorialIndex === -1) { - // notFound(); - // } - - // const content = await markdownToHtml(tutorial?.content || ""); return ( <>
@@ -99,11 +71,6 @@ const TaskPage = ({
- {/* */} - {/* */}
- {/* Home */} Dashboard - {/* Login */}
-
+
- {/* */} - {/* */} - {/* */} + - {/* */} - {/* */}
- {/*
- - - -
-
-
-
- {langTutorial?.tutorial[tutorialIndex - 1] && ( - - Prev - - )} -
-
- {langTutorial?.tutorial[tutorialIndex + 1] && ( - - Next - - )} -
-
-
-
-
- - - - -
-
*/}
-
+
-
+
{langTutorial?.tutorial[tutorialIndex - 1] && ( -
+
{langTutorial?.tutorial[tutorialIndex + 1] && (
- {/* - */}
- {/* */}
- {/* */} - {/* */} - {/* */} +
- {/* */} - {/* */}