Deploy Ladill Link / deploy (push) Successful in 1m11s
Drop the lg+ topbar search field; mobile search entry points are unchanged.
59 lines
2.1 KiB
PHP
59 lines
2.1 KiB
PHP
@php
|
|
$user = auth()->user();
|
|
$initials = collect(explode(' ', trim((string) $user?->name)))
|
|
->filter()
|
|
->take(2)
|
|
->map(fn ($part) => strtoupper(substr($part, 0, 1)))
|
|
->implode('');
|
|
|
|
$rcCartCount = 0;
|
|
$domainCartCount = 0;
|
|
$cartCount = 0;
|
|
$cartRoute = route('user.products.cart');
|
|
if ($user) {
|
|
$rcCartCount = \App\Models\RcServiceOrder::query()
|
|
->where('user_id', $user->id)
|
|
->whereIn('status', [
|
|
\App\Models\RcServiceOrder::STATUS_CART,
|
|
\App\Models\RcServiceOrder::STATUS_PENDING_PAYMENT,
|
|
])
|
|
->count();
|
|
|
|
$domainCartCount = \App\Models\DomainOrder::query()
|
|
->where('user_id', $user->id)
|
|
->whereIn('status', [
|
|
\App\Models\DomainOrder::STATUS_CART,
|
|
\App\Models\DomainOrder::STATUS_PENDING_PAYMENT,
|
|
])
|
|
->count();
|
|
|
|
$cartCount = $rcCartCount + $domainCartCount;
|
|
|
|
if ($rcCartCount === 0 && $domainCartCount > 0) {
|
|
$cartRoute = route('user.domains.cart');
|
|
}
|
|
}
|
|
@endphp
|
|
|
|
<header class="flex items-center justify-between h-16 border-b border-slate-200 bg-white px-6"
|
|
>
|
|
<div class="flex items-center gap-3 flex-1 min-w-0">
|
|
<button @click="sidebarOpen = !sidebarOpen" class="lg:hidden shrink-0 text-slate-500 hover:text-slate-700">
|
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-center gap-3">
|
|
@auth
|
|
@includeIf('partials.topbar-account-switcher')
|
|
@includeIf('partials.topbar-widgets-prepend')
|
|
@include('partials.topbar-desktop-widgets', ['user' => $user ?? $u ?? auth()->user(), 'showUser' => true])
|
|
@includeIf('partials.topbar-widgets-append')
|
|
@else
|
|
<a href="{{ route('login') }}" class="btn-primary">Sign in</a>
|
|
@include('partials.launcher')
|
|
@endauth
|
|
</div>
|
|
</header>
|