Skip to content

Commit

Permalink
react-components: gif make fetchpriority lowercase to avoid react war…
Browse files Browse the repository at this point in the history
…ning
  • Loading branch information
giannif committed Apr 22, 2024
1 parent 9e20c13 commit ccf0ecb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/react-components/src/components/gif.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const Gif = ({
suppressHydrationWarning
// @ts-ignore - fetchPriority is not recognized by React typescript
// eslint-disable-next-line react/no-unknown-property
fetchPriority={fetchPriority}
fetchpriority={fetchPriority}
className={[Gif.imgClassName, loadedClassname].join(' ')}
src={shouldShowMedia ? rendition.url : placeholder}
style={{ background }}
Expand Down
14 changes: 8 additions & 6 deletions packages/react-components/stories/grid-editable.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import styled from '@emotion/styled'
import { giphyPurple } from '@giphy/colors'
import { GiphyFetch } from '@giphy/js-fetch-api'
import { IGif } from '@giphy/js-types'
import { Meta, StoryObj } from '@storybook/react'
import fetchMock from 'fetch-mock'
import React, { useEffect, useState } from 'react'
import { throttle } from 'throttle-debounce'
import { GifOverlayProps, Grid as GridComponent } from '../src'
import inTestsRunner from './in-tests-runner'
import mockGifsResult from './mock-data/gifs.json'
import { IGif } from '@giphy/js-types'
import { giphyPurple } from '@giphy/colors'

const apiKey = 'sXpGFDGZs0Dv1mmNFvYaGUvYwKX0PWIh'
const gf = new GiphyFetch(apiKey)
Expand Down Expand Up @@ -61,10 +61,12 @@ const Grid = ({ loader, ...other }: GridProps) => {
<Button
onClick={() => {
const result = prompt('Edit Title', gif.title) || 'New Title'
const editGif = externalGifs?.find((g) => g.id === gif.id)
if (editGif) {
editGif.title = result
setExternalGifs(externalGifs)
if (externalGifs) {
const editGif = externalGifs?.find((g) => g.id === gif.id)
if (editGif) {
editGif.title = result
setExternalGifs([...externalGifs])
}
}
}}
>
Expand Down

0 comments on commit ccf0ecb

Please sign in to comment.