Skip to content

Commit 3eed8d3

Browse files
committed
Jetstream teams user menu support
1 parent 4f22ae5 commit 3eed8d3

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

resources/views/layouts/partials/nav-user.blade.php

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,41 @@
77

88
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
99
<!-- Team Management -->
10-
<div class="block px-4 py-2 text-xs text-gray-400">
11-
{{ __('Manage Team') }}
12-
</div>
13-
10+
<h6 class="dropdown-header">{{ __('Manage Team') }}r</h6>
11+
1412
<!-- Team Settings -->
15-
<x-dropdown-link href="{{ route('teams.show', Auth::user()->currentTeam->id) }}">
16-
{{ __('Team Settings') }}
17-
</x-dropdown-link>
13+
<a class="dropdown-item" href="{{ route('teams.show', Auth::user()->currentTeam->id) }}">{{ __('Team Settings') }}</a>
1814

1915
@can('create', Laravel\Jetstream\Jetstream::newTeamModel())
20-
<x-dropdown-link href="{{ route('teams.create') }}">
21-
{{ __('Create New Team') }}
22-
</x-dropdown-link>
16+
<a class="dropdown-item" href="{{ route('teams.create') }}">{{ __('Create New Team') }}</a>
2317
@endcan
2418

2519
<!-- Team Switcher -->
2620
@if (Auth::user()->allTeams()->count() > 1)
27-
<div class="border-t border-gray-200"></div>
28-
29-
<div class="block px-4 py-2 text-xs text-gray-400">
30-
{{ __('Switch Teams') }}
31-
</div>
21+
<div class="dropdown-divider"></div>
22+
23+
<h6 class="dropdown-header">{{ __('Switch Teams') }}r</h6>
3224

3325
@foreach (Auth::user()->allTeams() as $team)
34-
<x-switchable-team :team="$team" />
26+
<form method="POST" action="{{ route('current-team.update') }}" x-data>
27+
@method('PUT')
28+
@csrf
29+
30+
<!-- Hidden Team ID -->
31+
<input type="hidden" name="team_id" value="{{ $team->id }}">
32+
33+
<x-dynamic-component :component="$component" href="#" x-on:click.prevent="$root.submit();">
34+
<div class="flex items-center">
35+
@if (Auth::user()->isCurrentTeam($team))
36+
<svg class="me-2 size-5 text-green-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
37+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
38+
</svg>
39+
@endif
40+
41+
<div class="truncate">{{ $team->name }}</div>
42+
</div>
43+
</x-dynamic-component>
44+
</form>
3545
@endforeach
3646
@endif
3747
</div>

0 commit comments

Comments
 (0)