From 64506a85fe45ffe5d70699054e4c46ad0a29197c Mon Sep 17 00:00:00 2001 From: MarJose123 <18107626+MarJose123@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:37:43 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(filament-lockscreen):=20Implem?= =?UTF-8?q?ent=20UI=20changes=20to=20the=20lockscreen=20and=20fix=20duplic?= =?UTF-8?q?ate=20html=20tags=20in=20login=20pages.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/page/auth/login.blade.php | 69 ++++++++++------------- src/Http/Livewire/LockerScreen.php | 13 +++-- 2 files changed, 37 insertions(+), 45 deletions(-) diff --git a/resources/views/page/auth/login.blade.php b/resources/views/page/auth/login.blade.php index c922f5b..0bb51f4 100644 --- a/resources/views/page/auth/login.blade.php +++ b/resources/views/page/auth/login.blade.php @@ -1,52 +1,43 @@
- + @props([ 'after' => null, 'heading' => null, 'subheading' => null, ]) -
-
-
- {{--Slot --}} -
- avatar -
-
-
-
{{\Filament\Facades\Filament::auth()->user()?->name ?? ''}}
-
-
+
+ {{--Slot --}} +
+ avatar +
+
+
+
{{\Filament\Facades\Filament::auth()->user()?->name ?? ''}}
+
+
- - {{ $this->form }} + + {{ $this->form }} - - - + + + -
-
-
-
+ +
diff --git a/src/Http/Livewire/LockerScreen.php b/src/Http/Livewire/LockerScreen.php index 18dedec..23ad58e 100644 --- a/src/Http/Livewire/LockerScreen.php +++ b/src/Http/Livewire/LockerScreen.php @@ -5,20 +5,22 @@ use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException; use DanHarrin\LivewireRateLimiting\WithRateLimiting; use Filament\Actions\Action; +use Filament\Actions\ActionGroup; use Filament\Exceptions\NoDefaultPanelSetException; use Filament\Facades\Filament; use Filament\Forms\Components\TextInput; use Filament\Notifications\Notification; -use Filament\Pages\Actions\ActionGroup; -use Filament\Pages\BasePage; use Filament\Pages\Concerns\InteractsWithFormActions; +use Filament\Pages\SimplePage; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; -class LockerScreen extends BasePage +class LockerScreen extends SimplePage { use InteractsWithFormActions, WithRateLimiting; + protected bool $hasTopbar = false; + protected static ?string $title = null; protected ?string $maxContentWidth = 'full'; @@ -43,7 +45,6 @@ public function mount() // Check if the request is still authenticated or not before rendering the page, // if not authenticated then redirect to the login page of current panel, or default panel if current panel could not be detected. - if (! Filament::auth()->check()) { if (filament()->getCurrentPanel()) { return redirect(filament()->getCurrentPanel()->getLoginUrl()); @@ -53,8 +54,8 @@ public function mount() } // redirect to the filament default home url if session is not locked - if (!session()->has('lockscreen')) { - return redirect(session()->has('next') ? session('next') : filament()->getDefaultPanel()->getPath()); + if (! session()->has('lockscreen')) { + return redirect(session()->has('next') ? session('next') : filament()->getDefaultPanel()->getPath()); } if (! config('filament-lockscreen.enable_redirect_to')) {