Some checks failed
- Extract login/dashboard from billing module into core (matching admin pattern) - Add merchant auth API with path-isolated cookies (path=/merchants) - Add merchant base layout with sidebar/header partials and Alpine.js init - Add frontend detection and login redirect for MERCHANT type - Wire merchant token in shared api-client.js (get/clear) - Migrate billing templates to merchant base with dark mode support - Fix Tailwind: rename shop→storefront in sources and config - DRY Makefile tailwind targets with TAILWIND_FRONTENDS loop - Rebuild all Tailwind outputs (production minified) - Add Gitea Actions CI workflow (ruff, pytest, architecture, docs) - Add Gitea deployment documentation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
71 lines
3.6 KiB
HTML
71 lines
3.6 KiB
HTML
{# app/templates/merchant/partials/header.html #}
|
|
<header class="z-10 py-4 bg-white shadow-md dark:bg-gray-800">
|
|
<div class="container flex items-center justify-between h-full px-6 mx-auto text-purple-600 dark:text-purple-300">
|
|
<!-- Mobile hamburger -->
|
|
<button class="p-1 mr-5 -ml-1 rounded-md md:hidden focus:outline-none focus:shadow-outline-purple"
|
|
@click="toggleSideMenu"
|
|
aria-label="Menu">
|
|
<span x-html="$icon('menu', 'w-6 h-6')"></span>
|
|
</button>
|
|
|
|
<!-- Spacer -->
|
|
<div class="flex-1"></div>
|
|
|
|
<ul class="flex items-center flex-shrink-0 space-x-6">
|
|
<!-- Theme toggler -->
|
|
<li class="flex">
|
|
<button class="rounded-md focus:outline-none focus:shadow-outline-purple"
|
|
@click="toggleTheme"
|
|
aria-label="Toggle color mode">
|
|
<template x-if="!dark">
|
|
<span x-html="$icon('moon', 'w-5 h-5')"></span>
|
|
</template>
|
|
<template x-if="dark">
|
|
<span x-html="$icon('sun', 'w-5 h-5')"></span>
|
|
</template>
|
|
</button>
|
|
</li>
|
|
|
|
<!-- Profile menu -->
|
|
<li class="relative" x-data="{ profileOpen: false }">
|
|
<button class="align-middle rounded-full focus:shadow-outline-purple focus:outline-none"
|
|
@click="profileOpen = !profileOpen"
|
|
@keydown.escape="profileOpen = false"
|
|
aria-label="Account"
|
|
aria-haspopup="true">
|
|
<div class="w-8 h-8 rounded-full bg-purple-600 flex items-center justify-center text-white font-semibold">
|
|
<span x-text="merchantName?.charAt(0).toUpperCase() || '?'"></span>
|
|
</div>
|
|
</button>
|
|
|
|
<ul x-show="profileOpen"
|
|
x-cloak
|
|
x-transition:leave="transition ease-in duration-150"
|
|
x-transition:leave-start="opacity-100"
|
|
x-transition:leave-end="opacity-0"
|
|
@click.away="profileOpen = false"
|
|
@keydown.escape="profileOpen = false"
|
|
class="absolute right-0 w-56 p-2 mt-2 space-y-2 text-gray-600 bg-white border border-gray-100 rounded-md shadow-md dark:border-gray-700 dark:text-gray-300 dark:bg-gray-700 z-50"
|
|
style="display: none;"
|
|
aria-label="submenu">
|
|
<li class="flex">
|
|
<a class="inline-flex items-center w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200"
|
|
href="/merchants/account/profile">
|
|
<span x-html="$icon('user', 'w-4 h-4 mr-3')"></span>
|
|
<span>Profile</span>
|
|
</a>
|
|
</li>
|
|
<li class="flex">
|
|
<button
|
|
@click="handleLogout()"
|
|
class="inline-flex items-center w-full px-2 py-1 text-sm font-semibold transition-colors duration-150 rounded-md hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-800 dark:hover:text-gray-200 text-left">
|
|
<span x-html="$icon('logout', 'w-4 h-4 mr-3')"></span>
|
|
<span>Log out</span>
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</header>
|