Rocket.Chat.ReactNative/app/containers/Passcode/Button.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-04-23 16:08:50 +00:00
import React from 'react';
import { TouchableHighlight, Text } from 'react-native';
import styles from './styles';
2020-04-23 16:38:27 +00:00
import { themes } from '../../constants/colors';
2020-04-23 16:08:50 +00:00
2020-04-23 16:38:27 +00:00
const ButtonNumber = ({
text, disabled, theme, onPress
}) => (
2020-04-23 16:08:50 +00:00
<TouchableHighlight
style={[
styles.buttonCircle,
2020-04-23 16:38:27 +00:00
{ backgroundColor: themes[theme].backgroundColor },
2020-04-23 16:08:50 +00:00
// this.props.styleButtonCircle,
]}
// underlayColor={this.props.numbersButtonOverlayColor}
2020-04-23 16:38:27 +00:00
disabled={disabled}
2020-04-23 16:08:50 +00:00
// onShowUnderlay={() => this.setState({ textButtonSelected: text })}
// onHideUnderlay={() => this.setState({ textButtonSelected: "" })}
// onPress={() => {
// this.onPressButtonNumber(text);
// }}
2020-04-23 16:38:27 +00:00
onPress={() => onPress && onPress(text)}
2020-04-23 16:08:50 +00:00
// accessible
// accessibilityLabel={text}
>
<Text
style={[
styles.text,
// this.props.styleTextButton,
// {
// opacity: opacity,
// color: this.state.textButtonSelected === text
// ? this.props.styleColorButtonTitleSelected
// : this.props.styleColorButtonTitle
// }
]}
>
{text}
</Text>
</TouchableHighlight>
);
export default ButtonNumber;