Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

improve zoom image

Steven Tey8a751907554d
diff --git a/app/ui/content/zoom-image.tsx b/app/ui/content/zoom-image.tsx
index a41cd3c600..7ba195f404 100644
--- a/app/ui/content/zoom-image.tsx
+++ b/app/ui/content/zoom-image.tsx
@@ -9,10 +9,17 @@ import "react-medium-image-zoom/dist/styles.css";
export default function ZoomImage(
props: ImageProps & { blurDataURL?: string },
) {
- const { isDesktop } = useMediaQuery();
+ const { width, height, isDesktop } = useMediaQuery();
return (
<figure className="not-prose flex flex-col items-center justify-center space-y-3">
- <Zoom zoomMargin={isDesktop ? 45 : undefined}>
+ <Zoom
+ zoomMargin={isDesktop ? 45 : undefined}
+ zoomImg={{
+ src: props.src as string,
+ alt: props.alt,
+ ...(width && height ? { width, height } : {}),
+ }}
+ >
<BlurImage
{...props}
className="rounded-lg border border-gray-200"