From 8b1e230cf37ee00dab63afed5011e518e61e7cf8 Mon Sep 17 00:00:00 2001 From: Jacob Zweifel Date: Sun, 8 Oct 2023 14:51:20 -0500 Subject: [PATCH] try to addrress a couple accessibility audit issues --- src/components/header.tsx | 38 ++++++++++++++++++++++++++++++++++ src/pages/(admin)/new-post.tsx | 2 ++ src/pages/index.tsx | 31 ++------------------------- 3 files changed, 42 insertions(+), 29 deletions(-) create mode 100644 src/components/header.tsx diff --git a/src/components/header.tsx b/src/components/header.tsx new file mode 100644 index 0000000..85644f6 --- /dev/null +++ b/src/components/header.tsx @@ -0,0 +1,38 @@ +import Html from "@kitajs/html"; +import { Session } from "lucia"; + +export function Header({ session }: { session: Session }) { + return ( +
+ {session ? ( + <> +

+ We've been waiting for you, {session.user.name}. +

+ + Log Out + + {session.user.roles.includes("ADMIN") ? ( + + New Post + + ) : null} + + ) : ( + + )} +
+ ); +} diff --git a/src/pages/(admin)/new-post.tsx b/src/pages/(admin)/new-post.tsx index 31c5f34..3542cad 100644 --- a/src/pages/(admin)/new-post.tsx +++ b/src/pages/(admin)/new-post.tsx @@ -1,5 +1,6 @@ import Elysia from "elysia"; import { BaseHtml } from "../../components/base"; +import { Header } from "../../components/header"; import { ctx } from "../../context"; export const newPost = new Elysia() @@ -13,6 +14,7 @@ export const newPost = new Elysia() return html( +