Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
517758e
Add web-only floating RHP style
BartekObudzinski Sep 14, 2026
0519f3f
fix: round the corners of stacked RHP cards
BartekObudzinski Sep 15, 2026
2d75c24
Merge remote-tracking branch 'upstream/main' into web-only-plan-issue…
BartekObudzinski Sep 15, 2026
1da5a71
fix: compensate the floating RHP border and remove dead overlay styles
BartekObudzinski Sep 15, 2026
2ffecd8
refactor: split the RHP frame style per platform and share the overla…
BartekObudzinski Sep 15, 2026
1fb99ee
refactor: draw the RHP border and scrim on each stacked card instead …
BartekObudzinski Sep 15, 2026
d17c833
fix: clip the floating RHP card to its inset frame
BartekObudzinski Sep 16, 2026
f778c71
fix: slide-and-fade a skinny RHP pushed over a wide card
BartekObudzinski Sep 16, 2026
da4fe1e
fix: keep the floating RHP card shadow when a card is stacked on top
BartekObudzinski Sep 17, 2026
fa04497
fix: disable react-navigation's card overlay on the web RHP
BartekObudzinski Sep 17, 2026
3c6b355
docs: tighten the keep-card-overflow-visible patch notes
BartekObudzinski Sep 17, 2026
f105e3a
test: repin super wide RHP width literals to the 360px left margin
BartekObudzinski Sep 17, 2026
d9eab7c
fix: clip inactive stack cards inside Card so the buried RHP shadow s…
BartekObudzinski Sep 17, 2026
e4abecc
docs: shorten the floating RHP comments
BartekObudzinski Sep 17, 2026
2eeb57c
fix: keep one shadow under a right docked picker stacked on the RHP
BartekObudzinski Sep 17, 2026
cb436a1
docs(BaseOverlay): document maxOpacity/positionTop/positionBottom props
BartekObudzinski Sep 21, 2026
becf107
fix(MFA): float the two-factor security-code panel on web
BartekObudzinski Sep 21, 2026
e75bc81
docs: record where the inactive-card clip fix landed upstream
BartekObudzinski Sep 21, 2026
41f078c
Merge remote-tracking branch 'upstream/main' into web-only-plan-issue…
BartekObudzinski Sep 22, 2026
feb0509
Make the dimmed RHP margin dismiss one level for every card width
BartekObudzinski Sep 22, 2026
a58dbc5
Merge remote-tracking branch 'upstream/main' into web-only-plan-issue…
BartekObudzinski Sep 23, 2026
9e43178
fix: keep the super wide RHP wide enough for its panes
BartekObudzinski Sep 23, 2026
db4e0f4
Fix unused variable in the Side Panel shrink test
BartekObudzinski Sep 23, 2026
1a3cf00
fix(RHP): keep the Side Panel shrink off native NaN
BartekObudzinski Sep 23, 2026
fd79f3b
Fix cspell unknown words in the RHP test comments
BartekObudzinski Sep 23, 2026
490b59e
fix(RHP): drop two needless eslint-disable overrides
BartekObudzinski Sep 24, 2026
d964ca0
Merge remote-tracking branch 'upstream/main' into web-only-plan-issue…
BartekObudzinski Sep 24, 2026
31c25b4
fix(RHP): match the 2FA scrim to the RHP dim
BartekObudzinski Sep 24, 2026
d49a0bc
fix(RHP): charge the floating card margin in the wide RHP width cap
BartekObudzinski Sep 25, 2026
36b20cd
test(RHP): update super wide floor for the charged card margin
BartekObudzinski Sep 25, 2026
d6c50b8
fix(RHP): charge the card border in the receipt pane floor too
BartekObudzinski Sep 28, 2026
42db57b
fix(RHP): dim right docked sheets like the RHP on wide web
BartekObudzinski Sep 28, 2026
29ae543
Merge remote-tracking branch 'upstream/main' into web-only-plan-issue…
BartekObudzinski Sep 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been fixed in react-navigation directly react-navigation/react-navigation#13255 . Should be published in @react-navigation/stack@7.11.2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup issue #101715

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny Could you advise on this case? I think we should use this patch so we don't need to wait for #101715 to be completed. We can include the @react-navigation/stack@7.11.2 upgrade as part of #101715.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right! I forget to mention we agreed with @mountiny to bump this as a part of #101715 and now ship it with the patch

