import { useRoute, useTheme } from '@react-navigation/native'; import * as React from 'react'; import { Share, StyleSheet, TouchableOpacity } from 'react-native'; import Config from '../api/Config'; import * as UrlUtils from '../utils/UrlUtils'; import * as Icons from './Icons'; export default function ShareProjectButton( props: Partial> ) { const theme = useTheme(); const route = useRoute(); const onPress = React.useCallback(() => { const { username, slug } = route.params as any; const url = `exp://${Config.api.host}/@${username}/${slug}`; const message = UrlUtils.normalizeUrl(url); Share.share({ title: url, message, url: message, }); }, [route.params]); return ( ); } const styles = StyleSheet.create({ container: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingRight: 15, }, });