Remaped imports to prepare for new content handling

This commit is contained in:
Kevin FEDYNA
2025-01-15 11:20:48 +01:00
parent 55cf175181
commit ed2997d51f
16 changed files with 74 additions and 17 deletions
+24
View File
@@ -0,0 +1,24 @@
import { FreshContext } from "$fresh/server.ts";
import { Partial } from "$fresh/runtime.ts";
import { State } from "$root/routes/_middleware.ts";
import Navbar from "$root/routes/(_islands)/Navbar.tsx";
import { AppProperties } from "$root/routes/(_islands)/AppNavigator.tsx";
export default async function AppLayout(
request: Request,
context: FreshContext<State>,
) {
const currentApp = new URL(request.url).pathname;
const properties: AppProperties = (await import(
`./${currentApp}/(_props)/props.ts`
)).default;
return (
<>
<Navbar pages={properties.pages} />
<Partial name="body">
<context.Component />
</Partial>
</>
);
}
+9 -2
View File
@@ -1,8 +1,15 @@
import { AppProperties } from "../../../(_islands)/AppNavigator.tsx";
import { AppProperties } from "$root/routes/(_islands)/AppNavigator.tsx";
const properties: AppProperties = {
name: "PolyNotes",
icon: "school"
icon: "school",
pages: {
index: "Homepage",
notes: "Notes",
courses: "Courses management",
students: "Students management"
},
adminOnly: [ "courses", "students" ]
};
export default properties;
+1 -4
View File
@@ -3,10 +3,7 @@ type ModulesProps = Record<string | number | symbol, never>;
export default function Modules(_props: ModulesProps) {
return (
<>
<h2>All PolyMPR modules</h2>
<nav>
</nav>
<a href="notes/test" f-partial={"notes/partial/test"}>click</a>
</>
);
}