Files
drip/components/button.js
T
2020-03-11 20:19:45 +00:00

32 lines
681 B
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
import { TouchableOpacity } from 'react-native'
import AppText from './app-text'
import styles from '../styles'
export default function Button({
backgroundColor,
children,
onPress,
style,
testID
}) {
return (
<TouchableOpacity
onPress={onPress}
style={[styles.button, style, { backgroundColor }]}
testID={testID}
>
<AppText style={styles.homeButtonText}>{children}</AppText>
</TouchableOpacity>
)
}
Button.propTypes = {
backgroundColor: PropTypes.string,
children: PropTypes.node,
onPress: PropTypes.func,
style: PropTypes.object,
testID: PropTypes.string
}