aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/BottomDrawer.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-09 17:15:29 -0400
committerIvan Chen <ivan@tagg.id>2021-04-09 17:15:29 -0400
commit347e9e450268e4897b8dd241721b84945d9e2ec9 (patch)
tree58334be3724398c886365e99901e4442f5657172 /src/components/common/BottomDrawer.tsx
parent097b515066f1a0c38cb7fb69cf78b16b945594e5 (diff)
parent3ec56863bfdd47b2ee8d0f0fe5a45be779508660 (diff)
Merge branch 'master' into tma756-bugfix-onpress-tagg-on-sp
# Conflicts: # src/components/taggs/TaggsBar.tsx
Diffstat (limited to 'src/components/common/BottomDrawer.tsx')
-rw-r--r--src/components/common/BottomDrawer.tsx18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/components/common/BottomDrawer.tsx b/src/components/common/BottomDrawer.tsx
index bef9434a..988c1e79 100644
--- a/src/components/common/BottomDrawer.tsx
+++ b/src/components/common/BottomDrawer.tsx
@@ -6,7 +6,7 @@ import {
View,
ViewProps,
} from 'react-native';
-import Animated from 'react-native-reanimated';
+import Animated, {interpolateColors} from 'react-native-reanimated';
import BottomSheet from 'reanimated-bottom-sheet';
import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';
@@ -50,6 +50,10 @@ const BottomDrawer: React.FC<BottomDrawerProps> = (props) => {
);
};
+ const backgroundColor = interpolateColors(bgAlpha, {
+ inputRange: [0, 1],
+ outputColorRange: ['rgba(0,0,0,0.3)', 'rgba(0,0,0,0)'],
+ });
return (
<Modal
transparent
@@ -75,17 +79,7 @@ const BottomDrawer: React.FC<BottomDrawerProps> = (props) => {
onPress={() => {
setIsOpen(false);
}}>
- <Animated.View
- style={[
- styles.backgroundView,
- {
- backgroundColor: Animated.interpolateColors(bgAlpha, {
- inputRange: [0, 1],
- outputColorRange: ['rgba(0,0,0,0.3)', 'rgba(0,0,0,0)'],
- }),
- },
- ]}
- />
+ <Animated.View style={[styles.backgroundView, {backgroundColor}]} />
</TouchableWithoutFeedback>
</Modal>
);