This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// external-link.js | |
import React from 'react'; | |
import { TouchableOpacity, StyleSheet, Text, Linking } from 'react-native'; | |
const ExternalLink = (props) => { | |
const { url, children, style = {} } = props; | |
const onPress = () => Linking.canOpenURL(url).then(() => { | |
Linking.openURL(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// send-email.js | |
// We can use react-native Linking to send email | |
import qs from 'qs'; | |
import { Linking } from 'react-native'; | |
export async function sendEmail(to, subject, body, options = {}) { | |
const { cc, bcc } = options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// is-iphone-x.js | |
import { Dimensions, Platform } from 'react-native'; | |
export function isIphoneX() { | |
const dim = Dimensions.get('window'); | |
return ( | |
// This has to be iOS | |
Platform.OS === 'ios' && |