fix: image safe number
This commit is contained in:
parent
92f04875e7
commit
a9c44cdf83
|
|
@ -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
|
||||
<img
|
||||
|
|
|
|||
Loading…
Reference in New Issue