Place wallet widget after Billing link in mobile profile sheet.
Deploy Ladill Link / deploy (push) Successful in 47s
Deploy Ladill Link / deploy (push) Successful in 47s
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 !== '#') {
|
if ($profileMenuItems === [] && $profileUrl !== '#') {
|
||||||
$profileMenuItems = [['type' => 'link', 'label' => 'Profile', 'href' => $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';
|
$navActive = fn (bool $active) => $active ? 'text-indigo-600' : 'text-slate-600';
|
||||||
@endphp
|
@endphp
|
||||||
<div x-data="{ profileOpen: false }" class="lg:hidden">
|
<div x-data="{ profileOpen: false }" class="lg:hidden">
|
||||||
@@ -95,6 +88,7 @@
|
|||||||
class="absolute inset-0 bg-slate-900/40 backdrop-blur-[1px]"></div>
|
class="absolute inset-0 bg-slate-900/40 backdrop-blur-[1px]"></div>
|
||||||
|
|
||||||
<div x-show="profileOpen"
|
<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="transition ease-out duration-300"
|
||||||
x-transition:enter-start="translate-y-full"
|
x-transition:enter-start="translate-y-full"
|
||||||
x-transition:enter-end="translate-y-0"
|
x-transition:enter-end="translate-y-0"
|
||||||
@@ -126,19 +120,8 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@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', [
|
@include('partials.user-profile-menu', [
|
||||||
'items' => $sheetMenuItems,
|
'items' => $profileMenuItems,
|
||||||
'variant' => 'sheet',
|
'variant' => 'sheet',
|
||||||
'onNavigate' => 'profileOpen = false',
|
'onNavigate' => 'profileOpen = false',
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -54,7 +54,10 @@
|
|||||||
{{ $item['label'] }}
|
{{ $item['label'] }}
|
||||||
</a>
|
</a>
|
||||||
@elseif (($item['type'] ?? '') === 'wallet')
|
@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')
|
@elseif (($item['type'] ?? '') === 'logout')
|
||||||
@if ($variant !== 'sheet')
|
@if ($variant !== 'sheet')
|
||||||
<div class="{{ $dividerClass }}"></div>
|
<div class="{{ $dividerClass }}"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user