fleetCatalogue/resources/views/components/layout/sidebar.blade.php

64 lines
2.7 KiB
PHP

<div class="fixed">
<div
x-on:click.away="if (window.innerWidth < 640) { sidebarOpen = false }"
class="flex flex-col p-3 bg-zinc-800 text-gray-400 h-screen w-14"
:class="sidebarOpen ? 'w-60' : ''">
<div class="space-y-3 h-full">
<div class="flex items-center justify-between text-{{ env('ACCENT_COLOR') }} h-[5rem]">
<h2 x-show="sidebarOpen" style="display: none;">{{ __('This is a sidebar') }}</h2>
<button x-on:click="sidebarOpen = ! sidebarOpen" class="p-2">
<i class="fas fa-bars fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</button>
</div>
<div class="flex-1">
<ul class="pt-2 pb-4 space-y-1 text-sm">
@if(env('LANDING_PAGE', false))
<x-layout.sidebar.list-element href="{{ route('home') }}" title="{{ __('Home') }}">
<x-slot:icon>
<i class="fa-solid fa-house-chimney fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@endif
<x-layout.sidebar.list-element href="{{ route('keybinds') }}" title="{{ __('Keybinds') }}" class="h-[2rem]">
<x-slot:icon>
<i class="fa-solid fa-keyboard fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
<x-layout.sidebar.list-element href="{{ route('vehicles') }}" title="{{ __('Vehicles') }}" class="h-[2rem]">
<x-slot:icon>
<i class="fa-solid fa-car fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
</ul>
</div>
</div>
<div class="flex-1">
<ul class="pt-2 pb-4 space-y-1 text-sm">
@if(!Auth::check())
<x-layout.sidebar.list-element href="{{ route('login') }}" title="{{ __('Login')}}">
<x-slot:icon>
<i class="fa-solid fa-right-to-bracket fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@endif
@if(Auth::check())
<x-layout.sidebar.list-element href="{{ route('logout') }}" title="{{ __('Logout') }}">
<x-slot:icon>
<i class="fa-solid fa-door-open fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
<x-layout.sidebar.list-element href="{{ route('dashboard') }}" title="{{ __('Dashboard') }}">
<x-slot:icon>
<i class="fa-solid fa-user fa-lg text-{{ env('ACCENT_COLOR') }}"></i>
</x-slot:icon>
</x-layout.sidebar.list-element>
@endif
</ul>
</div>
@auth()
<div x-show="sidebarOpen" style="display: none;" class="flex items-center space-x-4 justify-self-end">
<h2 class="text-lg font-semibold text-{{ env('ACCENT_COLOR') }}"><a rel="noopener noreferrer" href="{{ route('profile.edit') }}">{{ Auth::getUser()->getName() }}</a></h2>
</div>
@endauth
</div>
</div>