Skip to content

Commit 10e869f

Browse files
committed
update default timing for narrow pane modals on IOS
1 parent 5373878 commit 10e869f

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/CONST/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,8 @@ const CONST = {
14561456
ANIMATION_TIMING: {
14571457
DEFAULT_IN: 300,
14581458
DEFAULT_OUT: 200,
1459+
DEFAULT_RIGHT_DOCKED_IOS_IN: 500,
1460+
DEFAULT_RIGHT_DOCKED_IOS_OUT: 400,
14591461
FAB_IN: 350,
14601462
FAB_OUT: 200,
14611463
},

src/components/Modal/index.ios.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import React from 'react';
2+
import useResponsiveLayout from '@hooks/useResponsiveLayout';
3+
import CONST from '@src/CONST';
24
import BaseModal from './BaseModal';
35
import type BaseModalProps from './types';
46

57
function Modal({children, ...rest}: BaseModalProps) {
8+
const {isInNarrowPaneModal} = useResponsiveLayout();
9+
const animationInTiming = rest.animationInTiming ?? (isInNarrowPaneModal ? CONST.MODAL.ANIMATION_TIMING.DEFAULT_RIGHT_DOCKED_IOS_IN : undefined);
10+
const animationOutTiming = rest.animationOutTiming ?? (isInNarrowPaneModal ? CONST.MODAL.ANIMATION_TIMING.DEFAULT_RIGHT_DOCKED_IOS_OUT : undefined);
11+
612
return (
713
<BaseModal
814
useNativeDriver
915
// eslint-disable-next-line react/jsx-props-no-spreading
1016
{...rest}
17+
animationInTiming={animationInTiming}
18+
animationOutTiming={animationOutTiming}
1119
>
1220
{children}
1321
</BaseModal>

0 commit comments

Comments
 (0)