-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
learn route structure setup completed, made sidebar functional
- Loading branch information
Showing
11 changed files
with
483 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { contentData, ContentItem } from "@/data/content"; | ||
|
||
export default async function LearnPage({ params }: { params: { category: string; subcategory: string } }) { | ||
// Wait for params to be available | ||
const { category, subcategory } = await Promise.resolve(params); // Ensures params are handled asynchronously | ||
|
||
// Safely access content based on params | ||
const content: ContentItem | undefined = contentData[category]?.items?.[subcategory]; | ||
|
||
if (!content) { | ||
return <div>Content not found</div>; | ||
} | ||
|
||
return ( | ||
<div className="p-6"> | ||
<h1 className="text-2xl font-bold mb-4">{content.title}</h1> | ||
<p>{content.content}</p> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
import React from 'react'; | ||
import { Metadata } from 'next'; | ||
import { SidebarProvider } from "@/components/ui/sidebar" | ||
import React from "react"; | ||
import { Metadata } from "next"; | ||
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; | ||
import AppSidebar from "@/components/custom/AppSidebar"; | ||
// import LearnNavbar from "@/components/custom/LearnNavbar"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Learn - ML4E", | ||
description: "ML4E - Machine Learning for Everyone is a collection of resources to help you learn machine learning.", | ||
title: "Learn - ML4E", | ||
description: "ML4E - Machine Learning for Everyone is a collection of resources to help you learn machine learning.", | ||
}; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<SidebarProvider> | ||
return ( | ||
<SidebarProvider> | ||
<div className="flex h-screen overflow-hidden"> | ||
<AppSidebar /> | ||
<main> | ||
<div className="flex-1 overflow-auto p-4"> | ||
<SidebarTrigger /> | ||
{/* <LearnNavbar /> */} | ||
{children} | ||
</main> | ||
</SidebarProvider> | ||
) | ||
} | ||
</div> | ||
</div> | ||
</SidebarProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react' | ||
|
||
const page = () => { | ||
const Learn = () => { | ||
return ( | ||
<div></div> | ||
<div>hello</div> | ||
) | ||
} | ||
|
||
export default page | ||
export default Learn |
Oops, something went wrong.