]> git.localhorst.tv Git - alttp.git/blob - resources/views/layouts/navigation.blade.php
add discord auth
[alttp.git] / resources / views / layouts / navigation.blade.php
1 <nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
2     <!-- Primary Navigation Menu -->
3     <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
4         <div class="flex justify-between h-16">
5             <div class="flex">
6                 <!-- Logo -->
7                 <div class="flex-shrink-0 flex items-center">
8                     <a href="{{ route('dashboard') }}">
9                         <x-application-logo class="block h-10 w-auto fill-current text-gray-600" />
10                     </a>
11                 </div>
12
13                 <!-- Navigation Links -->
14                 <div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
15                     <x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
16                         {{ __('Dashboard') }}
17                     </x-nav-link>
18                 </div>
19             </div>
20
21             <!-- Settings Dropdown -->
22             <div class="hidden sm:flex sm:items-center sm:ml-6">
23                 <x-dropdown align="right" width="48">
24                     <x-slot name="trigger">
25                         <button class="flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300 transition duration-150 ease-in-out">
26                             @if(Auth::user()->avatar)
27                                 <img class="h-8 w-8 rounded-full object-cover mr-2" src="https://cdn.discordapp.com/avatars/{{ Auth::user()->id }}/{{ Auth::user()->avatar }}.webp" alt="{{ Auth::user()->username }}#{{ Auth::user()->discriminator }}" />
28                             @endif
29
30                             <div>
31                                 {{ Auth::user()->username }}#{{ Auth::user()->discriminator }}
32                             </div>
33
34                             <div class="ml-1">
35                                 <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
36                                     <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
37                                 </svg>
38                             </div>
39                         </button>
40                     </x-slot>
41
42                     <x-slot name="content">
43                         <!-- Authentication -->
44                         <form method="POST" action="{{ route('logout') }}">
45                             @csrf
46
47                             <x-dropdown-link :href="route('logout')"
48                                              onclick="event.preventDefault();
49                                                 this.closest('form').submit();">
50                                 {{ __('Log Out') }}
51                             </x-dropdown-link>
52                         </form>
53                     </x-slot>
54                 </x-dropdown>
55             </div>
56
57             <!-- Hamburger -->
58             <div class="-mr-2 flex items-center sm:hidden">
59                 <button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
60                     <svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
61                         <path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
62                         <path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
63                     </svg>
64                 </button>
65             </div>
66         </div>
67     </div>
68
69     <!-- Responsive Navigation Menu -->
70     <div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
71         <div class="pt-2 pb-3 space-y-1">
72             <x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
73                 {{ __('Dashboard') }}
74             </x-responsive-nav-link>
75         </div>
76
77         <!-- Responsive Settings Options -->
78         <div class="pt-4 pb-1 border-t border-gray-200">
79             <div class="px-4">
80                 <div class="font-medium text-base text-gray-800">{{ Auth::user()->name }}</div>
81                 <div class="font-medium text-sm text-gray-500">{{ Auth::user()->email }}</div>
82             </div>
83
84             <div class="mt-3 space-y-1">
85                 <!-- Authentication -->
86                 <form method="POST" action="{{ route('logout') }}">
87                     @csrf
88
89                     <x-responsive-nav-link :href="route('logout')"
90                                            onclick="event.preventDefault();
91                                         this.closest('form').submit();">
92                         {{ __('Log Out') }}
93                     </x-responsive-nav-link>
94                 </form>
95             </div>
96         </div>
97     </div>
98 </nav>