diff --git a/src/components/AvatarCropModal/AvatarCropModal.tsx b/src/components/AvatarCropModal/AvatarCropModal.tsx index aa2b98cdae6d6..0f6cbfff2b7d3 100644 --- a/src/components/AvatarCropModal/AvatarCropModal.tsx +++ b/src/components/AvatarCropModal/AvatarCropModal.tsx @@ -352,6 +352,7 @@ function AvatarCropModal({imageUri = '', imageName = '', imageType = '', onClose shouldUseCustomBackdrop shouldHandleNavigationBack enableEdgeToEdgeBottomSafeAreaPadding + shouldUseReanimatedModal > { @@ -351,12 +368,12 @@ function BaseModal( initialFocus={initialFocus} shouldPreventScroll={shouldPreventScrollOnFocus} > - {children} - + {!keyboardStateContextValue?.isKeyboardActive && } diff --git a/src/components/SidePanel/HelpComponents/HelpOverlay.tsx b/src/components/SidePanel/HelpComponents/HelpOverlay.tsx index 07621c84ce3ae..76fdc321e92f2 100644 --- a/src/components/SidePanel/HelpComponents/HelpOverlay.tsx +++ b/src/components/SidePanel/HelpComponents/HelpOverlay.tsx @@ -1,5 +1,6 @@ -import React from 'react'; -import Animated, {Easing, Keyframe} from 'react-native-reanimated'; +import React, {useMemo} from 'react'; +import Animated, {Keyframe} from 'react-native-reanimated'; +import {getModalInAnimation, getModalOutAnimation} from '@components/Modal/ReanimatedModal/utils'; import {PressableWithoutFeedback} from '@components/Pressable'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -13,27 +14,13 @@ type HelpOverlayProps = { onBackdropPress: () => void; }; -const easing = Easing.bezier(0.76, 0.0, 0.24, 1.0).factory(); - function HelpOverlay({isRHPVisible, onBackdropPress}: HelpOverlayProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); - const CustomFadeIn = new Keyframe({ - from: {opacity: 0}, - to: { - opacity: 0.72, - easing, - }, - }).duration(CONST.MODAL.ANIMATION_TIMING.DEFAULT_IN); - - const CustomFadeOut = new Keyframe({ - from: {opacity: 0.72}, - to: { - opacity: 0, - easing, - }, - }).duration(CONST.MODAL.ANIMATION_TIMING.DEFAULT_OUT); + const CustomFadeIn = useMemo(() => new Keyframe(getModalInAnimation('fadeIn')).duration(CONST.MODAL.ANIMATION_TIMING.DEFAULT_IN), []); + + const CustomFadeOut = useMemo(() => new Keyframe(getModalOutAnimation('fadeOut')).duration(CONST.MODAL.ANIMATION_TIMING.DEFAULT_OUT), []); return ( diff --git a/src/components/SidePanel/HelpModal/index.ios.tsx b/src/components/SidePanel/HelpModal/index.ios.tsx index 4f8cf6c7a5317..052d50d56d0a9 100644 --- a/src/components/SidePanel/HelpModal/index.ios.tsx +++ b/src/components/SidePanel/HelpModal/index.ios.tsx @@ -13,6 +13,7 @@ function Help({shouldHideSidePanel, closeSidePanel}: HelpProps) { shouldHandleNavigationBack propagateSwipe swipeDirection={CONST.SWIPE_DIRECTION.RIGHT} + shouldUseReanimatedModal > diff --git a/src/hooks/useSidePanel.ts b/src/hooks/useSidePanel.ts index 2df4b1c5a0568..8e56da3bf89b0 100644 --- a/src/hooks/useSidePanel.ts +++ b/src/hooks/useSidePanel.ts @@ -71,6 +71,7 @@ function useSidePanel() { const shouldApplySidePanelOffset = isExtraLargeScreenWidth && !shouldHideSidePanel; const sidePanelOffset = useRef(new Animated.Value(shouldApplySidePanelOffset ? variables.sideBarWidth : 0)); const sidePanelTranslateX = useRef(new Animated.Value(shouldHideSidePanel ? sidePanelWidth : 0)); + useEffect(() => { setIsSidePanelTransitionEnded(false); Animated.parallel([ diff --git a/src/styles/utils/generators/ModalStyleUtils.ts b/src/styles/utils/generators/ModalStyleUtils.ts index f92f832f4d62c..8704b8705a8cc 100644 --- a/src/styles/utils/generators/ModalStyleUtils.ts +++ b/src/styles/utils/generators/ModalStyleUtils.ts @@ -19,6 +19,7 @@ type WindowDimensions = { windowWidth: number; windowHeight: number; isSmallScreenWidth: boolean; + shouldUseNarrowLayout?: boolean; }; type GetModalStyles = {