1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 22:06:38 -04:00

consolidate theme context/provider types

This commit is contained in:
2022-04-08 12:36:19 -04:00
parent a8c1a3ba3c
commit d09cf7ab26
6 changed files with 56 additions and 64 deletions

View File

@ -1,8 +1,6 @@
import { useRouter } from "next/router";
import NextLink from "next/link";
import urlJoin from "url-join";
import { styled } from "../../lib/styles/stitches.config";
import { baseUrl } from "../../lib/config";
import type { ComponentProps } from "react";
const Title = styled("h1", {
@ -25,11 +23,10 @@ export type PageTitleProps = ComponentProps<typeof Title>;
const PageTitle = ({ children, ...rest }: PageTitleProps) => {
const router = useRouter();
const canonical = urlJoin(baseUrl, router.pathname, "/");
return (
<Title {...rest}>
<NextLink href={canonical} passHref={true}>
<NextLink href={router.pathname} passHref={true}>
<Link>{children}</Link>
</NextLink>
</Title>