From 8e4523f3db028a87f4e11e6ab26a4bc053bfaa26 Mon Sep 17 00:00:00 2001 From: Boy132 Date: Fri, 6 Dec 2024 09:25:30 +0100 Subject: [PATCH] add config value for display width to other pages --- app/Filament/Pages/Installer/PanelInstaller.php | 2 +- app/Filament/Resources/UserResource/Pages/EditProfile.php | 5 +++-- app/Providers/Filament/ServerPanelProvider.php | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Filament/Pages/Installer/PanelInstaller.php b/app/Filament/Pages/Installer/PanelInstaller.php index 44b6ee58b6..0ae31c2dd9 100644 --- a/app/Filament/Pages/Installer/PanelInstaller.php +++ b/app/Filament/Pages/Installer/PanelInstaller.php @@ -42,7 +42,7 @@ class PanelInstaller extends SimplePage implements HasForms public function getMaxWidth(): MaxWidth|string { - return MaxWidth::SevenExtraLarge; + return config('panel.filament.display-width', 'screen-2xl'); } public static function isInstalled(): bool diff --git a/app/Filament/Resources/UserResource/Pages/EditProfile.php b/app/Filament/Resources/UserResource/Pages/EditProfile.php index 12cb6b448a..7c39f5c66c 100644 --- a/app/Filament/Resources/UserResource/Pages/EditProfile.php +++ b/app/Filament/Resources/UserResource/Pages/EditProfile.php @@ -29,6 +29,7 @@ use Filament\Forms\Components\TextInput; use Filament\Forms\Get; use Filament\Notifications\Notification; +use Filament\Pages\Auth\EditProfile as BaseEditProfile; use Filament\Support\Enums\MaxWidth; use Filament\Support\Exceptions\Halt; use Illuminate\Database\Eloquent\Builder; @@ -42,7 +43,7 @@ /** * @method User getUser() */ -class EditProfile extends \Filament\Pages\Auth\EditProfile +class EditProfile extends BaseEditProfile { private ToggleTwoFactorService $toggleTwoFactorService; @@ -53,7 +54,7 @@ public function boot(ToggleTwoFactorService $toggleTwoFactorService): void public function getMaxWidth(): MaxWidth|string { - return MaxWidth::SevenExtraLarge; + return config('panel.filament.display-width', 'screen-2xl'); } protected function getForms(): array diff --git a/app/Providers/Filament/ServerPanelProvider.php b/app/Providers/Filament/ServerPanelProvider.php index af815a89b3..6ebfe10bf7 100644 --- a/app/Providers/Filament/ServerPanelProvider.php +++ b/app/Providers/Filament/ServerPanelProvider.php @@ -16,7 +16,6 @@ use Filament\Navigation\NavigationItem; use Filament\Panel; use Filament\PanelProvider; -use Filament\Support\Enums\MaxWidth; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\EncryptCookies; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; @@ -40,7 +39,7 @@ public function panel(Panel $panel): Panel ->brandLogoHeight('2rem') ->favicon(config('app.favicon', '/pelican.ico')) ->topNavigation(config('panel.filament.top-navigation', true)) - ->maxContentWidth(MaxWidth::ScreenTwoExtraLarge) + ->maxContentWidth(config('panel.filament.display-width', 'screen-2xl')) ->login(Login::class) ->userMenuItems([ 'profile' => MenuItem::make()->label('Profile')->url(fn () => EditProfile::getUrl(panel: 'app')),