aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-14 15:25:44 -0400
committerIvan Chen <ivan@tagg.id>2021-05-14 15:25:44 -0400
commita8963146c72be5b048d061df2dbcc322cb674877 (patch)
treeafec7acfeae8b7e70533813f6b7b9140477a9746 /src/components
parent183ce2b263e7282f42d204ebd59676b8e28352ec (diff)
removed hacky fix, added state check
Diffstat (limited to 'src/components')
-rw-r--r--src/components/common/BottomDrawer.tsx11
-rw-r--r--src/components/moments/MomentPostHeader.tsx4
-rw-r--r--src/components/profile/ProfileHeader.tsx4
3 files changed, 5 insertions, 14 deletions
diff --git a/src/components/common/BottomDrawer.tsx b/src/components/common/BottomDrawer.tsx
index 3d9c0471..16e98690 100644
--- a/src/components/common/BottomDrawer.tsx
+++ b/src/components/common/BottomDrawer.tsx
@@ -71,15 +71,14 @@ const BottomDrawer: React.FC<BottomDrawerProps> = (props) => {
enabledContentGestureInteraction={false}
callbackNode={bgAlpha}
onCloseEnd={() => {
- setModalVisible(false);
- setIsOpen(false);
+ if (!isOpen) {
+ setModalVisible(false);
+ setIsOpen(false);
+ }
}}
/>
- <TouchableWithoutFeedback
- onPress={() => {
- setIsOpen(false);
- }}>
+ <TouchableWithoutFeedback onPress={() => setIsOpen(false)}>
<Animated.View style={[styles.backgroundView, {backgroundColor}]} />
</TouchableWithoutFeedback>
</Modal>
diff --git a/src/components/moments/MomentPostHeader.tsx b/src/components/moments/MomentPostHeader.tsx
index d2e9fc49..f8c79ad9 100644
--- a/src/components/moments/MomentPostHeader.tsx
+++ b/src/components/moments/MomentPostHeader.tsx
@@ -51,10 +51,6 @@ const MomentPostHeader: React.FC<MomentPostHeaderProps> = ({
});
};
- useEffect(() => {
- setDrawerVisible(drawerVisible);
- }, [drawerVisible]);
-
return (
<View style={[styles.container, style]}>
<TouchableOpacity onPress={navigateToProfile} style={styles.header}>
diff --git a/src/components/profile/ProfileHeader.tsx b/src/components/profile/ProfileHeader.tsx
index 14f7dc71..db5308b9 100644
--- a/src/components/profile/ProfileHeader.tsx
+++ b/src/components/profile/ProfileHeader.tsx
@@ -85,10 +85,6 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({
}
};
- useEffect(() => {
- setDrawerVisible(drawerVisible);
- }, [drawerVisible]);
-
return (
<View ref={containerRef} style={styles.container}>
<ProfileMoreInfoDrawer