Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
staszekscp committed May 15, 2023
1 parent fb4968f commit 5175d8b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
30 changes: 30 additions & 0 deletions patches/@react-navigation+stack+6.3.16.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
diff --git a/node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx b/node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx
index 1e9ee0e..d85c7b4 100644
--- a/node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx
+++ b/node_modules/@react-navigation/stack/src/views/Stack/CardContainer.tsx
@@ -105,14 +105,14 @@ function CardContainer({
const handleOpen = () => {
const { route } = scene.descriptor;

- onTransitionEnd({ route }, false);
+ onTransitionEnd({ route }, false, scene.descriptor.navigation.getState());
onOpenRoute({ route });
};

const handleClose = () => {
const { route } = scene.descriptor;

- onTransitionEnd({ route }, true);
+ onTransitionEnd({ route }, true, scene.descriptor.navigation.getState());
onCloseRoute({ route });
};

@@ -120,7 +120,7 @@ function CardContainer({
const { route } = scene.descriptor;

onPageChangeStart();
- onGestureStart({ route });
+ onGestureStart({ route }, scene.descriptor.navigation.getState());
};

const handleGestureCanceled = () => {
diff --git a/node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx b/node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx
index 6bbce10..5139382 100644
--- a/node_modules/@react-navigation/stack/src/views/Stack/StackView.tsx
Expand Down
7 changes: 7 additions & 0 deletions tests/utils/LHNTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {LocaleContextProvider} from '../../src/components/withLocalize';
import SidebarLinks from '../../src/pages/home/sidebar/SidebarLinks';
import CONST from '../../src/CONST';
import DateUtils from '../../src/libs/DateUtils';
import {CurrentReportIdContextProvider} from '../../src/components/withCurrentReportId';

// we have to mock `useIsFocused` because it's used in the SidebarLinks component
const mockedNavigate = jest.fn();
Expand All @@ -16,6 +17,11 @@ jest.mock('@react-navigation/native', () => {
useIsFocused: () => ({
navigate: mockedNavigate,
}),
useNavigation: () => ({
navigate: jest.fn(),
addListener: jest.fn(),
}),
createNavigationContainerRef: jest.fn(),
};
});

Expand Down Expand Up @@ -156,6 +162,7 @@ function getDefaultRenderedSidebarLinks(reportIDFromRoute = '') {
components={[
OnyxProvider,
LocaleContextProvider,
CurrentReportIdContextProvider,
]}
>
<ErrorBoundary>
Expand Down

0 comments on commit 5175d8b

Please sign in to comment.