From 32ba98e2377c4dee6819599a1f3d2807d30ac540 Mon Sep 17 00:00:00 2001 From: Zep Fietje Date: Thu, 28 Nov 2024 08:09:21 +0100 Subject: [PATCH] Rename maxSimplePageContentWidth to simplePageMaxContentWidth --- packages/panels/docs/09-configuration.md | 4 ++-- .../resources/views/components/layout/simple.blade.php | 2 +- packages/panels/src/FilamentManager.php | 4 ++-- .../panels/src/Panel/Concerns/HasMaxContentWidth.php | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/panels/docs/09-configuration.md b/packages/panels/docs/09-configuration.md index c552351020..d7d2ec67b6 100644 --- a/packages/panels/docs/09-configuration.md +++ b/packages/panels/docs/09-configuration.md @@ -115,7 +115,7 @@ public function panel(Panel $panel): Panel } ``` -If you'd like to set the max content width for pages of the type `SimplePage`, like login and registration pages, you may do so using the `maxSimplePageContentWidth()` method. The default is `Large`: +If you'd like to set the max content width for pages of the type `SimplePage`, like login and registration pages, you may do so using the `simplePageMaxContentWidth()` method. The default is `Large`: ```php use Filament\Panel; @@ -125,7 +125,7 @@ public function panel(Panel $panel): Panel { return $panel // ... - ->maxSimplePageContentWidth(MaxWidth::Small); + ->simplePageMaxContentWidth(MaxWidth::Small); } ``` diff --git a/packages/panels/resources/views/components/layout/simple.blade.php b/packages/panels/resources/views/components/layout/simple.blade.php index fad751857f..34895433e4 100644 --- a/packages/panels/resources/views/components/layout/simple.blade.php +++ b/packages/panels/resources/views/components/layout/simple.blade.php @@ -30,7 +30,7 @@ class="fi-simple-main-ctn flex w-full flex-grow items-center justify-center"
getMaxSimplePageContentWidth() ?? MaxWidth::Large)) { + match ($maxWidth ??= (filament()->getSimplePageMaxContentWidth() ?? MaxWidth::Large)) { MaxWidth::ExtraSmall, 'xs' => 'max-w-xs', MaxWidth::Small, 'sm' => 'max-w-sm', MaxWidth::Medium, 'md' => 'max-w-md', diff --git a/packages/panels/src/FilamentManager.php b/packages/panels/src/FilamentManager.php index 142fff8d8e..0065644098 100644 --- a/packages/panels/src/FilamentManager.php +++ b/packages/panels/src/FilamentManager.php @@ -225,9 +225,9 @@ public function getMaxContentWidth(): MaxWidth | string | null return $this->getCurrentPanel()->getMaxContentWidth(); } - public function getMaxSimplePageContentWidth(): MaxWidth | string | null + public function getSimplePageMaxContentWidth(): MaxWidth | string | null { - return $this->getCurrentPanel()->getMaxSimplePageContentWidth(); + return $this->getCurrentPanel()->getSimplePageMaxContentWidth(); } public function getModelResource(string | Model $model): ?string diff --git a/packages/panels/src/Panel/Concerns/HasMaxContentWidth.php b/packages/panels/src/Panel/Concerns/HasMaxContentWidth.php index 7b9e10b404..44837ac5d4 100644 --- a/packages/panels/src/Panel/Concerns/HasMaxContentWidth.php +++ b/packages/panels/src/Panel/Concerns/HasMaxContentWidth.php @@ -8,7 +8,7 @@ trait HasMaxContentWidth { protected MaxWidth | string | null $maxContentWidth = null; - protected MaxWidth | string | null $maxSimplePageContentWidth = null; + protected MaxWidth | string | null $simplePageMaxContentWidth = null; public function maxContentWidth(MaxWidth | string | null $maxContentWidth): static { @@ -22,15 +22,15 @@ public function getMaxContentWidth(): MaxWidth | string | null return $this->maxContentWidth; } - public function maxSimplePageContentWidth(MaxWidth | string | null $width): static + public function simplePageMaxContentWidth(MaxWidth | string | null $width): static { - $this->maxSimplePageContentWidth = $width; + $this->simplePageMaxContentWidth = $width; return $this; } - public function getMaxSimplePageContentWidth(): MaxWidth | string | null + public function getSimplePageMaxContentWidth(): MaxWidth | string | null { - return $this->maxSimplePageContentWidth; + return $this->simplePageMaxContentWidth; } }