Newer
Older
import PropTypes from 'prop-types'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { Colors, Fonts, Spacing } from '../../styles/redesign'
const Button = ({ children, isCTA, isSmall, onPress, testID }) => {
const buttonStyle = isCTA ? styles.cta : styles.regular
const textCTA = isCTA ? styles.buttonTextBold : styles.buttonTextRegular
const textStyle = isSmall ? [ textCTA, textSmall ] : [textCTA, text]
<TouchableOpacity onPress={onPress} style={buttonStyle} testID={testID}>
<AppText style={textStyle}>{children}</AppText>
}
Button.propTypes = {
children: PropTypes.node,
isCTA: PropTypes.bool,
isSmall: PropTypes.bool,
onPress: PropTypes.func,
testID: PropTypes.string
}
textTransform: 'uppercase'
}
const textSmall = {
fontSize: Fonts.small,
padding: Spacing.small,
textTransform: 'uppercase'
}
const button = {
alignItems: 'center',
justifyContent: 'center',
margin: Spacing.base
}
const styles = StyleSheet.create({
backgroundColor: Colors.orange,
},
buttonTextBold: {
fontFamily: Fonts.bold
},
buttonTextRegular: {
fontFamily: Fonts.main