Skip to content

Commit e1d3069

Browse files
committed
Add Submenu Style For When Profile Photos Are Unmanaged
Closes #274
1 parent a33dd2f commit e1d3069

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

stubs/inertia/resources/js/Layouts/AppLayout.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@
2525
<div class="ml-3 relative">
2626
<jet-dropdown align="right" width="48">
2727
<template #trigger>
28-
<button class="flex text-sm border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300 transition duration-150 ease-in-out">
28+
<button v-if="$page.jetstream.managesProfilePhotos" class="flex text-sm border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300 transition duration-150 ease-in-out">
2929
<img class="h-8 w-8 rounded-full object-cover" :src="$page.user.profile_photo_url" :alt="$page.user.name" />
3030
</button>
31+
<button v-else class="flex border-transparent text-sm font-medium leading-5 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">
32+
{{ $page.user.name }}
33+
<div class="flex items-center">
34+
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
35+
<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" />
36+
</svg>
37+
</div>
38+
</button>
3139
</template>
3240

3341
<template #content>

stubs/livewire/resources/views/navigation-dropdown.blade.php

+14-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,20 @@
2222
<div class="hidden sm:flex sm:items-center sm:ml-6">
2323
<x-jet-dropdown align="right" width="48">
2424
<x-slot name="trigger">
25-
<button class="flex text-sm border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300 transition duration-150 ease-in-out">
26-
<img class="h-8 w-8 rounded-full object-cover" src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" />
27-
</button>
25+
@if (Laravel\Jetstream\Jetstream::managesProfilePhotos())
26+
<button class="flex text-sm border-2 border-transparent rounded-full focus:outline-none focus:border-gray-300 transition duration-150 ease-in-out">
27+
<img class="h-8 w-8 rounded-full object-cover" src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" />
28+
</button>
29+
@else
30+
<button class="flex border-transparent text-sm font-medium leading-5 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">
31+
{{ Auth::user()->name }}
32+
<div class="flex items-center">
33+
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
34+
<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" />
35+
</svg>
36+
</div>
37+
</button>
38+
@endif
2839
</x-slot>
2940

3041
<x-slot name="content">

0 commit comments

Comments
 (0)