Skip to content

Commit c93f5be

Browse files
mehcodemastermoo
authored andcommitted
Add a prop to control the background opacity
1 parent 478f230 commit c93f5be

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ActionButton.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ export default class ActionButton extends Component {
5555
<View pointerEvents="box-none" style={this.getOverlayStyles()}>
5656
<Animated.View pointerEvents="none" style={[this.getOverlayStyles(), {
5757
backgroundColor: this.props.bgColor,
58-
opacity: this.anim
58+
opacity: this.anim.interpolate({
59+
inputRange: [0, 1],
60+
outputRange: [0, this.props.bgOpacity]
61+
}),
5962
}]}>
6063
{this.props.backdrop}
6164
</Animated.View>
@@ -233,6 +236,7 @@ ActionButton.propTypes = {
233236
hideShadow: PropTypes.bool,
234237

235238
bgColor: PropTypes.string,
239+
bgOpacity: PropTypes.number,
236240
buttonColor: PropTypes.string,
237241
buttonTextStyle: Text.propTypes.style,
238242
buttonText: PropTypes.string,
@@ -257,6 +261,7 @@ ActionButton.propTypes = {
257261
ActionButton.defaultProps = {
258262
active: false,
259263
bgColor: 'transparent',
264+
bgOpacity: 1,
260265
buttonColor: 'rgba(0,0,0,1)',
261266
buttonTextStyle: {},
262267
buttonText: '+',

0 commit comments

Comments
 (0)