|
|
|
@ -1,14 +1,14 @@ |
|
|
|
|
import { GiphyContent, GiphyGridView, GiphyMediaType } from '@giphy/react-native-sdk'; |
|
|
|
|
import React, { useCallback, useState } from 'react'; |
|
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
import { useDispatch } from 'react-redux'; |
|
|
|
|
import { useDispatch, useSelector } from 'react-redux'; |
|
|
|
|
|
|
|
|
|
import { createGifSentEvent, sendAnalytics } from '../../../analytics'; |
|
|
|
|
import JitsiScreen from '../../../base/modal/components/JitsiScreen'; |
|
|
|
|
import { sendMessage } from '../../../chat/actions.any'; |
|
|
|
|
import { goBack } from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef'; |
|
|
|
|
import ClearableInput from '../../../participants-pane/components/native/ClearableInput'; |
|
|
|
|
import { formatGifUrlMessage, getGifUrl } from '../../functions'; |
|
|
|
|
import { formatGifUrlMessage, getGifRating, getGifUrl } from '../../functions'; |
|
|
|
|
|
|
|
|
|
import GifsMenuFooter from './GifsMenuFooter'; |
|
|
|
|
import styles from './styles'; |
|
|
|
@ -17,12 +17,19 @@ const GifsMenu = () => { |
|
|
|
|
const [ searchQuery, setSearchQuery ] = useState(''); |
|
|
|
|
const dispatch = useDispatch(); |
|
|
|
|
const { t } = useTranslation(); |
|
|
|
|
const rating = useSelector(getGifRating); |
|
|
|
|
|
|
|
|
|
const options = { |
|
|
|
|
mediaType: GiphyMediaType.Gif, |
|
|
|
|
limit: 20, |
|
|
|
|
rating |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const content = searchQuery === '' |
|
|
|
|
? GiphyContent.trending({ mediaType: GiphyMediaType.Gif }) |
|
|
|
|
? GiphyContent.trending(options) |
|
|
|
|
: GiphyContent.search({ |
|
|
|
|
searchQuery, |
|
|
|
|
mediaType: GiphyMediaType.Gif |
|
|
|
|
...options, |
|
|
|
|
searchQuery |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const sendGif = useCallback(e => { |
|
|
|
|