about summary refs log tree commit diff
path: root/src/components/dialogs/GifSelect.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-04-23 00:18:03 +0100
committerGitHub <noreply@github.com>2024-04-23 00:18:03 +0100
commit861804629a8a68d8d20d09b5f0358a6b05d2a253 (patch)
tree95d9eb6e148ccba59d78f5c0181f09f83b3bb941 /src/components/dialogs/GifSelect.tsx
parent76449fb6ef9b3eb327b6d059614d0da31c9d8e1f (diff)
downloadvoidsky-861804629a8a68d8d20d09b5f0358a6b05d2a253.tar.zst
[GIFs] Remove consent flow (#3652)
* Remove tenor from settings

* Remove consent flow
Diffstat (limited to 'src/components/dialogs/GifSelect.tsx')
-rw-r--r--src/components/dialogs/GifSelect.tsx93
1 files changed, 4 insertions, 89 deletions
diff --git a/src/components/dialogs/GifSelect.tsx b/src/components/dialogs/GifSelect.tsx
index 41612aa5d..024188ec4 100644
--- a/src/components/dialogs/GifSelect.tsx
+++ b/src/components/dialogs/GifSelect.tsx
@@ -9,10 +9,6 @@ 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,
   useGifSearchQuery,
@@ -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 = <GifList control={control} onSelectGif={onSelectGif} />
-      snapPoints = ['100%']
-      break
-    case 'hide':
-    default:
-      content = <TenorConsentPrompt control={control} />
-      break
-  }
-
   const renderErrorBoundary = useCallback(
     (error: any) => <DialogError details={String(error)} />,
     [],
@@ -67,10 +48,12 @@ export function GifSelectDialog({
   return (
     <Dialog.Outer
       control={control}
-      nativeOptions={{sheet: {snapPoints}}}
+      nativeOptions={{sheet: {snapPoints: ['100%']}}}
       onClose={onClose}>
       <Dialog.Handle />
-      <ErrorBoundary renderError={renderErrorBoundary}>{content}</ErrorBoundary>
+      <ErrorBoundary renderError={renderErrorBoundary}>
+        <GifList control={control} onSelectGif={onSelectGif} />
+      </ErrorBoundary>
     </Dialog.Outer>
   )
 }
@@ -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 (
-    <Dialog.ScrollableInner label={_(msg`Permission to use Tenor`)}>
-      <View style={a.gap_sm}>
-        <Text style={[a.text_2xl, a.font_bold]}>
-          <Trans>Permission to use Tenor</Trans>
-        </Text>
-
-        <View style={[a.mt_sm, a.mb_2xl, a.gap_lg]}>
-          <Text>
-            <Trans>
-              Bluesky uses Tenor to provide the GIF selector feature.
-            </Trans>
-          </Text>
-
-          <Text style={t.atoms.text_contrast_medium}>
-            <Trans>
-              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.
-            </Trans>
-          </Text>
-        </View>
-      </View>
-      <View style={[a.gap_md, gtMobileWeb && a.flex_row_reverse]}>
-        <Button
-          label={_(msg`Enable Tenor`)}
-          onPress={onShowPress}
-          onAccessibilityEscape={control.close}
-          color="primary"
-          size={gtMobileWeb ? 'small' : 'medium'}
-          variant="solid">
-          <ButtonText>
-            <Trans>Enable Tenor</Trans>
-          </ButtonText>
-        </Button>
-        <Button
-          label={_(msg`No thanks`)}
-          onAccessibilityEscape={control.close}
-          onPress={onHidePress}
-          color="secondary"
-          size={gtMobileWeb ? 'small' : 'medium'}
-          variant="ghost">
-          <ButtonText>
-            <Trans>No thanks</Trans>
-          </ButtonText>
-        </Button>
-      </View>
-    </Dialog.ScrollableInner>
-  )
-}
-
 function DialogError({details}: {details?: string}) {
   const {_} = useLingui()
   const control = Dialog.useDialogContext()