From 74a113ea20bd7582a6bedcbbe32d90053b273507 Mon Sep 17 00:00:00 2001 From: Nick Santaniello Date: Tue, 9 Apr 2024 13:17:27 -0700 Subject: [PATCH] Restored bottle_data to igif type --- packages/components/src/components/gif.tsx | 15 +++++++++++---- packages/types/src/gif.ts | 6 ++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/components/src/components/gif.tsx b/packages/components/src/components/gif.tsx index 020f9028..6876f28f 100644 --- a/packages/components/src/components/gif.tsx +++ b/packages/components/src/components/gif.tsx @@ -1,6 +1,13 @@ import { giphyBlue, giphyGreen, giphyPurple, giphyRed, giphyYellow } from '@giphy/js-brand' import { IGif, ImageAllTypes, IUser } from '@giphy/js-types' -import { getAltText, getBestRendition, getGifHeight, Logger, constructMoatData, injectTrackingPixel } from '@giphy/js-util' +import { + getAltText, + getBestRendition, + getGifHeight, + Logger, + constructMoatData, + injectTrackingPixel, +} from '@giphy/js-util' import moat from '@giphy/moat-loader' import { css, cx } from '@emotion/css' import { h } from 'preact' @@ -10,7 +17,7 @@ import AttributionOverlay from './attribution/overlay' import VerifiedBadge from './attribution/verified-badge' import { PingbackContext } from './pingback-context-manager' -const moatLoader = moat.loadMoatTag('giphydisplay879451385633') +const moatLoader = moat.loadMoatTag('giphydisplay879451385633', 'https://giphyscripts.s3.amazonaws.com/moat/moatad.js') const gifCss = css` display: block; &:focus { @@ -75,7 +82,7 @@ export type Props = GifProps & EventProps const placeholder = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' -const noop = () => { } +const noop = () => {} const Gif = ({ gif, @@ -281,7 +288,7 @@ const Gif = ({ width={width} height={height} alt={getAltText(gif)} - onLoad={shouldShowMedia ? onImageLoad : () => { }} + onLoad={shouldShowMedia ? onImageLoad : () => {}} /> {shouldShowMedia ? ( diff --git a/packages/types/src/gif.ts b/packages/types/src/gif.ts index fbbae1f3..f9e7683b 100644 --- a/packages/types/src/gif.ts +++ b/packages/types/src/gif.ts @@ -2,6 +2,11 @@ import { IImages } from './images' import IUser from './user' import IVideo from './video' +interface IBottleData { + tid?: string + tags?: string[] +} + export type GifID = string | number export default interface IGif { @@ -29,6 +34,7 @@ export default interface IGif { is_scheduled: boolean is_removed: boolean tags: string[] + bottle_data: IBottleData analytics_response_payload: string video?: IVideo emoji_group_id?: number