Skip to content

Commit

Permalink
Prevent speaker profile nav item from displaying without profile slug
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmile committed Sep 12, 2023
1 parent 3cba3f3 commit acfc762
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions resources/views/partials/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ class="block px-4"
<x-nav-item route="bios.index">Bios</x-nav-item>
<x-nav-item route="talks.index">Talks</x-nav-item>
<x-mobile-nav-item route="account.show">Account</x-mobile-nav-item>
<x-mobile-nav-item
url="{{ route('speakers-public.show', auth()->user()->profile_slug) }}"
:show="auth()->user()->enable_profile"
>
Public Speaker Profile
</x-mobile-nav-item>
@if (auth()->user()->profile_slug)
<x-mobile-nav-item
url="{{ route('speakers-public.show', auth()->user()->profile_slug) }}"
:show="auth()->user()->enable_profile"
>
Public Speaker Profile
</x-mobile-nav-item>
@endif
<x-mobile-nav-item route="log-out">Log out</x-mobile-nav-item>
@else
<x-nav-item route="what-is-this">How it Works</x-nav-item>
Expand Down Expand Up @@ -62,12 +64,14 @@ class="hidden inline rounded-full w-8 lg:block"
</x-slot>
<x-slot name="items">
<x-menu.item route="account.show">Account</x-menu.item>
<x-menu.item
url="{{ route('speakers-public.show', auth()->user()->profile_slug) }}"
:show="auth()->user()->enable_profile"
>
Public Speaker Profile
</x-menu.item>
@if (auth()->user()->profile_slug)
<x-menu.item
url="{{ route('speakers-public.show', auth()->user()->profile_slug) }}"
:show="auth()->user()->enable_profile"
>
Public Speaker Profile
</x-menu.item>
@endif
<x-menu.item route="log-out">Log out</x-menu.item>
</x-slot>
</x-menu>
Expand Down

0 comments on commit acfc762

Please sign in to comment.