fix: preview media width

This commit is contained in:
Stephen Zhou
2024-10-22 15:07:30 +08:00
parent e6491e512b
commit 39dd59b062
@@ -304,7 +304,10 @@ const FallbackableImage: FC<
className={cn("relative", width < height && "h-full")}
style={{
// px-20 pb-8 pt-10
width: width > height ? (windowHeight - 32 - 40) * (width / height) : undefined,
width:
width && height && width > height
? Math.min((windowHeight - 32 - 40) * (width / height), width)
: undefined,
maxWidth: width > height ? windowWidth - 80 - 80 - 400 : undefined,
}}
>