Skip to content

Commit 31ad3e5

Browse files
committed
fix: prevent footer layout issues when sidebar is collapsed
1 parent 6349f33 commit 31ad3e5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

resources/views/easy-footer.blade.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22
use Filament\Support\Enums\Width;
33
@endphp
44
<footer
5+
x-data="{ sidebarCollapsed: false }"
6+
x-init="
7+
sidebarCollapsed = $store.sidebar?.isOpen === false;
8+
$watch('$store.sidebar.isOpen', value => {
9+
sidebarCollapsed = value === false;
10+
});
11+
"
12+
x-show="!(sidebarCollapsed && @js($footerPosition === 'sidebar.footer' || $footerPosition === 'sidebar'))"
13+
x-transition
514
@class([
615
'fi-footer my-3 flex flex-wrap items-center justify-center text-sm text-gray-500 dark:text-gray-400',
716
'border-t border-gray-200 dark:border-gray-700 text-center p-2' => $footerPosition === 'sidebar' || $footerPosition === 'sidebar.footer' || $borderTopEnabled === true,
8-
'fi-sidebar gap-2 h-auto' => $footerPosition === 'sidebar' || $footerPosition === 'sidebar.footer',
17+
'fi-sidebar h-fit gap-2 h-auto' => $footerPosition === 'sidebar' || $footerPosition === 'sidebar.footer',
918
'gap-4' => $footerPosition !== 'sidebar' && $footerPosition !== 'sidebar.footer',
1019
'mx-auto w-full px-4 md:px-6 lg:px-8' => $footerPosition === 'footer',
1120
match ($maxContentWidth ??= (filament()->getMaxContentWidth() ?? Width::SevenExtraLarge)) {
@@ -34,7 +43,10 @@
3443
} => $footerPosition === 'footer',
3544
])
3645
>
37-
<span @class(['flex items-center gap-2' => $isHtmlSentence])>&copy; {{ now()->format('Y') }} -
46+
<span @class([
47+
'flex items-center gap-2' => $isHtmlSentence,
48+
'w-full' => $footerPosition === 'sidebar' || $footerPosition === 'sidebar.footer'
49+
])>&copy; {{ now()->format('Y') }} -
3850
@if($sentence)
3951
@if($isHtmlSentence)
4052
<span class="flex items-center gap-2">{!! $sentence !!}</span>

0 commit comments

Comments
 (0)