Skip to content

Instantly share code, notes, and snippets.

@kawnayeen
Last active December 13, 2017 11:05
Show Gist options
  • Save kawnayeen/4efda5e296a4170e4938c2209721200e to your computer and use it in GitHub Desktop.
Save kawnayeen/4efda5e296a4170e4938c2209721200e to your computer and use it in GitHub Desktop.
Button component
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
const Button = ({ onPress, children }) => {
const { buttonStyle, textStyle } = styles;
return (
<TouchableOpacity onPress={onPress} style={buttonStyle}>
<Text style={textStyle}>
{children}
</Text>
</TouchableOpacity>
);
};
const styles = {
textStyle: {
alignSelf: 'center',
color: '#007aff',
fontSize: 16,
fontWeight: '600',
paddingTop: 10,
paddingBottom: 10
},
buttonStyle: {
flex: 1,
alignSelf: 'stretch',
backgroundColor: '#fff',
borderRadius: 5,
borderWidth: 1,
borderColor: '#007aff',
marginLeft: 5,
marginRight: 5
}
};
export default Button;
onButtonPress() {
}
// in render within third card section
<Button onPress={this.onButtonPress.bind(this)}>
Login
</Button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment