diff --git a/src/app/molecules/media/Media.jsx b/src/app/molecules/media/Media.jsx index 919d7f96..c4b4a171 100644 --- a/src/app/molecules/media/Media.jsx +++ b/src/app/molecules/media/Media.jsx @@ -69,9 +69,8 @@ async function getUrl(link, type, decryptData) { } } -function getNativeHeight(width, height) { - const MEDIA_MAX_WIDTH = 296; - const scale = MEDIA_MAX_WIDTH / width; +function getNativeHeight(width, height, maxWidth = 296) { + const scale = maxWidth / width; return scale * height; } @@ -197,7 +196,7 @@ Image.propTypes = { }; function Sticker({ - name, link, file, type, + name, height, width, link, file, type, }) { const [url, setUrl] = useState(null); @@ -215,8 +214,8 @@ function Sticker({ }, []); return ( -