diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-26 18:32:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-26 18:32:28 -0400 |
commit | caac607ed90c35ad8d4b2787b170e1fd1f165333 (patch) | |
tree | 98d5733a6f98a89e293bd0cf2f0c4fe566d15315 /src/components/common/BottomDrawer.tsx | |
parent | 27fdbf976907be00afdd10b0e545d0a429e27443 (diff) | |
parent | 8253184aef6051f053cc40e95e9c3433fae591ed (diff) |
Merge pull request #389 from IvanIFChen/tma819-new-message-cancel-button
[TMA-819] New message cancel button
Diffstat (limited to 'src/components/common/BottomDrawer.tsx')
-rw-r--r-- | src/components/common/BottomDrawer.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/common/BottomDrawer.tsx b/src/components/common/BottomDrawer.tsx index 988c1e79..3d9c0471 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, {interpolateColors} from 'react-native-reanimated'; +import Animated, {interpolateColors, useValue} from 'react-native-reanimated'; import BottomSheet from 'reanimated-bottom-sheet'; import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; @@ -23,7 +23,7 @@ const BottomDrawer: React.FC<BottomDrawerProps> = (props) => { const {isOpen, setIsOpen, showHeader, initialSnapPosition} = props; const drawerRef = useRef<BottomSheet>(null); const [modalVisible, setModalVisible] = useState(isOpen); - const bgAlpha = new Animated.Value(isOpen ? 1 : 0); + const bgAlpha = useValue(isOpen ? 1 : 0); useEffect(() => { if (isOpen) { @@ -54,6 +54,7 @@ const BottomDrawer: React.FC<BottomDrawerProps> = (props) => { inputRange: [0, 1], outputColorRange: ['rgba(0,0,0,0.3)', 'rgba(0,0,0,0)'], }); + return ( <Modal transparent |