Skip to content

Commit

Permalink
Merge pull request #50200 from tsa321/screensOpenedFromLHN
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous authored Oct 16, 2024
2 parents 19b489c + c3cec97 commit fd2e0cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/components/FocusTrap/TOP_TAB_SCREENS.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type {TupleToUnion} from 'type-fest';
import CONST from '@src/CONST';

const TOP_TAB_SCREENS: string[] = [CONST.TAB.NEW_CHAT, CONST.TAB.NEW_ROOM, CONST.TAB_REQUEST.DISTANCE, CONST.TAB_REQUEST.MANUAL, CONST.TAB_REQUEST.SCAN];
const TOP_TAB_SCREENS = [CONST.TAB.NEW_CHAT, CONST.TAB.NEW_ROOM, CONST.TAB_REQUEST.DISTANCE, CONST.TAB_REQUEST.MANUAL, CONST.TAB_REQUEST.SCAN] as const;

type TopTabScreen = TupleToUnion<typeof TOP_TAB_SCREENS>;

export type {TopTabScreen};

export default TOP_TAB_SCREENS;
6 changes: 5 additions & 1 deletion src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {NavigationState, PartialState, Route} from '@react-navigation/nativ
import {findFocusedRoute, getStateFromPath} from '@react-navigation/native';
import pick from 'lodash/pick';
import type {TupleToUnion} from 'type-fest';
import type {TopTabScreen} from '@components/FocusTrap/TOP_TAB_SCREENS';
import {isAnonymousUser} from '@libs/actions/Session';
import getIsNarrowLayout from '@libs/getIsNarrowLayout';
import type {BottomTabName, CentralPaneName, FullScreenName, NavigationPartialRoute, RootStackParamList} from '@libs/Navigation/types';
Expand Down Expand Up @@ -29,7 +30,10 @@ const RHP_SCREENS_OPENED_FROM_LHN = [
SCREENS.SETTINGS.EXIT_SURVEY.REASON,
SCREENS.SETTINGS.EXIT_SURVEY.RESPONSE,
SCREENS.SETTINGS.EXIT_SURVEY.CONFIRM,
] satisfies Screen[];
CONST.TAB_REQUEST.DISTANCE,
CONST.TAB_REQUEST.MANUAL,
CONST.TAB_REQUEST.SCAN,
] satisfies Array<Screen | TopTabScreen>;

type RHPScreenOpenedFromLHN = TupleToUnion<typeof RHP_SCREENS_OPENED_FROM_LHN>;

Expand Down

0 comments on commit fd2e0cb

Please sign in to comment.