Files
sweet/www/components/NavigationBar.tsx
T
ayame113 a724f6c591 www: fix accessibility issues (#1243)
Address accessibility issues pointed out by Lighthouse.
2023-06-03 22:19:40 +02:00

56 lines
1.2 KiB
TypeScript

import * as Icons from "./Icons.tsx";
export default function NavigationBar(
props: { active: string; class?: string },
) {
const items = [
{
name: "Docs",
href: "/docs",
},
{
name: "Showcase",
href: "/showcase",
},
{
name: "Components",
href: "/components",
},
{
name: "Discord",
href: "https://discord.com/invite/deno",
},
];
const isHome = props.active == "/";
return (
<nav class={"flex " + props.class ?? ""}>
<ul class="flex justify-center items-center gap-4 mx-4 my-6 flex-wrap">
{items.map((item) => (
<li>
<a
href={item.href}
class={`p-2 ${
isHome ? "text-green-900" : "text-gray-600"
} hover:underline ${
props.active == item.href ? "font-bold" : ""
}`}
>
{item.name}
</a>
</li>
))}
<li class="flex items-center">
<a
href="https://github.com/denoland/fresh"
class="hover:text-green-600 inline-block"
aria-label="GitHub"
>
<Icons.GitHub />
</a>
</li>
</ul>
</nav>
);
}