refactor: migrate components to Preact

This commit is contained in:
Stefan Imhoff
2023-04-04 17:40:19 +02:00
parent a15c4ef149
commit 208b9d9418
21 changed files with 219 additions and 115 deletions

View File

@@ -1,7 +1,9 @@
---
import cx from 'classnames';
import data from '../data/subnavigation.json';
import Link from './Link.astro';
import { Link } from '.';
const currentPath = new URL(Astro.request.url).pathname;
---
@@ -13,9 +15,10 @@ const currentPath = new URL(Astro.request.url).pathname;
<li>
<Link
href={url}
class={`font-light decoration-4 underline-offset-auto hover:underline hover:decoration-shibui-900/20 dark:hover:decoration-shibui-100/20 ${
currentPath === url && 'underline !decoration-accent decoration-4'
}`}
class={cx(
'font-light decoration-4 underline-offset-auto hover:underline hover:decoration-shibui-900/20 dark:hover:decoration-shibui-100/20',
{ 'underline !decoration-accent decoration-4': currentPath === url }
)}
>
{title}
</Link>