Initial commit

This commit is contained in:
Sebastian Korotkiewicz 2024-05-28 08:08:42 +02:00
commit b344a74a72
Signed by: skorotkiewicz
GPG key ID: 5BDC557B496BDB0D
45 changed files with 1232 additions and 0 deletions

13
components/Link.tsx Normal file
View file

@ -0,0 +1,13 @@
import React from "react";
import { usePageContext } from "vike-react/usePageContext";
export function Link({ href, children }: { href: string; children: string }) {
const pageContext = usePageContext();
const { urlPathname } = pageContext;
const isActive = href === "/" ? urlPathname === href : urlPathname.startsWith(href);
return (
<a href={href} className={isActive ? "is-active" : undefined}>
{children}
</a>
);
}