Added implementation for base page and log in log out
This commit is contained in:
+24
-7
@@ -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>© 2025 PolyMPR - <a href="/about" f-partial="/partials/about">About</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user