mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-10-10 15:45:43 -04:00
more caching and error handling
This commit is contained in:
18 files changed
+335
-327
No files matched your search
@@ -12,6 +12,7 @@ const Image = ({ src, height, width, placeholder, className, ...rest }: ImagePro
|
||||
const constrainWidth = (width?: number | `${number}`) => {
|
||||
if (!width) return MAX_WIDTH;
|
||||
|
||||
// ensure that the image width is not greater than the global maximum width
|
||||
return Math.min(typeof width === "string" ? parseInt(width, 10) : width, MAX_WIDTH);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user