Place wallet widget after Billing link in mobile profile sheet.
Deploy Ladill Hosting / deploy (push) Successful in 1m11s
Deploy Ladill Hosting / deploy (push) Successful in 1m11s
Remove duplicate Billing header above Home; wallet card follows Billing in menu order to match the desktop avatar dropdown. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,13 +15,6 @@
|
||||
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">
|
||||
@@ -95,6 +88,7 @@
|
||||
class="absolute inset-0 bg-slate-900/40 backdrop-blur-[1px]"></div>
|
||||
|
||||
<div x-show="profileOpen"
|
||||
x-effect="profileOpen && window.dispatchEvent(new CustomEvent('wallet-balance-refresh'))"
|
||||
x-transition:enter="transition ease-out duration-300"
|
||||
x-transition:enter-start="translate-y-full"
|
||||
x-transition:enter-end="translate-y-0"
|
||||
@@ -126,19 +120,8 @@
|
||||
</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' => $sheetMenuItems,
|
||||
'items' => $profileMenuItems,
|
||||
'variant' => 'sheet',
|
||||
'onNavigate' => 'profileOpen = false',
|
||||
])
|
||||
|
||||
@@ -54,7 +54,10 @@
|
||||
{{ $item['label'] }}
|
||||
</a>
|
||||
@elseif (($item['type'] ?? '') === 'wallet')
|
||||
@includeIf('partials.wallet-widget')
|
||||
@includeIf('partials.wallet-widget', [
|
||||
'onNavigate' => $onNavigate,
|
||||
'class' => $variant === 'sheet' ? 'mx-2' : 'mx-1',
|
||||
])
|
||||
@elseif (($item['type'] ?? '') === 'logout')
|
||||
@if ($variant !== 'sheet')
|
||||
<div class="{{ $dividerClass }}"></div>
|
||||
|
||||
Reference in New Issue
Block a user