ui cleanup
This commit is contained in:
parent
b6a365cde1
commit
54355fc942
6 changed files with 83 additions and 75 deletions
|
|
@ -5,10 +5,12 @@ namespace App\Livewire;
|
||||||
use App\Livewire\Forms\MovieListForm;
|
use App\Livewire\Forms\MovieListForm;
|
||||||
use App\Livewire\Forms\SettingsForm;
|
use App\Livewire\Forms\SettingsForm;
|
||||||
use App\Models\MovieList as MovieListModel;
|
use App\Models\MovieList as MovieListModel;
|
||||||
|
use Livewire\Attributes\Locked;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
class MovieList extends Component
|
class MovieList extends Component
|
||||||
{
|
{
|
||||||
|
#[locked]
|
||||||
public int $id;
|
public int $id;
|
||||||
public MovieListModel $list;
|
public MovieListModel $list;
|
||||||
public $movies = [];
|
public $movies = [];
|
||||||
|
|
@ -36,7 +38,6 @@ class MovieList extends Component
|
||||||
|
|
||||||
if ($list) {
|
if ($list) {
|
||||||
$this->list = $list;
|
$this->list = $list;
|
||||||
$this->movies = $list->movies;
|
|
||||||
$this->filteredMovies = $list->movies;
|
$this->filteredMovies = $list->movies;
|
||||||
$this->settingsForm->setList($list);
|
$this->settingsForm->setList($list);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -46,7 +47,7 @@ class MovieList extends Component
|
||||||
|
|
||||||
public function filterMovies(): void
|
public function filterMovies(): void
|
||||||
{
|
{
|
||||||
$this->filteredMovies = collect($this->movies)
|
$this->filteredMovies = collect($this->list->movies)
|
||||||
->filter(fn($movie) => stripos($movie->title, $this->filterText) !== false);
|
->filter(fn($movie) => stripos($movie->title, $this->filterText) !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<div {{ $attributes->merge(['class' => 'bg-gray-800 p-5 flex flex-col gap-5 items-center rounded']) }}>
|
<div {{ $attributes->merge(['class' => 'bg-gray-700 p-5 flex flex-col gap-5 items-center rounded']) }}>
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,13 @@
|
||||||
|
|
||||||
<ul class="w-full flex flex-col gap-5">
|
<ul class="w-full flex flex-col gap-5">
|
||||||
@foreach($lists as $list)
|
@foreach($lists as $list)
|
||||||
<li class="flex justify-between text-center">
|
<li class="flex py-5 justify-between text-center">
|
||||||
<a href="/lists/{{$list->id}}" wire:navigate>{{$list->name}}</a>
|
<a class="font-bold text-2xl" href="/lists/{{$list->id}}" wire:navigate>{{$list->name}}</a>
|
||||||
|
@if((bool)$list->is_public === true)
|
||||||
|
<i class="fa fa-earth" title="Public" aria-label="Public"></i>
|
||||||
|
@else
|
||||||
|
<i class="fa fa-lock" title="Private" aria-label="Private"></i>
|
||||||
|
@endif
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-ui.card class="overflow-hidden">
|
<x-ui.card class="overflow-hidden min-h-screen">
|
||||||
<div class="absolute">
|
<div class="absolute">
|
||||||
<livewire:search-panel :list-id="$list->id"/>
|
<livewire:search-panel :list-id="$list->id"/>
|
||||||
<livewire:movie-details-panel/>
|
<livewire:movie-details-panel/>
|
||||||
|
|
@ -20,9 +20,16 @@
|
||||||
<!-- Movie List View -->
|
<!-- Movie List View -->
|
||||||
<div class="w-full flex-shrink-0 flex flex-col gap-5">
|
<div class="w-full flex-shrink-0 flex flex-col gap-5">
|
||||||
<div class="flex flex-col-reverse sm:flex-row gap-5 sm:gap-0 justify-between w-full">
|
<div class="flex flex-col-reverse sm:flex-row gap-5 sm:gap-0 justify-between w-full">
|
||||||
<input class="flex bg-white p-2 rounded sm:w-100" type="text" placeholder="Filter movies"
|
<div>
|
||||||
wire:model.live="filterText"
|
<input class="flex bg-white p-2 rounded sm:w-100" type="text" placeholder="Filter movies"
|
||||||
wire:keyup="filterMovies"/>
|
wire:model.live="filterText"
|
||||||
|
wire:keyup="filterMovies"/>
|
||||||
|
<div class="mt-5">
|
||||||
|
<span class="bold">Sort: </span>
|
||||||
|
<span>DESC</span>
|
||||||
|
<span>ASC</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr class="my-2 sm:my-0"/>
|
<hr class="my-2 sm:my-0"/>
|
||||||
<button wire:click="$dispatch('openSearch')"
|
<button wire:click="$dispatch('openSearch')"
|
||||||
|
|
@ -45,7 +52,6 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Settings View -->
|
<!-- Settings View -->
|
||||||
<div class="w-full flex-shrink-0 flex flex-col gap-5">
|
<div class="w-full flex-shrink-0 flex flex-col gap-5">
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
|
|
@ -55,7 +61,7 @@
|
||||||
<h2 class="text-xl font-semibold">Settings</h2>
|
<h2 class="text-xl font-semibold">Settings</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2 w-full">
|
<div class="flex flex-col gap-2 w-full p-5">
|
||||||
<label for="list-name">List Name</label>
|
<label for="list-name">List Name</label>
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<input type="text" wire:model.live="settingsForm.name" id="list-name"
|
<input type="text" wire:model.live="settingsForm.name" id="list-name"
|
||||||
|
|
@ -64,8 +70,9 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-between bg-gray-700 p-4 rounded">
|
<div
|
||||||
<label for="is_public" class="text-white">Make list public</label>
|
class="flex items-center justify-between bg-gray-700 hover:bg-gray-500 hover:opacity-85 p-5 rounded">
|
||||||
|
<label for="is_public" class="text-white cursor-pointer">Make list public</label>
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
id="is_public"
|
id="is_public"
|
||||||
wire:model.live="settingsForm.isPublic"
|
wire:model.live="settingsForm.isPublic"
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,28 @@
|
||||||
<div class="text-2xl">
|
<x-layouts.auth>
|
||||||
<h1 class="text-center m-5">Create Account</h1>
|
<div class="text-2xl text-white flex flex-col items-center gap-10 py-6 min-h-screen">
|
||||||
|
<x-ui.site-logo class="w-50 mt-4"/>
|
||||||
|
|
||||||
<form class="flex flex-col gap-5" wire:submit="register">
|
<x-ui.card class="w-full max-w-md">
|
||||||
@if($errors->any())
|
<form class="flex flex-col gap-5 w-full" wire:submit="register">
|
||||||
<div class="text-red-500">
|
@if($errors->any())
|
||||||
@foreach($errors->all() as $error)
|
<div class="text-red-500">
|
||||||
<p>{{$error}}</p>
|
@foreach($errors->all() as $error)
|
||||||
@endforeach
|
<p>{{$error}}</p>
|
||||||
</div>
|
@endforeach
|
||||||
@endif
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col gap-2">
|
||||||
<label class="py-5" for="username">Username</label>
|
<label class="font-bold" for="username">Username</label>
|
||||||
<input class="bg-white" type="text" wire:model.live="form.username"/>
|
<input class="bg-white p-2" type="text" wire:model.live="form.username"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col gap-2">
|
||||||
<label class="py-5" for="email">Email</label>
|
<label class="font-bold" for="email">Email</label>
|
||||||
<input class="bg-white" type="email" wire:model.live="form.email"/>
|
<input class="bg-white p-2" type="email" wire:model.live="form.email"/>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="bg-green-400 text-white px-4 py-2 rounded">Submit</button>
|
|
||||||
</form>
|
<button class="bg-green-400 rounded p-2" type="submit">Create Account</button>
|
||||||
</div>
|
</form>
|
||||||
|
</x-ui.card>
|
||||||
|
</div>
|
||||||
|
</x-layouts.auth>
|
||||||
|
|
|
||||||
|
|
@ -1,43 +1,33 @@
|
||||||
<div class="text-2xl">
|
<x-layouts.auth>
|
||||||
<h1 class="text-center m-5">Reset Password</h1>
|
<div class="text-2xl text-white flex flex-col items-center gap-10 py-6 min-h-screen">
|
||||||
|
<x-ui.site-logo class="w-50 mt-4"/>
|
||||||
|
|
||||||
<form class="flex flex-col gap-5" wire:submit="resetPassword">
|
<x-ui.card class="w-full max-w-md">
|
||||||
@csrf
|
<form class="flex flex-col gap-5 w-full" wire:submit="resetPassword">
|
||||||
@if($errors->any())
|
@csrf
|
||||||
<div class="text-red-500">
|
@if($errors->any())
|
||||||
@foreach($errors->all() as $error)
|
<div class="text-red-500">
|
||||||
<p>{{$error}}</p>
|
@foreach($errors->all() as $error)
|
||||||
@endforeach
|
<p>{{$error}}</p>
|
||||||
</div>
|
@endforeach
|
||||||
@endif
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col gap-2">
|
||||||
<label class="py-5" for="email">Email</label>
|
<label class="font-bold" for="email">Email</label>
|
||||||
<input
|
<input class="bg-white p-2" type="email" name="email" wire:model.live="form.email"/>
|
||||||
class="bg-white"
|
</div>
|
||||||
type="email"
|
<div class="flex flex-col gap-2">
|
||||||
name="email"
|
<label class="font-bold" for="password">Password</label>
|
||||||
wire:model.live="form.email"
|
<input class="bg-white p-2" type="password" name="password" wire:model.live="form.password"/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
<div class="flex flex-col gap-2">
|
||||||
<div class="flex flex-col">
|
<label class="font-bold" for="password_confirmation">Confirm Password</label>
|
||||||
<label class="py-5" for="password">Password</label>
|
<input class="bg-white p-2" type="password" name="password_confirmation" wire:model.live="form.password_confirmation"/>
|
||||||
<input
|
</div>
|
||||||
class="bg-white"
|
|
||||||
type="password"
|
<button class="bg-green-400 rounded p-2" type="submit">Reset Password</button>
|
||||||
name="password"
|
</form>
|
||||||
wire:model.live="form.password"
|
</x-ui.card>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</x-layouts.auth>
|
||||||
<div class="flex flex-col">
|
|
||||||
<label class="py-5" for="password_confirmation">Confirm Password</label>
|
|
||||||
<input
|
|
||||||
class="bg-white"
|
|
||||||
type="password"
|
|
||||||
name="password_confirmation"
|
|
||||||
wire:model.live="form.password_confirmation"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<button type="submit">Submit</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue