From 8cde82a3b46be471a797a82b90aab3275cb3b95b Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 7 Feb 2023 15:05:18 -0300 Subject: [PATCH] add commit --- app/containers/ActionSheet/Provider.tsx | 3 ++- app/containers/ReactionsList/calculatePadding.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/containers/ActionSheet/Provider.tsx b/app/containers/ActionSheet/Provider.tsx index c76f77e93..3284bd43c 100644 --- a/app/containers/ActionSheet/Provider.tsx +++ b/app/containers/ActionSheet/Provider.tsx @@ -1,5 +1,6 @@ import hoistNonReactStatics from 'hoist-non-react-statics'; import React, { ForwardedRef, forwardRef, useContext, useRef, useState } from 'react'; +import { BottomSheetProps } from '@gorhom/bottom-sheet'; import { TIconsName } from '../CustomIcon'; import ActionSheet from './ActionSheet'; @@ -53,7 +54,7 @@ export const ActionSheetProvider = React.memo(({ children }: { children: React.R const [actionSheetSnapIndex, setActionSheetSnapIndex] = useState(-1); const ref: ForwardedRef = useRef(null); - const onChange = (index: number) => setActionSheetSnapIndex(index); + const onChange: BottomSheetProps['onChange'] = index => setActionSheetSnapIndex(index); const getContext = () => ({ showActionSheet: (options: TActionSheetOptions) => { diff --git a/app/containers/ReactionsList/calculatePadding.ts b/app/containers/ReactionsList/calculatePadding.ts index 74d930686..a53597b3f 100644 --- a/app/containers/ReactionsList/calculatePadding.ts +++ b/app/containers/ReactionsList/calculatePadding.ts @@ -1,4 +1,9 @@ const HEADER_HEIGHT = 48; +/** + * This SNAP_PERCENTAGE is calculate between the snaps: ['50%', '80%'] + * so considering the content size is set to 80% and the first snap is 50% + * we need to 50% * 80% = 40% + */ const SNAP_PERCENTAGE = 0.4; /** * This function is required for the ReactionsList to see the full list and the scroll enables,