From 80356570dc8b2801c72ece7facb049649e250be8 Mon Sep 17 00:00:00 2001 From: lee-to Date: Fri, 4 Oct 2024 12:49:00 +0000 Subject: [PATCH] Fix styling --- src/Laravel/src/Pages/Crud/IndexPage.php | 10 ++++++---- src/UI/src/Components/Modal.php | 4 ++-- src/UI/src/Components/OffCanvas.php | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Laravel/src/Pages/Crud/IndexPage.php b/src/Laravel/src/Pages/Crud/IndexPage.php index 48487f020..bac97e0dd 100644 --- a/src/Laravel/src/Pages/Crud/IndexPage.php +++ b/src/Laravel/src/Pages/Crud/IndexPage.php @@ -86,21 +86,23 @@ protected function bottomLayer(): array { $pageComponents = $this->getResource()->getIndexPageComponents(); - if($this->getResource()->isEditInModal()) { + if ($this->getResource()->isEditInModal()) { $pageComponents[] = Modal::make( __('moonshine::ui.edit'), components: [ Div::make()->customAttributes(['id' => 'resource-edit-modal']), - ]) + ] + ) ->name('resource-edit-modal'); } - if($this->getResource()->isDetailInModal()) { + if ($this->getResource()->isDetailInModal()) { $pageComponents[] = Modal::make( __('moonshine::ui.show'), components: [ Div::make()->customAttributes(['id' => 'resource-detail-modal']), - ]) + ] + ) ->name('resource-detail-modal'); } diff --git a/src/UI/src/Components/Modal.php b/src/UI/src/Components/Modal.php index 9faaac46d..e4765a55a 100644 --- a/src/UI/src/Components/Modal.php +++ b/src/UI/src/Components/Modal.php @@ -97,11 +97,11 @@ public function toggleEvents(array $events, bool $onlyOpening = false, $onlyClos 'data-closing-events' => AlpineJs::prepareEvents($events), ]; - if($onlyOpening) { + if ($onlyOpening) { unset($data['data-closing-events']); } - if($onlyClosing) { + if ($onlyClosing) { unset($data['data-opening-events']); } diff --git a/src/UI/src/Components/OffCanvas.php b/src/UI/src/Components/OffCanvas.php index 500b62c99..23c9ea49d 100644 --- a/src/UI/src/Components/OffCanvas.php +++ b/src/UI/src/Components/OffCanvas.php @@ -67,11 +67,11 @@ public function toggleEvents(array $events, bool $onlyOpening = false, $onlyClos 'data-closing-events' => AlpineJs::prepareEvents($events), ]; - if($onlyOpening) { + if ($onlyOpening) { unset($data['data-closing-events']); } - if($onlyClosing) { + if ($onlyClosing) { unset($data['data-opening-events']); }