1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-21 01:01: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,9 +1,9 @@
import Link from "../Link";
import { LinkIcon } from "../Icons";
import { styled } from "../../lib/styles/stitches.config";
import type { ComponentProps } from "react";
const AnchorLink = styled("a", {
textDecoration: "none",
const AnchorLink = styled(Link, {
lineHeight: 1,
});
@@ -12,14 +12,14 @@ const Icon = styled(LinkIcon, {
height: "0.8em",
});
export type HeadingAnchorProps = ComponentProps<typeof AnchorLink> & {
export type HeadingAnchorProps = Omit<ComponentProps<typeof AnchorLink>, "href"> & {
id: string;
title: string;
};
const HeadingAnchor = ({ id, title, ...rest }: HeadingAnchorProps) => {
return (
<AnchorLink href={`#${id}`} title={`Jump to "${title}"`} aria-hidden={true} {...rest}>
<AnchorLink href={`#${id}`} title={`Jump to "${title}"`} aria-hidden={true} underline={false} {...rest}>
<Icon />
</AnchorLink>
);