add team view

This commit is contained in:
Andras Bacsai 2023-05-16 14:38:11 +02:00
parent 99be766e90
commit 846e74b8b5
5 changed files with 22 additions and 12 deletions

View File

@ -11,6 +11,9 @@
<a href="/profile">
<x-inputs.button>Profile</x-inputs.button>
</a>
<a href="/profile/team">
<x-inputs.button>Team</x-inputs.button>
</a>
@if (auth()->user()->isRoot())
<a href="/settings">
<x-inputs.button>Settings</x-inputs.button>

View File

@ -1,6 +1,10 @@
<div>
@foreach (auth()->user()->otherTeams() as $team)
<x-inputs.button wire:key="{{ $team->id }}" wire:click="switch_to('{{ $team->id }}')">Switch to:
{{ $team->name }}</x-inputs.button>
@endforeach
<div class="pt-4">
<h3>Other Teams</h3>
<div class="flex flex-col gap-2">
@foreach (auth()->user()->otherTeams() as $team)
<x-inputs.button isBold wire:key="{{ $team->id }}" wire:click="switch_to('{{ $team->id }}')">Switch
to:
{{ $team->name }}</x-inputs.button>
@endforeach
</div>
</div>

View File

@ -6,12 +6,5 @@
<p>Id: {{ auth()->user()->id }}</p>
<p>Uuid: {{ auth()->user()->uuid }}</p>
</div>
<div>
<h3>Current Team</h3>
<p>Name: {{ session('currentTeam')->name }}</p>
<p>Id: {{ session('currentTeam')->id }}</p>
<p>Uuid: {{ session('currentTeam')->uuid }}</p>
</div>
<livewire:switch-team>
</div>
</x-layout>

View File

@ -0,0 +1,7 @@
<x-layout>
<div>
<h3>Current Team</h3>
<p>Name: {{ session('currentTeam')->name }}</p>
<livewire:switch-team>
</div>
</x-layout>

View File

@ -128,6 +128,9 @@
Route::get('/profile', function () {
return view('profile');
})->name('profile');
Route::get('/profile/team', function () {
return view('team');
})->name('team');
Route::get('/settings', function () {
$isRoot = auth()->user()->isRoot();