Skip to content

Instantly share code, notes, and snippets.

@JoshK2
Last active June 4, 2020 12:58
Show Gist options
  • Save JoshK2/9e79b3e6d5657b80a0227c080d46a7b4 to your computer and use it in GitHub Desktop.
Save JoshK2/9e79b3e6d5657b80a0227c080d46a7b4 to your computer and use it in GitHub Desktop.
Store - button component
import React from 'react';
import {StyleSheet, TouchableHighlight, Text} from 'react-native';
import PropTypes from 'prop-types';
const styles = StyleSheet.create({
button: {
backgroundColor: '#000000bf',
borderRadius: 30,
paddingHorizontal: 9,
paddingVertical: 12,
},
text: {
color: '#ffffff',
textAlign: 'center',
fontSize: 18,
fontWeight: '500',
},
});
const Button = ({title, onPress}) => {
return (
<TouchableHighlight
style={styles.button}
onPress={onPress}
underlayColor="#404040">
<Text style={styles.text}>{title}</Text>
</TouchableHighlight>
);
};
Button.propTypes = {
title: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired,
};
export {Button};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment