1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-05-15 21:34:26 -04:00

Migrate to app router (#2254)

This commit is contained in:
2025-02-07 11:33:38 -05:00
committed by GitHub
parent e97613dda5
commit 8aabb4a66f
179 changed files with 4095 additions and 4951 deletions
+5 -15
View File
@@ -1,19 +1,9 @@
import innerText from "react-innertext";
import clsx from "clsx";
import Image from "../Image";
import { styled, theme } from "../../lib/styles/stitches.config";
import type { PropsWithChildren, ComponentPropsWithoutRef } from "react";
const Wrapper = styled("figure", {
margin: "1em auto",
textAlign: "center",
});
const Caption = styled("figcaption", {
fontSize: "0.9em",
lineHeight: 1.5,
color: theme.colors.medium,
marginTop: "-0.4em",
});
import styles from "./Figure.module.css";
export type FigureProps = Omit<ComponentPropsWithoutRef<typeof Image>, "alt"> &
PropsWithChildren<{
@@ -22,10 +12,10 @@ export type FigureProps = Omit<ComponentPropsWithoutRef<typeof Image>, "alt"> &
const Figure = ({ children, alt, className, ...imageProps }: FigureProps) => {
return (
<Wrapper className={className}>
<figure className={clsx(styles.figure, className)}>
<Image alt={alt || innerText(children)} {...imageProps} />
<Caption>{children}</Caption>
</Wrapper>
<figcaption className={styles.caption}>{children}</figcaption>
</figure>
);
};