fix(www): Add a global nav (#895)
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
export default function NavigationBar(props: { active: string }) {
|
||||
export default function NavigationBar(
|
||||
props: { active: string; class?: string },
|
||||
) {
|
||||
const items = [
|
||||
{
|
||||
name: "Home",
|
||||
href: "/",
|
||||
},
|
||||
{
|
||||
name: "Docs",
|
||||
href: "/docs",
|
||||
@@ -17,15 +15,17 @@ export default function NavigationBar(props: { active: string }) {
|
||||
href: "/components",
|
||||
},
|
||||
];
|
||||
|
||||
const isHome = props.active == "/";
|
||||
return (
|
||||
<nav class="bg-green-200 py-2">
|
||||
<ul class="flex justify-center gap-8 mx-4">
|
||||
<nav class={"flex " + props.class ?? ""}>
|
||||
<ul class="flex justify-center items-center gap-4 mx-4 my-6">
|
||||
{items.map((item) => (
|
||||
<li>
|
||||
<a
|
||||
href={item.href}
|
||||
class={`text-gray-600 hover:underline ${
|
||||
class={`p-2 ${
|
||||
isHome ? "text-green-900" : "text-gray-600"
|
||||
} hover:underline ${
|
||||
props.active == item.href ? "font-bold" : ""
|
||||
}`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user