ls-deno/components/Page.tsx

29 lines
978 B
TypeScript
Raw Normal View History

2022-09-29 20:22:30 -05:00
import { JSX } from "preact";
2022-10-01 14:03:15 -05:00
const NAV_ITEM_CLASSES = "flex justify-center items-center px-4 py-2";
const HEADER_CLASSES = "bg-gray-200 dark:bg-gray-800";
2022-09-29 20:22:30 -05:00
export function Page(props: JSX.HTMLAttributes<HTMLDivElement>) {
return (
2022-09-30 15:14:57 -05:00
<div class="relative min-h-screen flex flex-col">
<header class="flex justify-start items-center">
2022-10-01 14:03:15 -05:00
<nav class={`flex w-full drop-shadow-md ${HEADER_CLASSES}`}>
<a href="/" class={`${NAV_ITEM_CLASSES} text-black dark:text-white`}>
2022-09-30 15:14:57 -05:00
<h1 class="text-2xl">LyricScreen</h1>
</a>
<a href="/note" class={NAV_ITEM_CLASSES}>Notes</a>
<a href="/register" class={NAV_ITEM_CLASSES}>Register</a>
<a href="/login" class={NAV_ITEM_CLASSES}>Login</a>
2022-09-29 20:22:30 -05:00
</nav>
</header>
2022-09-30 15:14:57 -05:00
<main class="p-2">
2022-09-29 20:22:30 -05:00
{props.children}
</main>
2022-10-01 14:03:15 -05:00
<footer class={`p-2 w-full mt-auto ${HEADER_CLASSES}`}>
2022-09-29 20:22:30 -05:00
"It's a bit much, really..."
</footer>
</div>
);
}