Last active
October 14, 2017 00:01
-
-
Save wolverineks/ee21b728069061b5041b4615a9e86916 to your computer and use it in GitHub Desktop.
React Alias Components
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
import React, {Component} from 'react' | |
import Icon from '...' | |
import { | |
Text, | |
TouchableOpacity, | |
View | |
} from 'react-native' | |
import styles from './styles' | |
const SUBMIT_TEXT = '...' | |
const CANCEL_TEXT = '...' | |
export default Alert extends Component { | |
render () { | |
<View style={styles.alertContainer}> | |
<View style={styles.alertHeader}> | |
<Icon src='...' style={styles.alertIcon} /> | |
<Text style={styles.alertText}>{alertHeaderText}</Text> | |
</View> | |
<View style={styles.alertBody}> | |
<Text style={styles.alertText}>{alertBodyText}</Text> | |
</View> | |
<View style={styles.alertFooter}> | |
<TouchableHighlight style={[styles.alertButton, styles.cancelButton]} onPress={...}> | |
<Text style={[styles.buttonText, styles.cancelButtonText]}> | |
{CANCEL_TEXT} | |
</Text> | |
</TouchableHighlight> | |
<TouchableHighlight style={[styles.alertButton, styles.submitButton]} onPress={...}> | |
<Text styles={[styles.buttonText, styles.submitButtonText]}> | |
{SUBMIT_TEXT} | |
</Text> | |
</TouchableHighlight> | |
</View> | |
</View> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment