From 25b4250ab9b0806c7dfda656a0639d16f5b7492b Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 5 Apr 2024 09:16:28 -0300 Subject: [PATCH] Temp action sheet fix for Android --- app/containers/ActionSheet/ActionSheet.tsx | 7 ++++--- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index 90254ee31..df92e8a84 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -32,13 +32,14 @@ const ActionSheet = React.memo( const [data, setData] = useState({} as TActionSheetOptions); const [isVisible, setVisible] = useState(false); const animatedContentHeight = useSharedValue(0); - const animatedHandleHeight = useSharedValue(0); + // const animatedHandleHeight = useSharedValue(0); const animatedDataSnaps = useSharedValue([]); const animatedSnapPoints = useDerivedValue(() => { if (animatedDataSnaps.value?.length) { return animatedDataSnaps.value; } - const contentWithHandleHeight = animatedContentHeight.value + animatedHandleHeight.value; + // FIXME: review handleHeight + const contentWithHandleHeight = animatedContentHeight.value; // + animatedHandleHeight.value; // Bottom sheet requires a default value to work if (contentWithHandleHeight === 0) { return ['25%']; @@ -152,7 +153,7 @@ const ActionSheet = React.memo( ref={bottomSheetRef} // If data.options exist, we calculate snaps to be precise, otherwise we cal snapPoints={data.options?.length ? snaps : animatedSnapPoints} - handleHeight={animatedHandleHeight} + // handleHeight={animatedHandleHeight} // We need undefined to enable vertical swipe gesture inside the bottom sheet like in reaction picker contentHeight={data.snaps?.length || data.options?.length ? undefined : animatedContentHeight} animationConfigs={ANIMATION_CONFIG} diff --git a/package.json b/package.json index d21b2e2e6..c0cb0d670 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "@bugsnag/react-native": "^7.10.5", "@codler/react-native-keyboard-aware-scroll-view": "^2.0.1", - "@gorhom/bottom-sheet": "4.4.5", + "@gorhom/bottom-sheet": "^4.6.1", "@hookform/resolvers": "^2.9.10", "@notifee/react-native": "7.8.2", "@nozbe/watermelondb": "0.25.5", diff --git a/yarn.lock b/yarn.lock index 2e135f606..e69b06ea8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2831,10 +2831,10 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== -"@gorhom/bottom-sheet@4.4.5": - version "4.4.5" - resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.4.5.tgz#b9041b01ce1af9a936e7c0fc1d78f026d759eebe" - integrity sha512-Z5Z20wshLUB8lIdtMKoJaRnjd64wBR/q8EeVPThrg+skrcBwBPHfUwZJ2srB0rEszA/01ejSJy/ixyd7Ra7vUA== +"@gorhom/bottom-sheet@^4.6.1": + version "4.6.1" + resolved "https://registry.yarnpkg.com/@gorhom/bottom-sheet/-/bottom-sheet-4.6.1.tgz#e45e2183246e338cf732fe4f8f2c91875b22ddce" + integrity sha512-sXqsYqX1/rAbmCC5fb9o6hwSF3KXriC0EGUGvLlhFvjaEEMBrRKFTNndiluRK1HmpUzazVaYdTm/lLkSiA2ooQ== dependencies: "@gorhom/portal" "1.0.14" invariant "^2.2.4"