diff --git a/src/components/ui/Image.tsx b/src/components/ui/Image.tsx index 10ad062f..ee24bb6f 100644 --- a/src/components/ui/Image.tsx +++ b/src/components/ui/Image.tsx @@ -16,7 +16,6 @@ export const Image: React.FC< src = toIPFS(src) const [paddingTop, setPaddingTop] = React.useState("0") const [autoWidth, setAutoWidth] = React.useState(0) - const autoSize = !width && !height && !fill const noOptimization = className?.includes("no-optimization") if (!src.startsWith("/assets/")) { @@ -27,6 +26,17 @@ export const Image: React.FC< } } + if (!noOptimization) { + if (width) { + width = +width + } + if (height) { + height = +height + } + } + + const autoSize = !width && !height && !fill + return noOptimization ? ( // eslint-disable-next-line @next/next/no-img-element