Add config value for display width to other pages (#770)

This commit is contained in:
Boy132 2024-12-06 09:45:06 +01:00 committed by GitHub
parent 066bdbdf78
commit b50acfdba2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ class PanelInstaller extends SimplePage implements HasForms
public function getMaxWidth(): MaxWidth|string public function getMaxWidth(): MaxWidth|string
{ {
return MaxWidth::SevenExtraLarge; return config('panel.filament.display-width', 'screen-2xl');
} }
public static function isInstalled(): bool public static function isInstalled(): bool

View File

@ -29,6 +29,7 @@ use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Forms\Get; use Filament\Forms\Get;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Filament\Pages\Auth\EditProfile as BaseEditProfile;
use Filament\Support\Enums\MaxWidth; use Filament\Support\Enums\MaxWidth;
use Filament\Support\Exceptions\Halt; use Filament\Support\Exceptions\Halt;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
@ -42,7 +43,7 @@ use Laravel\Socialite\Facades\Socialite;
/** /**
* @method User getUser() * @method User getUser()
*/ */
class EditProfile extends \Filament\Pages\Auth\EditProfile class EditProfile extends BaseEditProfile
{ {
private ToggleTwoFactorService $toggleTwoFactorService; private ToggleTwoFactorService $toggleTwoFactorService;
@ -53,7 +54,7 @@ class EditProfile extends \Filament\Pages\Auth\EditProfile
public function getMaxWidth(): MaxWidth|string public function getMaxWidth(): MaxWidth|string
{ {
return MaxWidth::SevenExtraLarge; return config('panel.filament.display-width', 'screen-2xl');
} }
protected function getForms(): array protected function getForms(): array

View File

@ -16,7 +16,6 @@ use Filament\Navigation\MenuItem;
use Filament\Navigation\NavigationItem; use Filament\Navigation\NavigationItem;
use Filament\Panel; use Filament\Panel;
use Filament\PanelProvider; use Filament\PanelProvider;
use Filament\Support\Enums\MaxWidth;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies; use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
@ -40,7 +39,7 @@ class ServerPanelProvider extends PanelProvider
->brandLogoHeight('2rem') ->brandLogoHeight('2rem')
->favicon(config('app.favicon', '/pelican.ico')) ->favicon(config('app.favicon', '/pelican.ico'))
->topNavigation(config('panel.filament.top-navigation', true)) ->topNavigation(config('panel.filament.top-navigation', true))
->maxContentWidth(MaxWidth::ScreenTwoExtraLarge) ->maxContentWidth(config('panel.filament.display-width', 'screen-2xl'))
->login(Login::class) ->login(Login::class)
->userMenuItems([ ->userMenuItems([
'profile' => MenuItem::make()->label('Profile')->url(fn () => EditProfile::getUrl(panel: 'app')), 'profile' => MenuItem::make()->label('Profile')->url(fn () => EditProfile::getUrl(panel: 'app')),