From 861804629a8a68d8d20d09b5f0358a6b05d2a253 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 23 Apr 2024 00:18:03 +0100 Subject: [PATCH] [GIFs] Remove consent flow (#3652) * Remove tenor from settings * Remove consent flow --- src/components/dialogs/GifSelect.tsx | 93 +------------------ .../screens/PreferencesExternalEmbeds.tsx | 34 ++++--- 2 files changed, 23 insertions(+), 104 deletions(-) diff --git a/src/components/dialogs/GifSelect.tsx b/src/components/dialogs/GifSelect.tsx index 41612aa5..024188ec 100644 --- a/src/components/dialogs/GifSelect.tsx +++ b/src/components/dialogs/GifSelect.tsx @@ -8,10 +8,6 @@ import {useLingui} from '@lingui/react' import {logEvent} from '#/lib/statsig/statsig' import {cleanError} from '#/lib/strings/errors' import {isWeb} from '#/platform/detection' -import { - useExternalEmbedsPrefs, - useSetExternalEmbedPref, -} from '#/state/preferences' import { Gif, useFeaturedGifsQuery, @@ -27,7 +23,6 @@ import {ArrowLeft_Stroke2_Corner0_Rounded as Arrow} from '#/components/icons/Arr import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2' import {Button, ButtonIcon, ButtonText} from '../Button' import {ListFooter, ListMaybePlaceholder} from '../Lists' -import {Text} from '../Typography' export function GifSelectDialog({ control, @@ -38,7 +33,6 @@ export function GifSelectDialog({ onClose: () => void onSelectGif: (gif: Gif) => void }) { - const externalEmbedsPrefs = useExternalEmbedsPrefs() const onSelectGif = useCallback( (gif: Gif) => { control.close(() => onSelectGifProp(gif)) @@ -46,19 +40,6 @@ export function GifSelectDialog({ [control, onSelectGifProp], ) - let content = null - let snapPoints - switch (externalEmbedsPrefs?.tenor) { - case 'show': - content = - snapPoints = ['100%'] - break - case 'hide': - default: - content = - break - } - const renderErrorBoundary = useCallback( (error: any) => , [], @@ -67,10 +48,12 @@ export function GifSelectDialog({ return ( - {content} + + + ) } @@ -293,74 +276,6 @@ function GifPreview({ ) } -function TenorConsentPrompt({control}: {control: Dialog.DialogControlProps}) { - const {_} = useLingui() - const t = useTheme() - const {gtMobile} = useBreakpoints() - const setExternalEmbedPref = useSetExternalEmbedPref() - - const onShowPress = useCallback(() => { - setExternalEmbedPref('tenor', 'show') - }, [setExternalEmbedPref]) - - const onHidePress = useCallback(() => { - setExternalEmbedPref('tenor', 'hide') - control.close() - }, [control, setExternalEmbedPref]) - - const gtMobileWeb = gtMobile && isWeb - - return ( - - - - Permission to use Tenor - - - - - - Bluesky uses Tenor to provide the GIF selector feature. - - - - - - Tenor is a third-party service that provides GIFs for use in - Bluesky. By enabling Tenor, requests will be made to Tenor's - servers to retrieve the GIFs. - - - - - - - - - - ) -} - function DialogError({details}: {details?: string}) { const {_} = useLingui() const control = Dialog.useDialogContext() diff --git a/src/view/screens/PreferencesExternalEmbeds.tsx b/src/view/screens/PreferencesExternalEmbeds.tsx index 1e8cedf7..5eec7e50 100644 --- a/src/view/screens/PreferencesExternalEmbeds.tsx +++ b/src/view/screens/PreferencesExternalEmbeds.tsx @@ -1,25 +1,26 @@ import React from 'react' import {StyleSheet, View} from 'react-native' +import {Trans} from '@lingui/macro' import {useFocusEffect} from '@react-navigation/native' -import {NativeStackScreenProps, CommonNavigatorParams} from 'lib/routes/types' -import {s} from 'lib/styles' -import {Text} from '../com/util/text/Text' -import {usePalette} from 'lib/hooks/usePalette' -import {useAnalytics} from 'lib/analytics/analytics' -import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' + import { EmbedPlayerSource, externalEmbedLabels, } from '#/lib/strings/embed-player' import {useSetMinimalShellMode} from '#/state/shell' -import {Trans} from '@lingui/macro' -import {ScrollView} from '../com/util/Views' +import {useAnalytics} from 'lib/analytics/analytics' +import {usePalette} from 'lib/hooks/usePalette' +import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' +import {CommonNavigatorParams, NativeStackScreenProps} from 'lib/routes/types' +import {s} from 'lib/styles' import { useExternalEmbedsPrefs, useSetExternalEmbedPref, } from 'state/preferences' import {ToggleButton} from 'view/com/util/forms/ToggleButton' import {SimpleViewHeader} from '../com/util/SimpleViewHeader' +import {Text} from '../com/util/text/Text' +import {ScrollView} from '../com/util/Views' type Props = NativeStackScreenProps< CommonNavigatorParams, @@ -74,13 +75,16 @@ export function PreferencesExternalEmbeds({}: Props) { Enable media players for - {Object.entries(externalEmbedLabels).map(([key, label]) => ( - - ))} + {Object.entries(externalEmbedLabels) + // TODO: Remove special case when we disable the old integration. + .filter(([key]) => key !== 'tenor') + .map(([key, label]) => ( + + ))} )