✨ Breadcrumbs with navigation for mobile
All checks were successful
Build and deploy website / build (push) Successful in 38s
All checks were successful
Build and deploy website / build (push) Successful in 38s
This commit is contained in:
parent
05ef06f95c
commit
dc4d564059
@ -2,13 +2,13 @@
|
|||||||
import PajamasIcon from "@/components/icons/PajamasIcon.astro"
|
import PajamasIcon from "@/components/icons/PajamasIcon.astro"
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
id: string
|
for: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const { id } = Astro.props
|
const { for: forId } = Astro.props
|
||||||
---
|
---
|
||||||
|
|
||||||
<label for={id} aria-label="open sidebar" class="btn btn-square btn-ghost">
|
<label for={forId} aria-label="open sidebar" class="btn btn-square btn-ghost">
|
||||||
<PajamasIcon
|
<PajamasIcon
|
||||||
name="pajamas:hamburger"
|
name="pajamas:hamburger"
|
||||||
class="w-6 h-6"
|
class="w-6 h-6"
|
||||||
|
@ -2,22 +2,24 @@
|
|||||||
import Navbar from "./Navbar.astro"
|
import Navbar from "./Navbar.astro"
|
||||||
import NavbarDrawer from "./NavbarDrawer.astro"
|
import NavbarDrawer from "./NavbarDrawer.astro"
|
||||||
import HamburgerMenuButton from "./HamburgerMenuButton.astro"
|
import HamburgerMenuButton from "./HamburgerMenuButton.astro"
|
||||||
|
import Breadcrumb from "../Breadcrumb.astro"
|
||||||
import { resolvePathname } from "@/utils/linking"
|
import { resolvePathname } from "@/utils/linking"
|
||||||
|
|
||||||
const currentPath = `~${resolvePathname(Astro.originPathname)}`
|
const currentPath = `~${resolvePathname(Astro.originPathname)}`
|
||||||
|
const drawerToggleId = "header-drawer"
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="sm:m-auto">
|
<div class="sm:m-auto">
|
||||||
<div class="drawer drawer-end">
|
<div class="drawer drawer-end">
|
||||||
<input id="my-drawer-3" type="checkbox" class="drawer-toggle" />
|
<input id={drawerToggleId} type="checkbox" class="drawer-toggle" />
|
||||||
<div class="drawer-content flex flex-col">
|
<div class="drawer-content flex flex-col">
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
<div class="navbar w-full justify-end">
|
<div class="navbar w-full justify-end">
|
||||||
<div class="flex justify-between items-center w-full h-full sm:hidden">
|
<div class="flex justify-between items-center w-full h-full sm:hidden">
|
||||||
<h1 class="!text-2xl h-5">
|
<h1 class="!text-xl h-5">
|
||||||
{currentPath}
|
<Breadcrumb />
|
||||||
</h1>
|
</h1>
|
||||||
<HamburgerMenuButton id="my-drawer-3" />
|
<HamburgerMenuButton for={drawerToggleId} />
|
||||||
</div>
|
</div>
|
||||||
<div class="hidden flex-none sm:block">
|
<div class="hidden flex-none sm:block">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
@ -25,8 +27,11 @@ const currentPath = `~${resolvePathname(Astro.originPathname)}`
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="drawer-side z-50">
|
<div class="drawer-side z-50">
|
||||||
<label for="my-drawer-3" aria-label="close sidebar" class="drawer-overlay"
|
<label
|
||||||
></label>
|
for={drawerToggleId}
|
||||||
|
aria-label="close sidebar"
|
||||||
|
class="drawer-overlay"></label>
|
||||||
|
<!-- Drawer -->
|
||||||
<ul class="menu bg-cat-base min-h-full w-80 p-4">
|
<ul class="menu bg-cat-base min-h-full w-80 p-4">
|
||||||
<li class="text-xl font-bold my-5">
|
<li class="text-xl font-bold my-5">
|
||||||
{currentPath}
|
{currentPath}
|
||||||
|
@ -31,10 +31,11 @@ const {
|
|||||||
} = entry!.data
|
} = entry!.data
|
||||||
|
|
||||||
function localeDateString(isoString: string): string {
|
function localeDateString(isoString: string): string {
|
||||||
|
let template = "DD-MM-YYYY"
|
||||||
if (languageTag() === "nb") {
|
if (languageTag() === "nb") {
|
||||||
return dayjs(isoString).locale(languageTag()).format("DD/MM/YYYY")
|
template = "DD/MM/YYYY"
|
||||||
}
|
}
|
||||||
return dayjs(isoString).locale(languageTag()).format("DD-MM-YYYY")
|
return dayjs(isoString).locale(languageTag()).format(template)
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user