From a49a5a351d2b58631d067c0524c5ebb097a3d5fe Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 9 Apr 2024 00:58:18 +0100 Subject: Use ALF for the embed consent modal (#3336) --- src/view/com/modals/EmbedConsent.tsx | 154 ----------------------------------- 1 file changed, 154 deletions(-) delete mode 100644 src/view/com/modals/EmbedConsent.tsx (limited to 'src/view/com/modals/EmbedConsent.tsx') diff --git a/src/view/com/modals/EmbedConsent.tsx b/src/view/com/modals/EmbedConsent.tsx deleted file mode 100644 index 941944728..000000000 --- a/src/view/com/modals/EmbedConsent.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import React from 'react' -import {StyleSheet, TouchableOpacity, View} from 'react-native' -import {LinearGradient} from 'expo-linear-gradient' -import {msg, Trans} from '@lingui/macro' -import {useLingui} from '@lingui/react' - -import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' -import { - EmbedPlayerSource, - embedPlayerSources, - externalEmbedLabels, -} from '#/lib/strings/embed-player' -import {useModalControls} from '#/state/modals' -import {useSetExternalEmbedPref} from '#/state/preferences/external-embeds-prefs' -import {usePalette} from 'lib/hooks/usePalette' -import {colors, gradients, s} from 'lib/styles' -import {Text} from '../util/text/Text' -import {ScrollView} from './util' - -export const snapPoints = [450] - -export function Component({ - onAccept, - source, -}: { - onAccept: () => void - source: EmbedPlayerSource -}) { - const pal = usePalette('default') - const {closeModal} = useModalControls() - const {_} = useLingui() - const setExternalEmbedPref = useSetExternalEmbedPref() - const {isMobile} = useWebMediaQueries() - - const onShowAllPress = React.useCallback(() => { - for (const key of embedPlayerSources) { - setExternalEmbedPref(key, 'show') - } - onAccept() - closeModal() - }, [closeModal, onAccept, setExternalEmbedPref]) - - const onShowPress = React.useCallback(() => { - setExternalEmbedPref(source, 'show') - onAccept() - closeModal() - }, [closeModal, onAccept, setExternalEmbedPref, source]) - - const onHidePress = React.useCallback(() => { - setExternalEmbedPref(source, 'hide') - closeModal() - }, [closeModal, setExternalEmbedPref, source]) - - return ( - - - External Media - - - - - This content is hosted by {externalEmbedLabels[source]}. Do you want - to enable external media? - - - - - - External media may allow websites to collect information about you and - your device. No information is sent or requested until you press the - "play" button. - - - - - - - Enable External Media - - - - - - - - Enable {externalEmbedLabels[source]} only - - - - - - - - No thanks - - - - - ) -} - -const styles = StyleSheet.create({ - title: { - textAlign: 'center', - fontWeight: 'bold', - fontSize: 24, - marginBottom: 12, - }, - btn: { - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - width: '100%', - borderRadius: 32, - padding: 14, - backgroundColor: colors.gray1, - }, -}) -- cgit 1.4.1