From 1f582d71d6f1b9f24397f9789670d6a8b458d54d Mon Sep 17 00:00:00 2001 From: w33b Date: Mon, 10 Aug 2026 16:30:49 +0200 Subject: [PATCH] feat(nav): make nav links icon-only on mobile with tooltips - Add label prop to nav-link component to display text labels only when active on large screens - Restructure navigation layout to use grid with left column for brand and inline links - Show icon-only links with title tooltips on mobile, full labels on larger screens - Adjust live search input widths for better responsive scaling across breakpoints --- resources/views/components/nav-link.blade.php | 14 ++-- resources/views/layouts/navigation.blade.php | 84 +++++++++---------- .../views/livewire/nav-live-search.blade.php | 2 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/resources/views/components/nav-link.blade.php b/resources/views/components/nav-link.blade.php index 2714436..7dbdd38 100644 --- a/resources/views/components/nav-link.blade.php +++ b/resources/views/components/nav-link.blade.php @@ -1,11 +1,15 @@ -@props(['active']) +@props(['active' => false, 'label' => null]) @php -$classes = ($active ?? false) - ? 'inline-flex items-center gap-1.5 rounded-xl bg-gradient-to-r from-rose-600 to-pink-600 px-3.5 py-2 text-sm font-semibold text-white shadow-md shadow-rose-600/25' - : 'inline-flex items-center gap-1.5 rounded-xl px-3.5 py-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:bg-rose-50 dark:hover:bg-rose-950/30 hover:text-rose-700 dark:hover:text-rose-300 transition-colors'; +$classes = $active + ? 'inline-flex h-9 min-w-0 items-center justify-center gap-1.5 rounded-full bg-gradient-to-r from-rose-600 to-pink-600 text-white shadow-md shadow-rose-600/25 max-lg:w-9 lg:px-3.5 [&>i]:shrink-0' + : 'inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-gray-600 ring-1 ring-gray-200 transition-colors hover:bg-rose-50 hover:text-rose-700 dark:text-gray-300 dark:ring-neutral-700 dark:hover:bg-rose-950/30 dark:hover:text-rose-300'; @endphp -merge(['class' => $classes]) }}> +merge(['class' => $classes]) }} @if ($label && ! $active) title="{{ $label }}" @endif> {{ $slot }} + + @if ($active && $label) + + @endif diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/layouts/navigation.blade.php index 279cfae..9a85824 100644 --- a/resources/views/layouts/navigation.blade.php +++ b/resources/views/layouts/navigation.blade.php @@ -2,46 +2,45 @@ @php $notAvailable = auth()->check() ? auth()->user()->unreadNotifications()->count() > 0 : false; @endphp
-
- {{-- Brand --}} -
- +
+ {{-- Left column: brand + inline links --}} + - {{-- Center: inline links + live search --}} -
- - {{-- Right cluster --}} -
diff --git a/resources/views/livewire/nav-live-search.blade.php b/resources/views/livewire/nav-live-search.blade.php index 3bc5f91..f2646b2 100644 --- a/resources/views/livewire/nav-live-search.blade.php +++ b/resources/views/livewire/nav-live-search.blade.php @@ -3,7 +3,7 @@ @csrf
-
+
{{-- Search Icon --}}