Sync mobile profile wallet card and 24h session idle timeout.
Deploy Ladill Transfer / deploy (push) Successful in 52s
Deploy Ladill Transfer / deploy (push) Successful in 52s
Show wallet balance prominently in the mobile profile bottom sheet with refresh on open; align session lifetime with the platform default. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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',
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user