2018-08-31 16:46:33 +00:00
|
|
|
import React from 'react';
|
2017-12-20 15:57:33 +00:00
|
|
|
import { TouchableHighlight } from 'react-native';
|
2018-08-31 16:46:33 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2019-03-29 19:36:07 +00:00
|
|
|
import { COLOR_WHITE } from '../../constants/colors';
|
2017-12-20 15:57:33 +00:00
|
|
|
|
2018-08-31 16:46:33 +00:00
|
|
|
const Touch = ({ children, onPress, ...props }) => (
|
|
|
|
<TouchableHighlight
|
2019-03-29 19:36:07 +00:00
|
|
|
underlayColor={COLOR_WHITE}
|
2018-08-31 16:46:33 +00:00
|
|
|
activeOpacity={0.5}
|
|
|
|
onPress={onPress}
|
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</TouchableHighlight>
|
|
|
|
);
|
|
|
|
|
|
|
|
Touch.propTypes = {
|
|
|
|
children: PropTypes.node.isRequired,
|
2018-09-11 16:32:52 +00:00
|
|
|
onPress: PropTypes.func
|
2018-08-31 16:46:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default Touch;
|