mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 01:59:10 +00:00
@@ -10,6 +10,7 @@ class Button extends Component {
|
|||||||
color: ColorPropType,
|
color: ColorPropType,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
onPress: PropTypes.func.isRequired,
|
onPress: PropTypes.func.isRequired,
|
||||||
|
testID: PropTypes.string,
|
||||||
title: PropTypes.string.isRequired
|
title: PropTypes.string.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -19,13 +20,14 @@ class Button extends Component {
|
|||||||
color,
|
color,
|
||||||
disabled,
|
disabled,
|
||||||
onPress,
|
onPress,
|
||||||
|
testID,
|
||||||
title
|
title
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
accessibilityLabel={accessibilityLabel}
|
accessibilityLabel={accessibilityLabel}
|
||||||
accessibilityRole={'button'}
|
accessibilityRole="button"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
style={[
|
style={[
|
||||||
@@ -33,6 +35,7 @@ class Button extends Component {
|
|||||||
color && { backgroundColor: color },
|
color && { backgroundColor: color },
|
||||||
disabled && styles.buttonDisabled
|
disabled && styles.buttonDisabled
|
||||||
]}
|
]}
|
||||||
|
testID={testID}
|
||||||
>
|
>
|
||||||
<Text style={[styles.text, disabled && styles.textDisabled]}>
|
<Text style={[styles.text, disabled && styles.textDisabled]}>
|
||||||
{title}
|
{title}
|
||||||
|
|||||||
Reference in New Issue
Block a user