import React from 'react' import { useTranslation } from 'react-i18next' import { Pressable, StyleSheet, Text, View } from 'react-native' import Modal from 'react-native-modal' import AppAnalytics from 'src/analytics/AppAnalytics' import { WebViewEvents } from 'src/analytics/Events' import Colors from 'src/styles/colors' import { typeScale } from 'src/styles/fonts' import variables from 'src/styles/variables' import { navigateToURI } from 'src/utils/linking' interface Props { currentUrl: string isVisible: boolean onClose(): void toggleBottomSheet(): void } export function WebViewAndroidBottomSheet({ currentUrl, isVisible, onClose, toggleBottomSheet, }: Props) { const { t } = useTranslation() const openExternalLink = () => { navigateToURI(currentUrl) toggleBottomSheet() AppAnalytics.track(WebViewEvents.webview_open_in_browser, { currentUrl }) } return ( {t('webView.openExternal')} {t('dismiss')} ) } const styles = StyleSheet.create({ overlay: { justifyContent: 'flex-end', margin: 0, }, centerContainer: { backgroundColor: Colors.backgroundPrimary, }, // Needed to add icons in the pressable buttons pressable: { flexDirection: 'row', alignItems: 'center', }, bottomSheetText: { ...typeScale.bodyMedium, textAlign: 'left', padding: variables.contentPadding, }, }) export default WebViewAndroidBottomSheet