1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-04-17 10:28:46 -04:00

all components should accept additional classnames

This commit is contained in:
2022-01-20 12:06:05 -05:00
parent 2162e9d563
commit 7e37adabc1
22 changed files with 150 additions and 86 deletions

View File

@@ -1,11 +1,12 @@
import NextImage from "next/image";
import classNames from "classnames";
import type { ImageProps as NextImageProps } from "next/image";
import styles from "./Image.module.css";
const Image = ({ src, width, height, alt, quality, priority }: NextImageProps) => {
const Image = ({ src, width, height, alt, quality, priority, className, ...rest }: NextImageProps) => {
return (
<div className={styles.wrapper}>
<div className={classNames(styles.wrapper, className)}>
<NextImage
src={(src as string).replace(/^\/public/g, "")}
layout="intrinsic"
@@ -15,6 +16,7 @@ const Image = ({ src, width, height, alt, quality, priority }: NextImageProps) =
quality={quality || 65}
loading={priority ? "eager" : "lazy"}
priority={!!priority}
{...rest}
/>
</div>
);