diff --git a/ActionButton.js b/ActionButton.js index 44e97aa..62dfe02 100644 --- a/ActionButton.js +++ b/ActionButton.js @@ -38,7 +38,6 @@ export default class ActionButton extends Component { getActionButtonStyles() { const actionButtonStyles = [styles.actionBarItem, this.getButtonSize()]; - if(!this.props.hideShadow) actionButtonStyles.push(styles.btnShadow); return actionButtonStyles; } @@ -105,11 +104,6 @@ export default class ActionButton extends Component { const animatedViewStyle = [ styles.btn, { - width: this.props.size, - height: this.props.size, - borderRadius: this.props.size / 2, - marginHorizontal: 8, - marginBottom: shadowHeight, backgroundColor: this.anim.interpolate({ inputRange: [0, 1], outputRange: [this.props.buttonColor, buttonColorMax] @@ -128,22 +122,29 @@ export default class ActionButton extends Component { }, ]; - if(!this.props.hideShadow && Platform.OS === 'android') animatedViewStyle.push(styles.btnShadow); + const combinedStyle = { + width: this.props.size, + height: this.props.size, + borderRadius: this.props.size / 2, + marginBottom: shadowHeight, + backgroundColor: this.props.buttonColor + } + + const actionButtonStyles = [ this.getActionButtonStyles(), combinedStyle, animatedViewStyle ] return ( - - { - this.props.onPress() - if (this.props.children) this.animateButton() - }}> - + + + { + this.props.onPress() + if (this.props.children) this.animateButton() + }}> {this._renderButtonIcon()} - - + + ); }