Add branch switcher to mobile profile bottom sheet.
Deploy Ladill POS / deploy (push) Successful in 31s
Deploy Ladill POS / deploy (push) Successful in 31s
Matches Woo store switcher pattern; desktop header switcher stays on large screens only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
@if (isset($actingLocation) || (($accessibleLocations ?? collect())->isNotEmpty()))
|
||||
<div class="border-b border-slate-100 px-2 py-2">
|
||||
<p class="px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-slate-400">Switch branch</p>
|
||||
@foreach ($accessibleLocations ?? [] as $branch)
|
||||
<form method="POST" action="{{ route('pos.location.switch') }}">
|
||||
@csrf
|
||||
<input type="hidden" name="location" value="{{ $branch->id }}">
|
||||
<button type="submit"
|
||||
@if (! empty($onNavigate)) @click="{{ $onNavigate }}" @endif
|
||||
class="flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left text-sm font-medium transition hover:bg-slate-100 {{ ($actingLocation->id ?? null) === $branch->id ? 'bg-indigo-50 text-indigo-700' : 'text-slate-700' }}">
|
||||
<svg class="h-4 w-4 shrink-0 {{ ($actingLocation->id ?? null) === $branch->id ? 'text-indigo-500' : 'text-slate-400' }}" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M13.5 21v-7.5a.75.75 0 0 1 .75-.75h3a.75.75 0 0 1 .75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349M3.75 21V9.349m0 0a3.001 3.001 0 0 0 3.75-.615A2.993 2.993 0 0 0 9.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 0 0 2.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 0 0 3.75.614m-16.5 0a3.004 3.004 0 0 1-.621-4.72L4.318 3.44A1.5 1.5 0 0 1 5.378 3h13.243a1.5 1.5 0 0 1 1.06.44l1.19 1.189a3 3 0 0 1-.621 4.72M6.75 18h3.75a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75H6.75a.75.75 0 0 0-.75.75v3.75c0 .414.336.75.75.75Z" />
|
||||
</svg>
|
||||
<span class="min-w-0 flex-1 truncate">{{ $branch->name }}</span>
|
||||
@if (($actingLocation->id ?? null) === $branch->id)
|
||||
<span class="shrink-0 text-xs font-medium text-indigo-600">Active</span>
|
||||
@endif
|
||||
</button>
|
||||
</form>
|
||||
@endforeach
|
||||
@if (! empty($canManageBranches))
|
||||
<a href="{{ route('pos.settings') }}#branches"
|
||||
@if (! empty($onNavigate)) @click="{{ $onNavigate }}" @endif
|
||||
class="mt-1 block rounded-xl px-3 py-2 text-xs font-medium text-indigo-600 hover:bg-indigo-50 hover:text-indigo-800">
|
||||
Manage branches
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@@ -122,6 +122,8 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('partials.branch-switcher-menu', ['onNavigate' => 'profileOpen = false'])
|
||||
|
||||
@include('partials.user-profile-menu', [
|
||||
'items' => $profileMenuItems,
|
||||
'variant' => 'sheet',
|
||||
|
||||
Reference in New Issue
Block a user