-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Livewire; | ||
|
||
use Domain\Board\Models\Board; | ||
use Domain\User\Models\User; | ||
use Illuminate\Container\Attributes\CurrentUser; | ||
use Illuminate\Contracts\View\View; | ||
use Livewire\Component; | ||
|
||
class HomeComponent extends Component | ||
{ | ||
private User $user; | ||
|
||
public function boot(#[CurrentUser] User $user): void | ||
{ | ||
$this->user = $user; | ||
} | ||
|
||
public function render(): View | ||
{ | ||
return view('livewire.home-component') | ||
->with('boards', Board::all()) | ||
->with('current_board_id', $this->user->currentCard?->bucket->board_id) | ||
; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg {{ $attributes->twMerge('size-6') }} xmlns="http://www.w3.org/2000/svg" fill="fillColor" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<x-slot name="title">Boards</x-slot> | ||
<div class="flex flex-col w-full px-4 pb-4"> | ||
<h1 class="p-4 bg-white/5 rounded text-lg font-semibold text-white">All Board</h1> | ||
<div class="flex w-full flex-grow items-start overflow-y-hidden mt-4 space-x-3"> | ||
@foreach($boards as $board) | ||
<a href="{{ route('boards.show', $board->id) }}" class="flex items-center w-72 p-2 space-y-2 rounded bg-gray-100 hover:bg-white/90 font-semibold"> | ||
{{ $board->name }} | ||
@if ($current_board_id === $board->id) | ||
<x-icons.play class="ms-auto size-5 fill-primary text-primary"></x-icons.play> | ||
@endif | ||
</a> | ||
@endforeach | ||
<button class="flex items-center gap-x-1 w-72 p-2 rounded text-white hover:text-primary font-semibold cursor-pointer"> | ||
<x-icons.plus class="size-5" /> New Board | ||
</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?php | ||
|
||
use App\Livewire\Board\BoardComponent; | ||
use App\Livewire\HomeComponent; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::get('/', function () { | ||
return view('welcome'); | ||
}); | ||
|
||
Route::group(['middleware' => ['auth', 'verified']], function () { | ||
Route::get('/', HomeComponent::class)->name('home'); | ||
|
||
Route::get('boards/{board}', BoardComponent::class)->name('boards.show'); | ||
}); |