Added implementation for base page and log in log out

This commit is contained in:
fedyna-k
2025-01-14 23:34:40 +01:00
parent 9a97591bda
commit ccad788e19
27 changed files with 374 additions and 479 deletions
+24 -7
View File
@@ -1,16 +1,33 @@
import { type PageProps } from "$fresh/server.ts";
export default function App({ Component }: PageProps) {
import { FreshContext } from "$fresh/server.ts";
import { Partial } from "$fresh/runtime.ts";
export default async function App(request: Request, context: FreshContext) {
const link = context.state.isAuthenticated ? "out" : "in";
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>polympr</title>
<link rel="stylesheet" href="/styles.css" />
<title>PolyMPR</title>
<link rel="stylesheet" href="/styles/main.css" />
</head>
<body>
<Component />
<body f-client-nav>
<header>
<h1>PolyMPR</h1>
<nav>
<a href="/modules" f-partial="/partials/modules">Modules</a>
<a href={`/log${link}`} f-client-nav={false}>Log {link}</a>
</nav>
</header>
<Partial name="body">
<context.Component />
</Partial>
<footer>
<p>&copy; 2025 PolyMPR - <a href="/about" f-partial="/partials/about">About</a></p>
</footer>
</body>
</html>
);
}
}