Skip to content

Commit

Permalink
responsive grid / clean up gif
Browse files Browse the repository at this point in the history
  • Loading branch information
giannif committed Jan 27, 2025
1 parent 6066b1c commit da2907c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/react-components/src/components/gif.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const Gif = ({
? `url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4AQMAAACSSKldAAAABlBMVEUhIiIWFhYoSqvJAAAAGElEQVQY02MAAv7///8PWxqIPwDZw5UGABtgwz2xhFKxAAAAAElFTkSuQmCC') 0 0`
: defaultBgColor.current)

// the background will peek through when subpixel rendering
// the background will peek through when subpixel rendering, remove it after the gif loads
if (loadedClassname === Gif.imgLoadedClassName && !gif.is_sticker) {
background = 'unset'
}
Expand All @@ -276,7 +276,6 @@ const Gif = ({
height: percentHeight || height,
overflow,
borderRadius,
aspectRatio: gif.images.original.width / gif.images.original.height,
...style,
}}
className={[Gif.className, className].join(' ')}
Expand All @@ -299,7 +298,7 @@ const Gif = ({
suppressHydrationWarning
className={[Gif.imgClassName, loadedClassname].join(' ')}
src={shouldShowMedia ? rendition.url : placeholder}
style={{ background, aspectRatio: gif.images.original.width / gif.images.original.height }}
style={{ background }}
width="100%"
height="100%"
alt={getAltText(gif)}
Expand Down

0 comments on commit da2907c

Please sign in to comment.