docs: Enhanced CSR Layout (#1908)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
This commit is contained in:
co-authored by
Marvin Hagemeister
parent
7d954584a6
commit
eb41b65d4c
+33
-14
@@ -3,26 +3,45 @@ import NavigationBar from "./NavigationBar.tsx";
|
||||
|
||||
export default function Header(props: { title: string; active: string }) {
|
||||
const isHome = props.active == "/";
|
||||
const isDocs = props.active == "/docs";
|
||||
|
||||
return (
|
||||
<div>
|
||||
<header
|
||||
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>
|
||||
<>
|
||||
{isDocs
|
||||
? (
|
||||
<header
|
||||
class={" top-0 w-full bg-white mx-auto max-w-screen-xl flex gap-3 items-center " +
|
||||
"justify-between md:justify-end"}
|
||||
>
|
||||
<div class="p-4 flex items-center md:hidden">
|
||||
<Logo />
|
||||
<DocsTitle />
|
||||
</div>
|
||||
|
||||
<NavigationBar class="hidden md:flex" active={props.active} />
|
||||
</header>
|
||||
)
|
||||
: (
|
||||
<header
|
||||
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 />
|
||||
</div>
|
||||
)}
|
||||
<NavigationBar class="hidden md:flex" active={props.active} />
|
||||
</header>
|
||||
)}
|
||||
<NavigationBar class="hidden md:flex" active={props.active} />
|
||||
</header>
|
||||
|
||||
<NavigationBar class="md:hidden pb-3" active={props.active} />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function Logo() {
|
||||
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} />
|
||||
|
||||
Reference in New Issue
Block a user