diff --git a/src/ButtonComponent.js b/src/ButtonComponent.js index 5ba7b1d..c81f559 100644 --- a/src/ButtonComponent.js +++ b/src/ButtonComponent.js @@ -1,5 +1,5 @@ import React, { Component, PropTypes } from 'react'; -import { StyleSheet, View, TouchableOpacity } from 'react-native'; +import { StyleSheet, View, TouchableOpacity, Animated } from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import Button from './common/Button'; @@ -16,6 +16,8 @@ const propTypes = { style: PropTypes.oneOfType([PropTypes.number, PropTypes.object]), progressSize: PropTypes.number, onPress: PropTypes.func, + onPressIn: PropTypes.func, + onPressOut: PropTypes.func, }; const defaultProps = { @@ -28,6 +30,8 @@ const defaultProps = { height: 50, }; +const AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient); + class ButtonComponent extends Component { static propTypes = propTypes; static defaultProps = defaultProps; @@ -112,29 +116,31 @@ class ButtonComponent extends Component { if (type === 'primary') { content = ( - {this.renderButton({ textStyle: styles.text })} - + ); } else { const border = type === 'border' && styles.border; content = ( - + {this.renderButton({ textStyle: styles.secondaryText })} - + ); } return (