mirror of
https://github.com/DerTyp7/explainegy-nextjs.git
synced 2025-10-30 21:27:12 +01:00
init
This commit is contained in:
5
app/Nav.tsx
Normal file
5
app/Nav.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function Nav() {
|
||||
return <nav>Nav</nav>;
|
||||
}
|
||||
11
app/layout.tsx
Normal file
11
app/layout.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import "../styles/globals.scss";
|
||||
import Nav from "./Nav";
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<body>
|
||||
<Nav />
|
||||
<main>{children}</main>
|
||||
</body>
|
||||
);
|
||||
}
|
||||
9
app/page.tsx
Normal file
9
app/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
export default function Page({
|
||||
params,
|
||||
searchParams,
|
||||
}: {
|
||||
params: { slug: string };
|
||||
searchParams?: { [key: string]: string | string[] | undefined };
|
||||
}) {
|
||||
return <h1>Home</h1>;
|
||||
}
|
||||
5
app/tutorials/[tutorial]/ContentTable.tsx
Normal file
5
app/tutorials/[tutorial]/ContentTable.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ContentTable() {
|
||||
return <div>ContentTable</div>;
|
||||
}
|
||||
5
app/tutorials/[tutorial]/Sidebar.tsx
Normal file
5
app/tutorials/[tutorial]/Sidebar.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export default function Sidebar() {
|
||||
return <div>Sidebar</div>;
|
||||
}
|
||||
13
app/tutorials/[tutorial]/layout.tsx
Normal file
13
app/tutorials/[tutorial]/layout.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import ContentTable from "./ContentTable";
|
||||
import Sidebar from "./Sidebar";
|
||||
import styles from "../../../styles/Tutorial.module.scss";
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className={styles.tutorial}>
|
||||
<ContentTable />
|
||||
<div className="tutorialContent">{children}</div>
|
||||
<Sidebar />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
20
app/tutorials/[tutorial]/page.tsx
Normal file
20
app/tutorials/[tutorial]/page.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { marked } from "marked";
|
||||
export default async function Page({
|
||||
params,
|
||||
}: {
|
||||
params: { tutorial: string };
|
||||
}) {
|
||||
const requestData = await fetch(`http://127.0.0.1:3000/test.json`, {
|
||||
cache: "no-store", //! Just for dev
|
||||
/*next: { revalidate: 10 }*/
|
||||
});
|
||||
const data = await requestData.json();
|
||||
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: marked.parse(data.markdown) ?? "",
|
||||
}}
|
||||
></div>
|
||||
);
|
||||
}
|
||||
3
app/tutorials/layout.tsx
Normal file
3
app/tutorials/layout.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
9
app/tutorials/page.tsx
Normal file
9
app/tutorials/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
export default function Page({
|
||||
params,
|
||||
searchParams,
|
||||
}: {
|
||||
params: { slug: string };
|
||||
searchParams?: { [key: string]: string | string[] | undefined };
|
||||
}) {
|
||||
return <h1>List all tutorials</h1>;
|
||||
}
|
||||
Reference in New Issue
Block a user