1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-12-05 14:18:58 -05:00

CSS modules ➡️ Stitches 🧵 (#799)

This commit is contained in:
2022-03-03 09:18:26 -05:00
committed by GitHub
parent ac7ac71c10
commit c2dde042b7
93 changed files with 2392 additions and 3000 deletions

View File

@@ -1,16 +1,32 @@
import classNames from "classnames";
import { OctocatOcticon } from "../Icons";
import { styled } from "../../lib/styles/stitches.config";
import type { ComponentProps } from "react";
import styles from "./OctocatLink.module.css";
const Link = styled("a", {
margin: "0 0.4em",
color: "$text",
textDecoration: "none",
export type OctocatLinkProps = JSX.IntrinsicElements["a"] & {
"&:hover": {
color: "$link",
},
});
const Octocat = styled(OctocatOcticon, {
width: "1.2em",
height: "1.2em",
verticalAlign: "-0.2em",
fill: "currentColor",
});
export type OctocatLinkProps = ComponentProps<typeof Link> & {
repo: string;
};
const OctocatLink = ({ repo, className, ...rest }: OctocatLinkProps) => (
<a className={styles.link} href={`https://github.com/${repo}`} target="_blank" rel="noopener noreferrer" {...rest}>
<OctocatOcticon fill="currentColor" className={classNames(styles.icon, className)} />
</a>
<Link href={`https://github.com/${repo}`} target="_blank" rel="noopener noreferrer" {...rest}>
<Octocat className={className} />
</Link>
);
export default OctocatLink;