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 8a48281 commit b84aadc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
28 changes: 18 additions & 10 deletions resources/views/components/dashboard/videos/filters/radio.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,28 @@ class:icon="size-3"
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"
class="absolute z-30 bottom-0 inset-x-0 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>
<div class="relative mx-auto rounded-xl w-full max-w-96 bg-secondary-800">
<x-heroicon-m-minus class="h-8 fill-secondary-500 mx-auto" />

<input type="radio" value="recent" wire:model.live="form.sort"> Recent
<input type="radio" value="random" wire:model.live="form.sort"> Random
<div class="flex flex-col pb-4 px-4 gap-3">
<h1 class="font-semibold">{{ $action->getLabel() }}</h1>

{{-- {{ $sort }} --}}
@foreach ($action->all() as $option)
<div class="flex items-center gap-3 text-sm">
<input
type="radio"
id="{{ $option->getName() }}"
value="{{ $option->getName() }}"
wire:model.live="form.sort"
/>

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

{{-- <button wire:click="$parent.set('form.sort', 'bla')">Remove</button> --}}
<label for="{{ $option->getName() }}">
{{ $option->getLabel() }}
</label>
</div>
@endforeach
</div>
</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions resources/views/livewire/dashboard/content/videos.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<x-wireuse::layout-container class="p-3" fluid>
{{ $form->sort }}

<x-dashboard.videos.filters>
@foreach($filters->all() as $action)
<x-dynamic-component :component="$action->getComponent()" :$action />
Expand Down
2 changes: 2 additions & 0 deletions src/App/Livewire/Dashboard/Content/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ protected function filters(): ActionGroup
->label(__('Sort by'))
->icon('heroicon-s-chevron-down')
->component('dashboard.videos.filters.radio')
->add('recent', fn (Action $item) => $item->label('Most recent (standard'))
->add('random', fn (Action $item) => $item->label('Most watched'))
);
}
}

0 comments on commit b84aadc

Please sign in to comment.