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

bump next to 13.5

This commit is contained in:
2023-10-02 11:59:15 -04:00
parent 1d8c2eab99
commit 893db7e951
24 changed files with 707 additions and 2528 deletions

View File

@@ -1,27 +1,17 @@
import Link from "../Link";
import { LinkIcon } from "../Icons";
import { styled } from "../../lib/styles/stitches.config";
import { FiLink } from "react-icons/fi";
import type { ComponentPropsWithoutRef } from "react";
const AnchorLink = styled(Link, {
lineHeight: 1,
});
const Icon = styled(LinkIcon, {
width: "0.8em",
height: "0.8em",
});
export type HeadingAnchorProps = Omit<ComponentPropsWithoutRef<typeof AnchorLink>, "href"> & {
export type HeadingAnchorProps = Omit<ComponentPropsWithoutRef<typeof Link>, "href"> & {
id: string;
title: string;
};
const HeadingAnchor = ({ id, title, ...rest }: HeadingAnchorProps) => {
return (
<AnchorLink href={`#${id}`} title={`Jump to "${title}"`} aria-hidden underline={false} {...rest}>
<Icon />
</AnchorLink>
<Link href={`#${id}`} title={`Jump to "${title}"`} aria-hidden underline={false} css={{ lineHeight: 1 }} {...rest}>
<FiLink size="0.8em" />
</Link>
);
};