Refactor: Improve NavBar class list syntax

This commit is contained in:
Vrezh Fedora 2025-06-22 13:57:13 +02:00
parent 6203e8a573
commit 3ee3300f5c
No known key found for this signature in database
GPG key ID: 4F9848118BFDF1F9

View file

@ -96,31 +96,29 @@ const {
</DropdownItems> </DropdownItems>
</Dropdown> </Dropdown>
<a <a
class:list={{ class:list={[
hidden: true, 'hidden',
'items-center': true, 'items-center',
'hover:bg-muted': true, 'hover:bg-muted',
'rounded-lg': true, 'rounded-lg',
'p-3': true, 'p-3',
'lg:block': true, 'lg:block',
'text-coral': Astro.url.pathname === getLocalePath('/about'), { 'text-coral': Astro.url.pathname === getLocalePath('/about') },
}} ]}
data-active={Astro.url.pathname === getLocalePath('/about')}
href={getLocalePath('/about')} href={getLocalePath('/about')}
> >
<span>{menu.aboutUs}</span> <span>{menu.aboutUs}</span>
</a> </a>
<a <a
class:list={{ class:list={[
hidden: true, 'hidden',
'items-center': true, 'items-center',
'hover:bg-muted': true, 'hover:bg-muted',
'rounded-lg': true, 'rounded-lg',
'p-3': true, 'p-3',
'lg:block': true, 'lg:block',
'text-coral': Astro.url.pathname === getLocalePath('/mods'), { 'text-coral': Astro.url.pathname === getLocalePath('/mods') },
}} ]}
data-active={Astro.url.pathname === getLocalePath('/mods')}
href={getLocalePath('/mods')} href={getLocalePath('/mods')}
> >
<span>{menu.mods}</span> <span>{menu.mods}</span>