77 lines
4.4 KiB
PHP
77 lines
4.4 KiB
PHP
<nav id="navigation-menu"
|
|
class="shadow-md border-b border-theme-primary bg-theme-background fixed top-0 left-0 right-0 z-[80] w-full text-left"
|
|
wire:ignore.self
|
|
style="margin: 0; padding: 0; left: 0; right: 0;">
|
|
@if(auth()->guest() || request()->routeIs('goodbye-deleted-user'))
|
|
<!-- Primary Navigation Menu -->
|
|
<div class="relative px-4 lg:px-8" style="max-width: 80rem; width: 100%; margin: 0;">
|
|
<div class="flex h-16 items-center justify-between">
|
|
<!-- Logo -->
|
|
<div class="flex shrink-0 items-center">
|
|
<a href="{{ route('welcome') }}">
|
|
<x-jetstream.application-mark class="block h-9 w-auto" style="max-width: 80px;" />
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Language selector and Auth Links -->
|
|
<div class="flex items-center">
|
|
@php
|
|
$languages = Illuminate\Support\Facades\DB::table('languages')->orderBy('lang_code', 'asc')->get();
|
|
$supportedLocales = LaravelLocalization::getSupportedLocales();
|
|
uasort($supportedLocales, function ($a, $b) {
|
|
return strcmp($a['native'], $b['native']);
|
|
});
|
|
@endphp
|
|
|
|
<!-- Language Dropdown -->
|
|
<div class="ms-3">
|
|
<x-jetstream.dropdown align="right" width="48">
|
|
<x-slot name="trigger">
|
|
<span class="inline-flex rounded-md">
|
|
<button type="button" class="inline-flex items-center px-2 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-theme-primary hover:text-theme-secondary focus:outline-none focus:bg-theme-surface active:bg-theme-surface transition ease-in-out duration-150">
|
|
<x-icon name="globe-alt" class="w-5 h-4" outline />
|
|
</button>
|
|
</span>
|
|
</x-slot>
|
|
|
|
<x-slot name="content">
|
|
<div class="w-60">
|
|
@foreach ($supportedLocales as $localeCode => $properties)
|
|
@php
|
|
$language = $languages->firstWhere('lang_code', strtolower($localeCode));
|
|
@endphp
|
|
@if ($language)
|
|
<div class="block px-4 py-2">
|
|
<a class="text-theme-primary transition hover:text-theme-secondary focus:border-theme-primary focus:text-theme-secondary"
|
|
href="{{ LaravelLocalization::getLocalizedURL($localeCode, null, [], true) }}"
|
|
hreflang="{{ $localeCode }}" rel="alternate">
|
|
{{ $language->flag }}
|
|
<span class="ml-3 text-theme-primary">{{ Lang::get($language->name, [], $localeCode) }}</span>
|
|
</a>
|
|
</div>
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
</x-slot>
|
|
</x-jetstream.dropdown>
|
|
</div>
|
|
|
|
<!-- Auth Links -->
|
|
@if (Route::has('login'))
|
|
<div class="ms-2 flex items-center space-x-3">
|
|
@if (Route::has('register'))
|
|
<a href="{{ route('register') }}" class="text-theme-primary hover:text-theme-secondary text-sm font-medium focus:outline-none">
|
|
{{ __('Register') }}
|
|
</a>
|
|
@endif
|
|
<a href="{{ route('login') }}" class="text-theme-primary hover:text-theme-secondary text-sm font-medium focus:outline-none">
|
|
{{ __('Log in') }}
|
|
</a>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</nav>
|