Skip to content

Commit

Permalink
don't ignore forced height
Browse files Browse the repository at this point in the history
  • Loading branch information
giannif committed Jan 28, 2025
1 parent 2dfc0f2 commit 6e53f03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/react-components/src/components/gif.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,17 @@ const Gif = ({
if (hoverTimeout.current) clearTimeout(hoverTimeout.current)
}
}, [])
let height: number | undefined = forcedHeight || getGifHeight(gif, width)
const useAspect = !!style?.aspectRatio
let height: number | undefined = forcedHeight || getGifHeight(gif, width)
let percentHeight: string | undefined
if (percentWidth && !useAspect) {
const ratio = Math.round((height / width) * 100)
percentHeight = `${ratio}%`
}
const bestRendition = getBestRendition(gif.images, width, height)
if (useAspect) {
height = undefined
// this could be undefined, and that's ok because aspect ratio
height = forcedHeight
}
if (!bestRendition) {
if (gif.images) {
Expand Down
1 change: 0 additions & 1 deletion packages/react-components/src/components/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ type Props = {
noResultsMessage?: string | JSX.Element
initialGifs?: IGif[]
externalGifs?: IGif[]
useTransform?: boolean
columnOffsets?: number[]
backgroundColor?: string
borderRadius?: number
Expand Down

0 comments on commit 6e53f03

Please sign in to comment.