2015-09-03 13:00:09 -07:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-07-12 05:51:57 -07:00
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-07-12 05:51:57 -07:00
|
|
|
*
|
2018-05-11 13:32:37 -07:00
|
|
|
* @format
|
2015-09-03 13:00:09 -07:00
|
|
|
* @flow
|
|
|
|
*/
|
2018-05-11 13:32:37 -07:00
|
|
|
|
2015-09-03 13:00:09 -07:00
|
|
|
'use strict';
|
|
|
|
|
2018-09-25 17:04:38 -07:00
|
|
|
const React = require('react');
|
|
|
|
const {StyleSheet, Text, TouchableHighlight} = require('react-native');
|
2015-09-03 13:00:09 -07:00
|
|
|
|
2018-09-25 17:04:38 -07:00
|
|
|
import type {PressEvent} from 'CoreEventTypes';
|
2016-07-26 01:00:02 -07:00
|
|
|
|
2018-09-25 17:04:38 -07:00
|
|
|
type Props = $ReadOnly<{|
|
|
|
|
children?: React.Node,
|
|
|
|
onPress?: ?(event: PressEvent) => mixed,
|
|
|
|
|}>;
|
|
|
|
|
|
|
|
class RNTesterButton extends React.Component<Props> {
|
2016-07-26 01:00:02 -07:00
|
|
|
render() {
|
2015-09-03 13:00:09 -07:00
|
|
|
return (
|
|
|
|
<TouchableHighlight
|
|
|
|
onPress={this.props.onPress}
|
|
|
|
style={styles.button}
|
|
|
|
underlayColor="grey">
|
2018-09-25 17:04:38 -07:00
|
|
|
<Text>{this.props.children}</Text>
|
2015-09-03 13:00:09 -07:00
|
|
|
</TouchableHighlight>
|
|
|
|
);
|
2016-07-26 01:00:02 -07:00
|
|
|
}
|
|
|
|
}
|
2015-09-03 13:00:09 -07:00
|
|
|
|
2018-09-25 17:04:38 -07:00
|
|
|
const styles = StyleSheet.create({
|
2015-09-03 13:00:09 -07:00
|
|
|
button: {
|
2015-09-11 01:56:51 -07:00
|
|
|
borderColor: '#696969',
|
2015-09-03 13:00:09 -07:00
|
|
|
borderRadius: 8,
|
|
|
|
borderWidth: 1,
|
|
|
|
padding: 10,
|
|
|
|
margin: 5,
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
2015-09-11 01:56:51 -07:00
|
|
|
backgroundColor: '#d3d3d3',
|
2015-09-03 13:00:09 -07:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2017-05-05 20:50:47 -07:00
|
|
|
module.exports = RNTesterButton;
|