feat(nav): add check-in icon to navigation bar

- Add checkin map-pin icon to shared icons partial
- Add check-in nav link (icon on desktop, icon + text on mobile)
- Only shown when authenticated
- Set nav_active to "checkin" on the check-in page
This commit is contained in:
Jon Seager 2026-02-04 17:14:52 +00:00
parent ebd2698b42
commit e508af4c52
No known key found for this signature in database
3 changed files with 14 additions and 1 deletions

View file

@ -30,7 +30,7 @@ pub(crate) async fn checkin_page(
let cafe_options = load_cafe_options(&state).await.map_err(map_app_error)?;
let template = CheckInTemplate {
nav_active: "home",
nav_active: "checkin",
is_authenticated: true,
roast_options,
cafe_options,

View file

@ -16,6 +16,9 @@
{% call icons::home("inline h-4 w-4") %}
</a>
{% if is_authenticated %}
<a class="border-b-2 pb-1 transition {% if nav_active == "checkin" %}text-amber-700 border-amber-500{% else %}text-stone-500 border-transparent hover:text-amber-600 hover:border-amber-400{% endif %}" href="/check-in" aria-label="Check In">
{% call icons::checkin("inline h-4 w-4") %}
</a>
<form method="post" action="/logout" class="inline">
<button type="submit" class="border-b-2 pb-1 transition text-stone-500 border-transparent hover:text-amber-600 hover:border-amber-400">Logout</button>
</form>
@ -44,6 +47,10 @@
Home
</a>
{% if is_authenticated %}
<a class="py-1 transition inline-flex items-center gap-1 {% if nav_active == "checkin" %}text-amber-700 font-medium{% else %}text-stone-500 hover:text-amber-600{% endif %}" href="/check-in">
{% call icons::checkin("inline h-4 w-4") %}
Check In
</a>
<form method="post" action="/logout" class="inline">
<button type="submit" class="py-1 transition text-stone-500 hover:text-amber-600 text-left">Logout</button>
</form>

View file

@ -85,6 +85,12 @@
</svg>
{% endmacro %}
{% macro checkin(class) %}
<svg class="{{ class }}" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003ZM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5Z" clip-rule="evenodd" />
</svg>
{% endmacro %}
{% macro x_circle(class) %}
<svg class="{{ class }}" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd" />