Files
isaaccladandCursor 60673c9adf
Deploy Ladill Woo Manager / deploy (push) Successful in 46s
Move store switcher beside Afia and drop header search.
Desktop store pill sits left of Afia like POS; mobile store switching stays in the profile sheet and the bottom-nav search tab is removed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 06:52:26 +00:00

30 lines
2.1 KiB
PHP

@if(($wooActiveStores ?? collect())->count() > 0)
<div class="relative hidden shrink-0 lg:block" x-data="{ open: false }" @click.outside="open = false">
<button type="button" @click="open = !open"
class="inline-flex max-w-[14rem] items-center gap-1.5 rounded-full border border-slate-200 px-3 py-2 text-sm text-slate-700 transition hover:bg-slate-50">
<span class="truncate font-medium">{{ $currentWooStore?->site_name ?? parse_url($currentWooStore?->site_url ?? '', PHP_URL_HOST) ?? 'Select store' }}</span>
<svg class="h-4 w-4 shrink-0 text-slate-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="m19 9-7 7-7-7"/></svg>
</button>
<div x-show="open" x-cloak x-transition
class="absolute right-0 top-full z-50 mt-2 w-72 overflow-hidden rounded-xl border border-slate-200 bg-white py-1 shadow-lg">
<p class="px-3 py-2 text-xs font-semibold uppercase tracking-wide text-slate-400">Switch store</p>
@foreach($wooActiveStores as $store)
<form method="post" action="{{ route('woo.stores.switch') }}">
@csrf
<input type="hidden" name="store" value="{{ $store->id }}">
<button type="submit"
class="flex w-full items-start gap-2 px-3 py-2 text-left text-sm hover:bg-slate-50 {{ $currentWooStore?->id === $store->id ? 'bg-indigo-50 text-indigo-700' : 'text-slate-700' }}">
<span class="font-medium">{{ $store->site_name ?? parse_url($store->site_url, PHP_URL_HOST) }}</span>
@if($currentWooStore?->id === $store->id)
<span class="ml-auto text-xs text-indigo-600">Active</span>
@endif
</button>
</form>
@endforeach
<div class="border-t border-slate-100 px-3 py-2">
<a href="{{ route('woo.stores.index') }}" class="text-xs font-medium text-indigo-600 hover:text-indigo-800">Manage stores</a>
</div>
</div>
</div>
@endif