Skip to content

Instantly share code, notes, and snippets.

@isaacnass
Last active July 13, 2017 19:10
Show Gist options
  • Save isaacnass/cb7bcf5ae28a46c7ff9d78067df87e2d to your computer and use it in GitHub Desktop.
Save isaacnass/cb7bcf5ae28a46c7ff9d78067df87e2d to your computer and use it in GitHub Desktop.
Button?
import React from 'react';
//testing
import {
StyleSheet,
Text,
Image,
TouchableOpacity,
} from 'react-native';
export default function Button (props) {
return (
<TouchableOpacity onPress={props.onPress} style={[style.button, props.buttonStyle]}>
{ props.icon && <Image source={props.icon} style={[styles.icon, props.iconStyle]} /> }
<Text style={[styles.text, props.textStyle]}>{props.children}</Text>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
button: {
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'row',
padding: 4,
},
icon: {
},
text: {
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment