Files
sweet/www/components/Header.tsx
T
Josh CollinsworthandMarvin Hagemeister e8d1a68b58 www: refresh home page (#2418)
Overhauls the Fresh homepage with a new design, new demos, and new
sections highlighting Fresh's capabilities.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-05-17 16:08:55 +02:00

51 lines
1.4 KiB
TypeScript

import DocsTitle from "./DocsTitle.tsx";
import NavigationBar from "./NavigationBar.tsx";
export default function Header(props: { title: string; active: string }) {
const isHome = props.active == "/";
const isDocs = props.active == "/docs";
return (
<>
{isDocs
? (
<header
class={" top-0 w-full bg-transparent mx-auto max-w-screen-xl flex gap-3 items-center " +
"justify-between md:justify-end"}
f-client-nav={false}
>
<div class="p-4 flex items-center md:hidden">
<Logo />
<DocsTitle />
</div>
<NavigationBar class="" active={props.active} />
</header>
)
: (
<header
class={"h-20 mx-auto max-w-screen-xl flex gap-3 items-center " +
(isHome ? "justify-end" : "justify-between")}
f-client-nav={false}
>
{!isHome && (
<div class="p-4 flex items-center">
<Logo />
<DocsTitle />
</div>
)}
<NavigationBar class="" active={props.active} />
</header>
)}
</>
);
}
export function Logo() {
return (
<a href="/" class="flex mr-3 items-center" aria-label="Top Page">
<img src="/logo.svg" alt="Fresh logo" width={40} height={40} />
</a>
);
}