forked from denoland/fresh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavigationBar.tsx
More file actions
63 lines (61 loc) · 1.6 KB
/
NavigationBar.tsx
File metadata and controls
63 lines (61 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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: "Blog",
href: "https://deno.com/blog?tag=fresh",
},
];
const isHome = props.active == "/";
const isDocs = props.active == "/docs";
return (
<nav class={"flex " + (props.class ?? "")} f-client-nav={false}>
<ul class="flex items-center gap-x-2 sm:gap-4 mx-4 my-2 sm:my-6 flex-wrap lg:mx-8 2xl:mr-0">
{items.map((item) => (
<li key={item.name}>
<a
href={item.href}
class={`p-1 sm:p-2 ${
isHome
? "text-green-900"
: isDocs
? "text-foreground-secondary"
: "text-gray-600"
} hover:underline aria-[current]: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 transition"
aria-label="GitHub"
>
<Icons.GitHub />
</a>
</li>
<li class="flex items-center">
<a
href="https://discord.com/invite/deno"
class="hover:text-green-600 inline-block transition"
aria-label="Discord"
>
<Icons.Discord />
</a>
</li>
</ul>
</nav>
);
}