dark mode

This commit is contained in:
2023-03-04 19:17:30 +00:00
parent f17436ec01
commit 62b4d68dfa
6 changed files with 161 additions and 137 deletions
+13 -3
View File
@@ -1,9 +1,12 @@
---
import UserIcon from './icons/UserIcon.astro'
import Website from './icons/Website.astro'
const { pathname } = Astro.url
const navLinks = [
{ label: 'Blog', icon: 'website-with-texticonImage24px', path: '/' },
{ label: 'About', icon: 'usericonImage24px', path: '/about/' },
{ label: 'Blog', path: '/' },
{ label: 'About', path: '/about/' },
]
---
@@ -18,7 +21,14 @@ const navLinks = [
class={pathname === link.path ? 'active-nav' : null}
href={link.path}
>
<img src={`/media/icons/${link.icon}.svg`} />
{() => {
switch (link.label) {
case 'Blog':
return <Website />
case 'About':
return <UserIcon />
}
}}
<span>{link.label}</span>
</a>
</li>