diff --git a/src/components/Nav.tsx b/src/components/Nav.tsx index cae2275..1a37203 100644 --- a/src/components/Nav.tsx +++ b/src/components/Nav.tsx @@ -1,11 +1,11 @@ -import { For, onMount } from "solid-js"; +import { For, onMount, type Component } from "solid-js"; import { useStore } from "@nanostores/solid"; import { $currentPage } from "@/scripts/currentPage" -interface Page { +type Page = { path: string, name: string, -} +}; const pages: Page[] = [ { path: "/", name: "about" }, @@ -17,7 +17,7 @@ const inactiveClasses = "text-xl text-fg_light transition-all duration-300 hover const activeClasses = "font-bold !text-foreground"; -const Nav = () => { +const Nav: Component = () => { const currentPage = useStore($currentPage); onMount(() => { diff --git a/src/components/PageLink.tsx b/src/components/PageLink.tsx index f8babfb..f04bd6c 100644 --- a/src/components/PageLink.tsx +++ b/src/components/PageLink.tsx @@ -1,13 +1,12 @@ import { $currentPage } from "@/scripts/currentPage" -import type { ParentComponent } from "solid-js"; +import type { ComponentProps, ParentComponent } from "solid-js"; import { splitProps } from "solid-js"; -interface Props { +type RequireProps = { href: string, - class?: string, -} +}; -const PageLink: ParentComponent = (props) => { +const PageLink: ParentComponent & RequireProps> = (props) => { const [local, others] = splitProps(props, ["children"]); return ( $currentPage.set(others.href)}>