Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Apr 24, 2024
1 parent 1bf7301 commit bfaf0d0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
<div>
bla
@props([
'action',
])

<div x-data="{ open: true }" class="flex items-center">
<x-wireuse::actions-button
:$action
x-on:click="open = ! open"
class="flex-row-reverse py-1.5 px-3 gap-1 rounded font-medium text-xs bg-secondary-700 text-secondary-200"
/>

@teleport('body')
<div
x-cloak
x-show="open"
x-on:click.outside="open = false"
x-on:keyup.escape.window="open = false"
x-trap.inert.noscroll="open"
class="absolute z-30 bottom-0 inset-x-1/4 m-3"
>
<div class="relative px-3 py-4 rounded-xl flex w-full max-w-[25rem] mx-auto bg-secondary-500">
<div class="prose prose-headings:font-semibold prose-h1:text-sm prose-h1:text-base">
<h1>{{ __('Sort by' )}}</h1>

{{-- {{ $sort }} --}}

{{-- {{ $action->foo }} --}}

{{-- <button wire:click="$parent.set('form.sort', 'bla')">Remove</button> --}}
</div>
</div>
</div>
@endteleport
</div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<x-wireuse::layout-container class="p-3" fluid>
<x-dashboard.videos.filters>
<x-dashboard.videos.filters.sorters />
<x-dashboard.videos.filters.sorters :action="$filters->first('sort')" />
</x-dashboard.videos.filters>

</x-wireuse::layout-container>
16 changes: 15 additions & 1 deletion src/App/Livewire/Dashboard/Content/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Livewire\Dashboard\Content;

use App\Livewire\Dashboard\Videos\Forms\QueryForm;
use Foxws\WireUse\Actions\Support\Action;
use Foxws\WireUse\Actions\Support\ActionGroup;
use Illuminate\View\View;
use Livewire\Component;

Expand All @@ -13,12 +15,24 @@ class Videos extends Component
public function render(): View
{
return view('livewire.dashboard.content.videos')->with([
// 'filters' => $this->filters(),
'filters' => $this->filters(),
]);
}

public function updated(): void
{
$this->validate();
}

protected function filters(): ActionGroup
{
return ActionGroup::make()
->add('sort', fn (Action $item) => $item
->label(__('Sort by'))
->icon('heroicon-s-chevron-down')
->bladeAttributes([
'class:icon' => 'size-3',
])
);
}
}

0 comments on commit bfaf0d0

Please sign in to comment.