forked from fahrPool/fahrPool
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import type { NavZiel } from "@/lib/navigation";
|
|
import { AktiverLink } from "./AktiverLink";
|
|
import { NavIcon } from "./NavIcon";
|
|
|
|
export const MENUE_OEFFNEN = "menue-oeffnen";
|
|
|
|
const ZIEL =
|
|
"flex min-h-14 flex-1 flex-col items-center justify-center gap-0.5 text-xs text-asphalt-grey focus-visible:outline focus-visible:outline-2 focus-visible:outline-performance-blue";
|
|
|
|
// Feste Leiste fuer die haeufigsten Ziele am Handy; "Mehr" oeffnet das bestehende Menue.
|
|
export function UntereLeiste({ ziele }: { ziele: NavZiel[] }) {
|
|
return (
|
|
<nav
|
|
aria-label="Schnellzugriff"
|
|
className="fixed inset-x-0 bottom-0 z-40 flex border-t border-aluminium-grey bg-white pb-[env(safe-area-inset-bottom)] lg:hidden"
|
|
>
|
|
{ziele.map((ziel) => (
|
|
<AktiverLink key={ziel.href} href={ziel.href} className={ZIEL} aktivClassName="font-semibold text-performance-blue">
|
|
<NavIcon name={ziel.icon} />
|
|
{ziel.kurz}
|
|
</AktiverLink>
|
|
))}
|
|
<button
|
|
type="button"
|
|
aria-haspopup="dialog"
|
|
className={ZIEL}
|
|
onClick={() => window.dispatchEvent(new Event(MENUE_OEFFNEN))}
|
|
>
|
|
<NavIcon name="verwaltung" />
|
|
Mehr
|
|
</button>
|
|
</nav>
|
|
);
|
|
}
|