43 lines
2.0 KiB
PHP
43 lines
2.0 KiB
PHP
<flux:navlist variant="outline">
|
|
<flux:modal.trigger name="new-task-list-modal">
|
|
<flux:button icon="plus" variant="primary" class="cursor-pointer">New List</flux:button>
|
|
</flux:modal.trigger>
|
|
<flux:navlist.group :heading="__('Your Task Lists')" class="grid">
|
|
@foreach ($lists as $list)
|
|
<div class="flex justify-between gap-3 items-center" wire:key="{{$list->id}}">
|
|
<flux:navlist.item :href="route('list.view', ['slug' => $list->slug])"
|
|
:current="url()->current() == route('list.view', ['slug' => $list->slug])" wire:navigate>
|
|
{{ $list->name }}
|
|
</flux:navlist.item>
|
|
<div class="flex gap-1 items-center">
|
|
@if ($list->is_home)
|
|
<flux:button inset class="cursor-pointer" variant="subtle" size="sm"
|
|
wire:click="removeHome({{$list->id}})">
|
|
<flux:icon.home variant="solid" />
|
|
</flux:button>
|
|
@else
|
|
<flux:button inset class="cursor-pointer" variant="subtle" size="sm"
|
|
wire:click="setHome({{$list->id}})">
|
|
<flux:icon.home />
|
|
</flux:button>
|
|
@endif
|
|
@if (auth()->user()->taskLists()->count() > 1)
|
|
<flux:button inset class="cursor-pointer" icon="trash" variant="subtle" size="sm"
|
|
wire:click="delete({{$list->id}})" />
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</flux:navlist.group>
|
|
{{-- New list modal --}}
|
|
<flux:modal name="new-task-list-modal" class="md:w-96" variant="flyout" position="left">
|
|
<div class="space-y-6">
|
|
<div>
|
|
<flux:heading size="xl">New Task List</flux:heading>
|
|
</div>
|
|
<form wire:submit="create" x-on:submit="$flux.modal('new-task-list-modal').close()">
|
|
<flux:input label="Name" placeholder="Work, School, Groceries, etc" wire:model="list_name" />
|
|
</form>
|
|
</div>
|
|
</flux:modal>
|
|
</flux:navlist> |