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:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user