Skip to content

Commit

Permalink
Merge pull request #14645 from filamentphp/fix-header-padding-for-mod…
Browse files Browse the repository at this point in the history
…al-without-footer

Fix header padding for modal without footer
  • Loading branch information
danharrin authored Oct 28, 2024
2 parents 9af0c9a + 57e9cc8 commit 600908c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@

@php
$hasDescription = filled($description);
$hasFooter = (! \Filament\Support\is_slot_empty($footer)) || (is_array($footerActions) && count($footerActions)) || (! is_array($footerActions) && (! \Filament\Support\is_slot_empty($footerActions)));
$hasHeading = filled($heading);
$hasIcon = filled($icon);
$hasSlot = ! \Filament\Support\is_slot_empty($slot);
if (! $alignment instanceof Alignment) {
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
Expand Down Expand Up @@ -212,6 +214,7 @@
<div
@class([
'fi-modal-header flex px-6 pt-6',
'pb-6' => (! $hasSlot) && (! $hasFooter),
'fi-sticky sticky top-0 z-10 border-b border-gray-200 bg-white pb-6 dark:border-white/10 dark:bg-gray-900' => $stickyHeader,
'rounded-t-xl' => $stickyHeader && ! ($slideOver || ($width === MaxWidth::Screen)),
match ($alignment) {
Expand Down Expand Up @@ -310,7 +313,7 @@ class="mt-2"
</div>
@endif

@if (! \Filament\Support\is_slot_empty($slot))
@if ($hasSlot)
<div
@class([
'fi-modal-content flex flex-col gap-y-4 py-6',
Expand All @@ -323,7 +326,7 @@ class="mt-2"
</div>
@endif

@if ((! \Filament\Support\is_slot_empty($footer)) || (is_array($footerActions) && count($footerActions)) || (! is_array($footerActions) && (! \Filament\Support\is_slot_empty($footerActions))))
@if ($hasFooter)
<div
@class([
'fi-modal-footer w-full',
Expand All @@ -332,7 +335,7 @@ class="mt-2"
'fi-sticky sticky bottom-0 border-t border-gray-200 bg-white py-5 dark:border-white/10 dark:bg-gray-900' => $stickyFooter,
'rounded-b-xl' => $stickyFooter && ! ($slideOver || ($width === MaxWidth::Screen)),
'pb-6' => ! $stickyFooter,
'mt-6' => (! $stickyFooter) && \Filament\Support\is_slot_empty($slot),
'mt-6' => (! $stickyFooter) && (! $hasSlot),
'mt-auto' => $slideOver,
])
>
Expand Down

0 comments on commit 600908c

Please sign in to comment.