1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 06:21:17 -04:00

enable experimental next/future/image (#973)

This commit is contained in:
2022-06-27 20:45:02 -04:00
committed by GitHub
parent a4602335a1
commit f826f59fcc
14 changed files with 183 additions and 184 deletions

View File

@@ -1,4 +1,4 @@
import NextLink from "next/link";
import Link from "../Link";
import { styled } from "../../lib/styles/stitches.config";
import type { ComponentProps } from "react";
import type { NoteFrontMatter } from "../../types";
@@ -18,9 +18,8 @@ const Title = styled("h1", {
},
});
const Link = styled(NextLink, {
const TitleLink = styled(Link, {
color: "$text",
textDecoration: "none",
});
export type NoteTitleProps = Pick<NoteFrontMatter, "slug" | "title" | "htmlTitle"> & ComponentProps<typeof Title>;
@@ -28,12 +27,13 @@ export type NoteTitleProps = Pick<NoteFrontMatter, "slug" | "title" | "htmlTitle
const NoteTitle = ({ slug, title, htmlTitle, ...rest }: NoteTitleProps) => {
return (
<Title {...rest}>
<Link
<TitleLink
href={{
pathname: "/notes/[slug]/",
query: { slug },
}}
dangerouslySetInnerHTML={{ __html: htmlTitle || title }}
underline={false}
/>
</Title>
);