From 3d09ee8bb27ca938f3e5feb8267f6610d6a69b61 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Wed, 15 Apr 2026 08:46:16 -0400 Subject: [PATCH 1/4] pr fixes --- src/components/dialogs/GifSelect.tsx | 64 ++++++++++++---------------- src/state/queries/klipy.ts | 2 +- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/src/components/dialogs/GifSelect.tsx b/src/components/dialogs/GifSelect.tsx index ab99a9525b..bc58cbf137 100644 --- a/src/components/dialogs/GifSelect.tsx +++ b/src/components/dialogs/GifSelect.tsx @@ -8,9 +8,7 @@ import { import {type TextInput, View} from 'react-native' import {useWindowDimensions} from 'react-native' import {Image} from 'expo-image' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' -import {Trans} from '@lingui/react/macro' +import {Trans, useLingui} from '@lingui/react/macro' import {cleanError} from '#/lib/strings/errors' import { @@ -90,7 +88,7 @@ function GifList({ onSelectGif: (gif: Gif) => void }) { const ax = useAnalytics() - const {_} = useLingui() + const {t: l} = useLingui() const t = useTheme() const {gtMobile} = useBreakpoints() const textInputRef = useRef(null) @@ -98,14 +96,14 @@ function GifList({ const [undeferredSearch, setSearch] = useState('') const search = useThrottledValue(undeferredSearch, 500) const {height} = useWindowDimensions() - const useKlipy = ax.features.enabled(ax.features.KlipyGifProviderEnable) + const klipyEnabled = ax.features.enabled(ax.features.KlipyGifProviderEnable) const isSearching = search.length > 0 - const klipyTrending = useKlipyFeaturedGifsQuery({enabled: useKlipy}) - const klipySearch = useKlipyGifSearchQuery(search, {enabled: useKlipy}) - const tenorTrending = useTenorFeaturedGifsQuery({enabled: !useKlipy}) - const tenorSearch = useTenorGifSearchQuery(search, {enabled: !useKlipy}) + const klipyTrending = useKlipyFeaturedGifsQuery({enabled: klipyEnabled}) + const klipySearch = useKlipyGifSearchQuery(search, {enabled: klipyEnabled}) + const tenorTrending = useTenorFeaturedGifsQuery({enabled: !klipyEnabled}) + const tenorSearch = useTenorGifSearchQuery(search, {enabled: !klipyEnabled}) const { data, @@ -116,7 +114,7 @@ function GifList({ isPending, isError, refetch, - } = useKlipy + } = klipyEnabled ? isSearching ? klipySearch : klipyTrending @@ -172,7 +170,7 @@ function GifList({ color="secondary" shape="round" onPress={() => control.close()} - label={_(msg`Close GIF dialog`)}> + label={l`Close GIF dialog`}> )} @@ -180,8 +178,8 @@ function GifList({ { setSearch(text) listRef.current?.scrollToOffset({offset: 0, animated: false}) @@ -199,7 +197,7 @@ function GifList({ ) - }, [gtMobile, t.atoms.bg, _, control, useKlipy]) + }, [gtMobile, t.atoms.bg, l, control, klipyEnabled]) return ( <> @@ -226,22 +224,18 @@ function GifList({ emptyType="results" sideBorders={false} topBorder={false} - errorTitle={_(msg`Failed to load GIFs`)} + errorTitle={l`Failed to load GIFs`} errorMessage={ - useKlipy - ? _(msg`There was an issue connecting to KLIPY.`) - : _(msg`There was an issue connecting to Tenor.`) + klipyEnabled + ? l`There was an issue connecting to KLIPY.` + : l`There was an issue connecting to Tenor.` } emptyMessage={ isSearching - ? _(msg`No search results found for "${search}".`) - : useKlipy - ? _( - msg`No featured GIFs found. There may be an issue with KLIPY.`, - ) - : _( - msg`No featured GIFs found. There may be an issue with Tenor.`, - ) + ? l`No search results found for "${search}".` + : klipyEnabled + ? l`No featured GIFs found. There may be an issue with KLIPY.` + : l`No featured GIFs found. There may be an issue with Tenor.` } /> )} @@ -268,23 +262,19 @@ function GifList({ } function DialogError({details}: {details?: string}) { - const {_} = useLingui() + const {t: l} = useLingui() const control = Dialog.useDialogContext() return ( - +