Skip to content

Instantly share code, notes, and snippets.

View m-tymchyk's full-sized avatar
😏
startupr.xyz

Maksym Tymchyk m-tymchyk

😏
startupr.xyz
View GitHub Profile
@m-tymchyk
m-tymchyk / react-native-open-external-link.js
Created October 30, 2018 09:00
React Native / How to open external link by tap
// custom-button.js
import React from 'react';
import { TouchableOpacity, StyleSheet, Text } from 'react-native';
export const CustomButton = (props) => {
const { title = 'Enter', style = {}, textStyle = {}, onPress } = props;
@m-tymchyk
m-tymchyk / react-native-send-email.js
Created October 19, 2018 13:40
React Native / How to send email
// 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;
@m-tymchyk
m-tymchyk / is-iphone-x.js
Last active July 5, 2021 22:36
React Native / How to determine if on iPhone X or XR
// 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' &&