import React from 'react' import Toast from '../util/Toast' import Clipboard from '@react-native-clipboard/clipboard' import {StyleSheet, Text, TouchableOpacity, View} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {useStores} from '../../../state' import {s, colors} from '../../lib/styles' export const snapPoints = ['30%'] export function Component({ title, href, newTab, }: { title: string href: string newTab: boolean }) { const store = useStores() const onPressOpenNewTab = () => { store.shell.closeModal() store.nav.newTab(href) } const onPressCopy = () => { Clipboard.setString(href) store.shell.closeModal() Toast.show('Link copied', { position: Toast.positions.TOP, }) } return ( {title || href} {newTab ? ( Open in new tab ) : undefined} Copy to clipboard ) } const styles = StyleSheet.create({ btn: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', width: '100%', borderColor: colors.gray5, borderWidth: 1, borderRadius: 4, padding: 10, marginBottom: 10, }, icon: { marginRight: 8, }, })