Redesign mobile dashboard actions and sync wallet balance in profile sheet.
Deploy Ladill Frontdesk / deploy (push) Successful in 51s
Deploy Ladill Frontdesk / deploy (push) Successful in 51s
Stack full-width check-in and pre-register buttons on mobile; show wallet card in the profile bottom sheet with balance refresh on open. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,18 +13,35 @@
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="mb-6 flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-slate-900">{{ $organization->name }}</h1>
|
||||
<p class="text-sm text-slate-500">Reception dashboard</p>
|
||||
<div class="mb-6">
|
||||
{{-- Mobile: org name + full-width actions (avoids cramped side-by-side buttons) --}}
|
||||
<div class="space-y-3 lg:hidden">
|
||||
<h1 class="truncate text-lg font-semibold tracking-tight text-slate-900">{{ $organization->name }}</h1>
|
||||
<div class="flex flex-col gap-2">
|
||||
<a href="{{ route('frontdesk.visits.create') }}" class="btn-primary w-full py-3 text-sm">
|
||||
Check in visitor
|
||||
</a>
|
||||
<a href="{{ route('frontdesk.visits.schedule') }}"
|
||||
class="inline-flex w-full items-center justify-center rounded-xl border border-slate-200 bg-white px-4 py-3 text-sm font-semibold text-slate-700 transition hover:border-slate-300 hover:bg-slate-50">
|
||||
Pre-register visitor
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<a href="{{ route('frontdesk.visits.schedule') }}" class="inline-flex items-center rounded-lg border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">
|
||||
Pre-register
|
||||
</a>
|
||||
<a href="{{ route('frontdesk.visits.create') }}" class="btn-primary">
|
||||
Check in visitor
|
||||
</a>
|
||||
|
||||
{{-- Desktop --}}
|
||||
<div class="hidden items-center justify-between lg:flex">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-slate-900">{{ $organization->name }}</h1>
|
||||
<p class="text-sm text-slate-500">Reception dashboard</p>
|
||||
</div>
|
||||
<div class="flex shrink-0 gap-2">
|
||||
<a href="{{ route('frontdesk.visits.schedule') }}" class="inline-flex items-center rounded-lg border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">
|
||||
Pre-register
|
||||
</a>
|
||||
<a href="{{ route('frontdesk.visits.create') }}" class="btn-primary whitespace-nowrap">
|
||||
Check in visitor
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@
|
||||
if ($profileMenuItems === [] && $profileUrl !== '#') {
|
||||
$profileMenuItems = [['type' => 'link', 'label' => 'Profile', 'href' => $profileUrl]];
|
||||
}
|
||||
$walletBalanceRoute = (string) config('billing.wallet_balance_route', 'wallet.balance');
|
||||
$showWalletInSheet = \Illuminate\Support\Facades\Route::has($walletBalanceRoute)
|
||||
|| collect($profileMenuItems)->contains(fn (array $item): bool => ($item['type'] ?? '') === 'wallet');
|
||||
$sheetMenuItems = array_values(array_filter(
|
||||
$profileMenuItems,
|
||||
fn (array $item): bool => ($item['type'] ?? 'link') !== 'wallet'
|
||||
));
|
||||
$navActive = fn (bool $active) => $active ? 'text-indigo-600' : 'text-slate-600';
|
||||
@endphp
|
||||
<div x-data="{ profileOpen: false }" class="lg:hidden">
|
||||
@@ -119,8 +126,19 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($showWalletInSheet)
|
||||
<div class="border-b border-slate-100 px-4 py-4"
|
||||
x-effect="profileOpen && window.dispatchEvent(new CustomEvent('wallet-balance-refresh'))">
|
||||
<p class="mb-2 text-sm font-medium text-slate-700">Billing</p>
|
||||
@include('partials.wallet-widget', [
|
||||
'onNavigate' => 'profileOpen = false',
|
||||
'class' => 'mx-0',
|
||||
])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('partials.user-profile-menu', [
|
||||
'items' => $profileMenuItems,
|
||||
'items' => $sheetMenuItems,
|
||||
'variant' => 'sheet',
|
||||
'onNavigate' => 'profileOpen = false',
|
||||
])
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
{{-- Wallet balance peek (links to the account wallet on account.ladill.com). --}}
|
||||
@php
|
||||
$onNavigate = $onNavigate ?? null;
|
||||
$class = trim((string) ($class ?? 'mx-1'));
|
||||
$balanceRoute = (string) config('billing.wallet_balance_route', 'wallet.balance');
|
||||
$balanceUrl = \Illuminate\Support\Facades\Route::has($balanceRoute) ? route($balanceRoute) : null;
|
||||
$walletUrl = \Illuminate\Support\Facades\Route::has('user.wallet.index')
|
||||
? route('user.wallet.index')
|
||||
: (function_exists('ladill_account_url') ? ladill_account_url('/wallet') : '#');
|
||||
@endphp
|
||||
@if ($balanceUrl)
|
||||
<a href="{{ ladill_account_url('/wallet') }}"
|
||||
<a href="{{ $walletUrl }}"
|
||||
x-data="walletWidget({ url: {{ \Illuminate\Support\Js::from($balanceUrl) }} })" x-init="load()"
|
||||
class="mx-1 flex items-center justify-between gap-3 rounded-xl border border-slate-100 bg-gradient-to-r from-indigo-50 to-slate-50 px-3 py-2.5 transition hover:border-indigo-200 hover:from-indigo-100/70">
|
||||
@wallet-balance-refresh.window="load()"
|
||||
@if ($onNavigate) @click="{{ $onNavigate }}" @endif
|
||||
class="{{ $class }} flex items-center justify-between gap-3 rounded-xl border border-slate-100 bg-gradient-to-r from-indigo-50 to-slate-50 px-3 py-2.5 transition hover:border-indigo-200 hover:from-indigo-100/70">
|
||||
<span class="flex items-center gap-2.5 min-w-0">
|
||||
<span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-indigo-100 text-indigo-600">
|
||||
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="1.6" viewBox="0 0 24 24">
|
||||
|
||||
Reference in New Issue
Block a user