www: update docs design (#1423)

This commit is contained in:
Marvin Hagemeister
2023-07-10 11:07:49 +02:00
committed by GitHub
parent 4b18dc8b79
commit f061667822
7 changed files with 47 additions and 39 deletions
+11 -14
View File
@@ -1,21 +1,23 @@
import DocsTitle from "./DocsTitle.tsx";
import NavigationBar from "./NavigationBar.tsx";
import SearchButton from "../islands/SearchButton.tsx";
export default function Header(props: { title: string; active: string }) {
const isHome = props.active == "/";
const isDocs = props.active.startsWith("/docs");
return (
<div>
<header
class={"mx-auto max-w-screen-lg flex gap-3 " +
class={"mx-auto max-w-screen-xl flex gap-3 items-center " +
(isHome ? "justify-end" : "justify-between")}
>
{!isHome &&
(
<div class="p-4 flex items-center">
<Logo />
<DocsTitle title={props.title} />
</div>
)}
{!isHome && (
<div class="p-4 flex items-center">
<Logo />
<DocsTitle title={props.title} />
</div>
)}
{isDocs && <SearchButton class="grow mb-0 hidden lg:flex" />}
<NavigationBar class="hidden md:flex" active={props.active} />
</header>
<NavigationBar class="md:hidden pb-3" active={props.active} />
@@ -26,12 +28,7 @@ export default function Header(props: { title: string; active: string }) {
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}
/>
<img src="/logo.svg" alt="Fresh logo" width={40} height={40} />
</a>
);
}