mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 08:11:10 -05:00
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
<div class="relative">
|
|
<!-- Profile Picture Button -->
|
|
@if(auth()->user()->profile?->avatar)
|
|
<img
|
|
wire:click="toggle"
|
|
src="{{ auth()->user()->profile->avatar }}"
|
|
alt="{{ auth()->user()->username }}"
|
|
class="w-8 h-8 transition-transform rounded-full cursor-pointer ring-2 ring-primary/20 hover:scale-105"
|
|
/>
|
|
@else
|
|
<div
|
|
wire:click="toggle"
|
|
class="flex items-center justify-center w-8 h-8 text-white transition-transform rounded-full cursor-pointer bg-gradient-to-br from-primary to-secondary hover:scale-105"
|
|
>
|
|
{{ ucfirst(auth()->user()->username[0]) }}
|
|
</div>
|
|
@endif
|
|
|
|
<!-- Dropdown Menu -->
|
|
<div
|
|
wire:model="isOpen"
|
|
class="bg-white dropdown-menu dark:bg-gray-800"
|
|
style="display: {{ $isOpen ? 'block' : 'none' }}"
|
|
>
|
|
<a href="{{ route('profile.show', auth()->user()->username) }}" class="menu-item">
|
|
<i class="w-5 fas fa-user"></i>
|
|
<span>Profile</span>
|
|
</a>
|
|
<a href="{{ route('settings') }}" class="menu-item">
|
|
<i class="w-5 fas fa-cog"></i>
|
|
<span>Settings</span>
|
|
</a>
|
|
@if(auth()->user()->can('access-admin'))
|
|
<a href="{{ route('admin.index') }}" class="menu-item">
|
|
<i class="w-5 fas fa-shield-alt"></i>
|
|
<span>Admin</span>
|
|
</a>
|
|
@endif
|
|
<form method="POST" action="{{ route('logout') }}">
|
|
@csrf
|
|
<button type="submit" class="w-full menu-item">
|
|
<i class="w-5 fas fa-sign-out-alt"></i>
|
|
<span>Logout</span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div> |