diff --git a/src/components/FocusTrap/TOP_TAB_SCREENS.ts b/src/components/FocusTrap/TOP_TAB_SCREENS.ts index 6bee36b86883..34610c4b0f11 100644 --- a/src/components/FocusTrap/TOP_TAB_SCREENS.ts +++ b/src/components/FocusTrap/TOP_TAB_SCREENS.ts @@ -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; + +export type {TopTabScreen}; export default TOP_TAB_SCREENS; diff --git a/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts b/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts index 218661632896..a9ce45214e5f 100644 --- a/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts +++ b/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts @@ -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'; @@ -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; type RHPScreenOpenedFromLHN = TupleToUnion;