2020-04-23 16:08:50 +00:00
|
|
|
import React from 'react';
|
2020-04-23 19:37:00 +00:00
|
|
|
import { Text } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-04-23 16:08:50 +00:00
|
|
|
|
|
|
|
import styles from './styles';
|
2020-04-23 20:11:17 +00:00
|
|
|
import { themes } from '../../../constants/colors';
|
|
|
|
import Touch from '../../../utils/touch';
|
2020-04-23 16:08:50 +00:00
|
|
|
|
2020-04-23 19:37:00 +00:00
|
|
|
const Button = ({
|
2020-04-23 16:38:27 +00:00
|
|
|
text, disabled, theme, onPress
|
|
|
|
}) => (
|
2020-04-23 19:37:00 +00:00
|
|
|
<Touch
|
|
|
|
style={[styles.buttonCircle, { backgroundColor: themes[theme].backgroundColor, borderColor: themes[theme].borderColor }]}
|
2020-04-23 16:38:27 +00:00
|
|
|
disabled={disabled}
|
2020-04-23 19:37:00 +00:00
|
|
|
theme={theme}
|
2020-04-23 16:38:27 +00:00
|
|
|
onPress={() => onPress && onPress(text)}
|
2020-04-23 16:08:50 +00:00
|
|
|
>
|
2020-04-23 19:37:00 +00:00
|
|
|
<Text style={[styles.text, { color: themes[theme].titleText }]}>
|
2020-04-23 16:08:50 +00:00
|
|
|
{text}
|
|
|
|
</Text>
|
2020-04-23 19:37:00 +00:00
|
|
|
</Touch>
|
2020-04-23 16:08:50 +00:00
|
|
|
);
|
|
|
|
|
2020-04-23 19:37:00 +00:00
|
|
|
Button.propTypes = {
|
|
|
|
text: PropTypes.string,
|
|
|
|
theme: PropTypes.string,
|
|
|
|
disabled: PropTypes.bool,
|
|
|
|
onPress: PropTypes.func
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Button;
|