@huult huult Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIY @grgia

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah happy to use the patch and then update

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js b/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js
--- a/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js
+++ b/node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js
@@ -48,6 +48,7 @@ function Card({
gestureVelocityImpact = GESTURE_VELOCITY_IMPACT,
overlay = defaultOverlay,
animated,
+ active,
interpolationIndex,
opening,
closing,
@@ -375,7 +376,11 @@ function Card({
children: /*#__PURE__*/_jsxs(Animated.View, {
pointerEvents: "box-none",
needsOffscreenAlphaCompositing: hasOpacityStyle(cardStyle),
- style: [styles.container, cardStyle],
+ style: [styles.container, {
+ // Avoid unfocused larger pages increasing scroll area
+ // e.g. when a smaller screen is pushed over a larger one on web
+ overflow: active ? undefined : 'hidden'
+ }, cardStyle],
children: [shadowEnabled && shadowStyle && !isTransparent ? /*#__PURE__*/_jsx(Animated.View, {
pointerEvents: "none",
style: [styles.shadow, gestureDirection === 'horizontal' ? [styles.shadowHorizontal, styles.shadowStart] : gestureDirection === 'horizontal-inverted' ? [styles.shadowHorizontal, styles.shadowEnd] : gestureDirection === 'vertical' ? [styles.shadowVertical, styles.shadowTop] : [styles.shadowVertical, styles.shadowBottom], {
diff --git a/node_modules/@react-navigation/stack/lib/module/views/Stack/CardA11yWrapper.js b/node_modules/@react-navigation/stack/lib/module/views/Stack/CardA11yWrapper.js
--- a/node_modules/@react-navigation/stack/lib/module/views/Stack/CardA11yWrapper.js
+++ b/node_modules/@react-navigation/stack/lib/module/views/Stack/CardA11yWrapper.js
@@ -22,9 +22,6 @@ export const CardA11yWrapper = /*#__PURE__*/React.forwardRef(({
"aria-hidden": !focused,
pointerEvents: (animated ? inert : !focused) ? 'none' : 'box-none',
style: [StyleSheet.absoluteFill, {
- // This is necessary to avoid unfocused larger pages increasing scroll area
- // The issue can be seen on the web when a smaller screen is pushed over a larger one
- overflow: active ? undefined : 'hidden',
// We use visibility on web
display: Platform.OS !== 'web' && isHidden ? 'none' : 'flex',
zIndex: Platform.OS === 'web' ? 'auto' : undefined,
diff --git a/node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js b/node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js
--- a/node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js
+++ b/node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js
@@ -198,6 +198,7 @@ function CardContainerInner({
detachCurrentScreen: detachCurrentScreen,
children: /*#__PURE__*/_jsx(Card, {
animated: animated,
+ active: active,
interpolationIndex: interpolationIndex,
gestureDirection: gestureDirection,
layout: layout,
11 changes: 11 additions & 0 deletions patches/react-navigation/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,14 @@
- Upstream PR/issue: https://github.com/react-navigation/react-navigation/issues/11145
- E/App issue: [#94571](https://github.com/Expensify/App/issues/94571)
- PR Introducing Patch: [#95980](https://github.com/Expensify/App/pull/95980)

### [@react-navigation+stack+7.8.5+005+clip-inactive-card-inside-card.patch](@react-navigation+stack+7.8.5+005+clip-inactive-card-inside-card.patch)

- Reason: On the web floating RHP each stacked card draws its own drop shadow through the interpolator's `cardStyle` (`getRHPExtendedCardFrame`). `CardA11yWrapper` puts `overflow: hidden` on every card that is not on top, and the wrapper is sized to the navigator frame, so it clips the shadow of the card under the focused one. Opening an expense over an expense report cut the report card's left and bottom shadow. The patch moves that clip from `CardA11yWrapper` to the `Animated.View` in `Card` that receives `cardStyle`. That view paints the shadow, and `overflow: hidden` does not clip an element's own shadow, so the shadow stays and the content is still clipped. `CardContainer` passes `active` down to `Card`.
- Upstream PR/issue: https://github.com/react-navigation/react-navigation/issues/13254, fix in https://github.com/react-navigation/react-navigation/pull/13255. Upstream declined an opt-out option and asked for this instead. The patch is that change applied to the compiled 7.8.5 output.
- E/App issue: N/A, the patch came out of the internal web floating-RHP styling work. Removing it is tracked in [#101715](https://github.com/Expensify/App/issues/101715), the react-navigation upgrade.
- PR Introducing Patch: [#101093](https://github.com/callstack-internal/Expensify-App/pull/101093)
- PR Updating Patch: N/A
- Note: Not gated to the RHP. Every stack now clips inactive cards one level lower, so the built-in `styles.shadow` edge view inside `Card` is clipped on inactive cards too. The active card covers that edge.
- Note: Upstream shipped the fix in `@react-navigation/stack` 7.11.2, first release containing https://github.com/react-navigation/react-navigation/pull/13255. Their shape differs from ours: `CardA11yWrapper` drops `overflow` completely, and `CardContainer` passes `pageOverflowEnabled: active && headerMode !== 'float' && presentation !== 'modal'`, so the clip lands in `CardContent`, whose `styles.card` still carries `overflow: 'hidden'`. Inactive cards stay clipped and the stacked RHP shadow survives, but the clip sits one level below ours, which leaves the built-in `styles.shadow` edge view unclipped on inactive cards.
- Note: Drop this patch by moving to `stack` 7.11.2 or newer, see #101715 above. It cannot be bumped on its own: `createStackNavigator` there reads `render` from `useNavigationBuilder`, which starts in `core` 7.22.1, and `elements` 2.9.43 plus every sibling declare `native ^7.4.1` as a peer, so npm rejects 7.11.2 next to our `native` 7.1.33. `stack+001+edge-drag-gesture` and `stack+002+dontDetachScreen` need hand-porting to 7.11.2 because it rewrote the gesture and animation lifecycle in `Card.js` and switched the gesture wrapper to `pointerEvents: "auto"`.
18 changes: 12 additions & 6 deletions src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import NarrowPaneContext from '@libs/Navigation/AppNavigator/Navigators/NarrowPa
import Overlay from '@libs/Navigation/AppNavigator/Navigators/Overlay';
import Navigation from '@libs/Navigation/Navigation';

import variables from '@styles/variables';

import {areAllModalsHidden, closeTop, onModalDidClose, setCloseModal, setModalCovering, setModalVisibility, willAlertModalBecomeVisible} from '@userActions/Modal';

import CONST from '@src/CONST';
Expand Down Expand Up @@ -248,6 +250,11 @@ function BaseModal({
setModalHeight(e.nativeEvent.layout.height);
};

const {isInNarrowPane} = useContext(NarrowPaneContext);

// A right docked modal opened from inside the RHP sits on the RHP's own card, so it must not dim it or add a second shadow.
const isStackedOnRHP = type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED && !isSmallScreenWidth && (isInNarrowPane || isInNarrowPaneModal) && !shouldKeepRightDockedBackdropInNarrowPane;

const {
modalStyle,
modalContainerStyle,
Expand Down Expand Up @@ -276,6 +283,7 @@ function BaseModal({
},
enableEdgeToEdgeBottomSafeAreaPadding,
shouldDisplayBelowModals,
isStackedOnRHP,
});

// When the `enableEdgeToEdgeBottomSafeAreaPadding` prop is explicitly set, we enable edge-to-edge mode.
Expand All @@ -292,16 +300,14 @@ function BaseModal({
});
const modalPaddingStyles = shouldUseModalPaddingStyle ? paddings : {paddingLeft: paddings.paddingLeft, paddingRight: paddings.paddingRight};

const {isInNarrowPane} = useContext(NarrowPaneContext);

const shouldSuppressRightDockedBackdrop =
type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED && !isSmallScreenWidth && (isInNarrowPane || isInNarrowPaneModal) && !shouldKeepRightDockedBackdropInNarrowPane;
const isFullWidthNarrowSheet =
(type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED || type === CONST.MODAL.MODAL_TYPE.CENTERED_SWIPEABLE_TO_RIGHT) && isSmallScreenWidth && !shouldKeepRightDockedBackdropInNarrowPane;
// A right docked sheet floats like the RHP on wide web, so it dims the page as lightly as the RHP does.
const rightDockedBackdropOpacity = type === CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED && !isSmallScreenWidth ? variables.rhpOverlayOpacity : undefined;
const backdropOpacityAdjusted =
!shouldShowBackdrop && (hideBackdrop || shouldSuppressRightDockedBackdrop || isFullWidthNarrowSheet) // full-width narrow sheets (RHP-like) shouldn't dim a backdrop behind them
!shouldShowBackdrop && (hideBackdrop || isStackedOnRHP || isFullWidthNarrowSheet) // full-width narrow sheets (RHP-like) shouldn't dim a backdrop behind them
? 0
: backdropOpacity;
: (backdropOpacity ?? rightDockedBackdropOpacity);

const dragArea = type === CONST.MODAL.MODAL_TYPE.CENTERED || type === CONST.MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE ? undefined : false;

Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/ReanimatedModal/Backdrop/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ function Backdrop({
if (!backdropOpacity) {
return;
}
const FadeIn = new Keyframe(getModalInAnimation('fadeIn'));
const FadeIn = new Keyframe(getModalInAnimation('fadeIn', backdropOpacity));
return FadeIn.duration(animationInTiming).reduceMotion(ReduceMotion.Never);
}, [animationInTiming, backdropOpacity]);

const Exiting = useMemo(() => {
if (!backdropOpacity) {
return;
}
const FadeOut = new Keyframe(getModalOutAnimation('fadeOut'));
const FadeOut = new Keyframe(getModalOutAnimation('fadeOut', backdropOpacity));
return FadeOut.duration(animationOutTiming).reduceMotion(ReduceMotion.Never);
}, [animationOutTiming, backdropOpacity]);

Expand Down
8 changes: 4 additions & 4 deletions src/components/Modal/ReanimatedModal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {AnimationIn, AnimationOut} from './types';

const easing = Easing.bezier(0.76, 0.0, 0.24, 1.0).factory();

function getModalInAnimation(animationType: AnimationIn): ValidKeyframeProps {
function getModalInAnimation(animationType: AnimationIn, fadeOpacity: number = variables.overlayOpacity): ValidKeyframeProps {
switch (animationType) {
case 'slideInRight':
return {
Expand All @@ -33,7 +33,7 @@ function getModalInAnimation(animationType: AnimationIn): ValidKeyframeProps {
return {
from: {opacity: 0},
to: {
opacity: variables.overlayOpacity,
opacity: fadeOpacity,
easing,
},
};
Expand Down Expand Up @@ -69,7 +69,7 @@ function getModalInAnimationStyle(animationType: AnimationIn): (progress: number
}
}

function getModalOutAnimation(animationType: AnimationOut): ValidKeyframeProps {
function getModalOutAnimation(animationType: AnimationOut, fadeOpacity: number = variables.overlayOpacity): ValidKeyframeProps {
switch (animationType) {
case 'slideOutRight':
return {
Expand All @@ -89,7 +89,7 @@ function getModalOutAnimation(animationType: AnimationOut): ValidKeyframeProps {
};
case 'fadeOut':
return {
from: {opacity: variables.overlayOpacity},
from: {opacity: fadeOpacity},
to: {
opacity: 0,
easing,
Expand Down
2 changes: 1 addition & 1 deletion src/components/QRShare/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function QRShare({
const theme = useTheme();
const {shouldUseNarrowLayout, isInLandscapeMode} = useResponsiveLayout();
const {windowWidth, windowHeight} = useWindowDimensions();
const qrCodeContainerWidth = shouldUseNarrowLayout ? windowWidth : variables.sideBarWidth;
const qrCodeContainerWidth = shouldUseNarrowLayout ? windowWidth : variables.rhpWidth;
const icons = useMemoizedLazyExpensifyIcons(['ExpensifyWordmark']);

const landscapeQrCodeSize = isInLandscapeMode ? Math.min(QR_CODE_LANDSCAPE_SIZE_RATIO * windowHeight, MAX_QR_CODE_LANDSCAPE_SIZE) : undefined;
Expand Down
5 changes: 0 additions & 5 deletions src/components/WideRHPContextProvider/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ const animatedReceiptPaneRHPWidth = new Animated.Value(0);
const animatedWideRHPWidth = new Animated.Value(0);
const animatedSuperWideRHPWidth = new Animated.Value(0);

const modalStackOverlaySuperWideRHPPositionLeft = new Animated.Value(0);
const modalStackOverlayWideRHPPositionLeft = new Animated.Value(0);

const expandedRHPProgress = new Animated.Value(0);

const WideRHPStateContext = createContext<WideRHPStateContextType>(defaultWideRHPStateContextValue);
Expand Down Expand Up @@ -47,8 +44,6 @@ export {
animatedSuperWideRHPWidth,
animatedWideRHPWidth,
expandedRHPProgress,
modalStackOverlaySuperWideRHPPositionLeft,
modalStackOverlayWideRHPPositionLeft,
secondOverlayRHPOnSuperWideRHPProgress,
secondOverlayRHPOnWideRHPProgress,
secondOverlayWideRHPProgress,
Expand Down
19 changes: 5 additions & 14 deletions src/components/WideRHPContextProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import useRootNavigationState from '@hooks/useRootNavigationState';

import calculateReceiptPaneRHPWidth from '@libs/Navigation/helpers/calculateReceiptPaneRHPWidth';
import calculateSuperWideRHPWidth from '@libs/Navigation/helpers/calculateSuperWideRHPWidth';
import calculateWideRHPWidth from '@libs/Navigation/helpers/calculateWideRHPWidth';
import type {NavigationRoute} from '@libs/Navigation/types';

import variables from '@styles/variables';

import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -39,19 +38,14 @@ const thirdOverlayProgress = new Animated.Value(0);
const receiptPaneRHPWidth = calculateReceiptPaneRHPWidth(Dimensions.get('window').width);

// Static values of all RHP widths
const singleRHPWidth = variables.sideBarWidth;
const superWideRHPWidth = calculateSuperWideRHPWidth(Dimensions.get('window').width);
const wideRHPWidth = receiptPaneRHPWidth + singleRHPWidth;
const wideRHPWidth = calculateWideRHPWidth(Dimensions.get('window').width);

// This animated value is necessary to have responsive RHP widths
const animatedReceiptPaneRHPWidth = new Animated.Value(receiptPaneRHPWidth);
const animatedSuperWideRHPWidth = new Animated.Value(superWideRHPWidth);
const animatedWideRHPWidth = new Animated.Value(wideRHPWidth);

// The left position values of overlays displayed in ModalStackNavigators. A detailed description of how these positions are calculated can be found in src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx
const modalStackOverlayWideRHPPositionLeft = new Animated.Value(superWideRHPWidth - wideRHPWidth);
const modalStackOverlaySuperWideRHPPositionLeft = new Animated.Value(superWideRHPWidth - singleRHPWidth);

const WideRHPStateContext = createContext<WideRHPStateContextType>(defaultWideRHPStateContextValue);
const WideRHPActionsContext = createContext<WideRHPActionsContextType>(defaultWideRHPActionsContextValue);

Expand Down Expand Up @@ -191,7 +185,8 @@ function WideRHPContextProvider({children}: React.PropsWithChildren) {
/**
* Effect that manages the tertiary overlay animation and rendering state.
*/
const shouldRenderTertiaryOverlay = useShouldRenderOverlay(isRHPFocused && isWideRHPBelow && isSuperWideRHPBelow, thirdOverlayProgress);
// react-navigation's card wrapper swallows clicks on the dimmed area, so the overlay from the screen below can't catch them when a skinny RHP sits over a wide or super wide one.
const shouldRenderTertiaryOverlay = useShouldRenderOverlay(isRHPFocused && (isWideRHPBelow || isSuperWideRHPBelow), thirdOverlayProgress);

/**
* Removes the route from both wide and super-wide sets. Used on screen unmount.
Expand Down Expand Up @@ -274,11 +269,9 @@ function WideRHPContextProvider({children}: React.PropsWithChildren) {
const windowWidth = Dimensions.get('window').width;
const newReceiptPaneRHPWidth = calculateReceiptPaneRHPWidth(windowWidth);
const newSuperWideRHPWidth = calculateSuperWideRHPWidth(windowWidth);
const newWideRHPWidth = newReceiptPaneRHPWidth + singleRHPWidth;
const newWideRHPWidth = calculateWideRHPWidth(windowWidth);
animatedReceiptPaneRHPWidth.setValue(newReceiptPaneRHPWidth);
animatedWideRHPWidth.setValue(newWideRHPWidth);
modalStackOverlayWideRHPPositionLeft.setValue(newSuperWideRHPWidth - newWideRHPWidth);
modalStackOverlaySuperWideRHPPositionLeft.setValue(newSuperWideRHPWidth - singleRHPWidth);
animatedSuperWideRHPWidth.setValue(newSuperWideRHPWidth);
};

Expand Down Expand Up @@ -341,8 +334,6 @@ export {
animatedSuperWideRHPWidth,
animatedWideRHPWidth,
expandedRHPProgress,
modalStackOverlaySuperWideRHPPositionLeft,
modalStackOverlayWideRHPPositionLeft,
secondOverlayWideRHPProgress,
secondOverlayRHPOnWideRHPProgress,
secondOverlayRHPOnSuperWideRHPProgress,
Expand Down
30 changes: 13 additions & 17 deletions src/components/WideRHPOverlayWrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import {
animatedReceiptPaneRHPWidth,
modalStackOverlaySuperWideRHPPositionLeft,
modalStackOverlayWideRHPPositionLeft,
secondOverlayRHPOnSuperWideRHPProgress,
secondOverlayRHPOnWideRHPProgress,
secondOverlayWideRHPProgress,
useWideRHPState,
} from '@components/WideRHPContextProvider';
import {secondOverlayRHPOnSuperWideRHPProgress, secondOverlayRHPOnWideRHPProgress, secondOverlayWideRHPProgress, useWideRHPState} from '@components/WideRHPContextProvider';

import useResponsiveLayout from '@hooks/useResponsiveLayout';

import Overlay from '@libs/Navigation/AppNavigator/Navigators/Overlay';
import RHPOverlay from '@libs/Navigation/AppNavigator/Navigators/Overlay/RHPOverlay';
import Navigation from '@libs/Navigation/Navigation';

import {useRoute} from '@react-navigation/native';
import React from 'react';
Expand Down Expand Up @@ -40,30 +33,33 @@ function SecondaryOverlay() {
* 2. Single RHP is displayed on Super Wide RHP
* 3. Wide RHP is displayed on Super Wide RHP route.
* */
// Rendered by the screen below, so the dim clips to its rounded corners and a press dismisses to it.
if (isRHPDisplayedOnWideRHP) {
return (
<Overlay
<RHPOverlay
progress={secondOverlayRHPOnWideRHPProgress}
// If RHP is displayed on Wide RHP which is displayed above the Super Wide RHP, the secondary overlay's position left should be calculated from the left edge of the super wide RHP.
positionLeftValue={animatedReceiptPaneRHPWidth}
positionLeftValue={0}
onPress={Navigation.dismissToPreviousRHP}
/>
);
}

if (isWideRHPDisplayedOnSuperWideRHP) {
return (
<Overlay
<RHPOverlay
progress={secondOverlayWideRHPProgress}
positionLeftValue={modalStackOverlayWideRHPPositionLeft}
positionLeftValue={0}
onPress={() => Navigation.closeRHPFlow()}
/>
);
}

if (isRHPDisplayedOnSuperWideRHP) {
return (
<Overlay
<RHPOverlay
progress={secondOverlayRHPOnSuperWideRHPProgress}
positionLeftValue={modalStackOverlaySuperWideRHPPositionLeft}
positionLeftValue={0}
onPress={Navigation.dismissToSuperWideRHP}
/>
);
}
Expand Down
Loading
Loading