Temp action sheet fix for Android

This commit is contained in:
Diego Mello 2024-04-05 09:16:28 -03:00
parent 1c7ee34d03
commit 25b4250ab9
3 changed files with 9 additions and 8 deletions

View File

@ -32,13 +32,14 @@ const ActionSheet = React.memo(
const [data, setData] = useState<TActionSheetOptions>({} as TActionSheetOptions);
const [isVisible, setVisible] = useState(false);
const animatedContentHeight = useSharedValue(0);
const animatedHandleHeight = useSharedValue(0);
// const animatedHandleHeight = useSharedValue(0);
const animatedDataSnaps = useSharedValue<TActionSheetOptions['snaps']>([]);
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}

View File

@ -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",

View File

@ -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"