update before work
This commit is contained in:
parent
6917b0c1bd
commit
bced6944f6
3 changed files with 46 additions and 29 deletions
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
interface Props {
|
||||
links: { href: string, text: string }[];
|
||||
links: { href: string; text: string }[];
|
||||
}
|
||||
|
||||
const { links } = Astro.props;
|
||||
|
|
@ -8,11 +8,22 @@ const { links } = Astro.props;
|
|||
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<ul class="list-unstyle hstack">
|
||||
{links.map(link =>(
|
||||
<li class="nav-item">
|
||||
<a class:list={"nav-link", { active: Astro.url.pathname === link.href}} href={link.href}>{link.text}</a>
|
||||
</li>
|
||||
))}
|
||||
{
|
||||
links.map((link) => (
|
||||
<li class="nav-item">
|
||||
{/* TODO: active logic doesnt work in prod because is compiled --> */}
|
||||
<a
|
||||
class:list={[
|
||||
'nav-link',
|
||||
{ active: Astro.url.pathname === link.href },
|
||||
]}
|
||||
href={link.href}
|
||||
>
|
||||
{link.text}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue