Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,10 @@ const ROUTES = {
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (domain: string, backTo?: string) => getUrlWithBackToParam(`travel/${domain}/workspace-address`, backTo),
},
TRAVEL_VERIFY_ACCOUNT: {
route: `travel/:domain/${VERIFY_ACCOUNT}`,
getRoute: (domain: string) => `travel/${domain}/${VERIFY_ACCOUNT}` as const,
},
ONBOARDING_ROOT: {
route: 'onboarding',

Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const SCREENS = {
PUBLIC_DOMAIN_ERROR: 'Travel_PublicDomainError',
WORKSPACE_ADDRESS: 'Travel_WorkspaceAddress',
TRAVEL_DOT_LINK_WEB_VIEW: 'Travel_DotLinkWebView',
VERIFY_ACCOUNT: 'Travel_VerifyAccount',
},
SEARCH: {
ROOT: 'Search_Root',
Expand Down
2 changes: 1 addition & 1 deletion src/components/BookTravelButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
Navigation.navigate(ROUTES.TRAVEL_TCS.getRoute(domain));
return;
}
Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(Navigation.getActiveRoute(), ROUTES.TRAVEL_TCS.getRoute(domain)));
Navigation.navigate(ROUTES.TRAVEL_VERIFY_ACCOUNT.getRoute(domain));
};

function BookTravelButton({text, shouldRenderErrorMessageBelowButton = false, setShouldScrollToBottom}: BookTravelButtonProps) {
Expand Down Expand Up @@ -136,7 +136,7 @@
} else {
Navigation.navigate(ROUTES.TRAVEL_DOMAIN_SELECTOR.getRoute(Navigation.getActiveRoute()));
}
}, [

Check warning on line 139 in src/components/BookTravelButton.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useCallback has unnecessary dependencies: 'StyleUtils' and 'styles.flexRow'. Either exclude them or remove the dependency array

Check warning on line 139 in src/components/BookTravelButton.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has unnecessary dependencies: 'StyleUtils' and 'styles.flexRow'. Either exclude them or remove the dependency array
primaryContactMethod,
policy,
groupPaidPolicies.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ const TravelModalStackNavigator = createModalStackNavigator<TravelNavigatorParam
[SCREENS.TRAVEL.DOMAIN_PERMISSION_INFO]: () => require<ReactComponentModule>('../../../../pages/Travel/DomainPermissionInfoPage').default,
[SCREENS.TRAVEL.PUBLIC_DOMAIN_ERROR]: () => require<ReactComponentModule>('../../../../pages/Travel/PublicDomainErrorPage').default,
[SCREENS.TRAVEL.WORKSPACE_ADDRESS]: () => require<ReactComponentModule>('../../../../pages/Travel/WorkspaceAddressForTravelPage').default,
[SCREENS.TRAVEL.VERIFY_ACCOUNT]: () => require<ReactComponentModule>('../../../../pages/Travel/VerifyAccountPage').default,
});

const SplitDetailsModalStackNavigator = createModalStackNavigator<SplitDetailsNavigatorParamList>({
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,7 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.TRAVEL.DOMAIN_PERMISSION_INFO]: ROUTES.TRAVEL_DOMAIN_PERMISSION_INFO.route,
[SCREENS.TRAVEL.PUBLIC_DOMAIN_ERROR]: ROUTES.TRAVEL_PUBLIC_DOMAIN_ERROR.route,
[SCREENS.TRAVEL.WORKSPACE_ADDRESS]: ROUTES.TRAVEL_WORKSPACE_ADDRESS.route,
[SCREENS.TRAVEL.VERIFY_ACCOUNT]: ROUTES.TRAVEL_VERIFY_ACCOUNT.route,
},
},
[SCREENS.RIGHT_MODAL.SEARCH_REPORT]: {
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1861,6 +1861,9 @@ type TravelNavigatorParamList = {
[SCREENS.TRAVEL.DOMAIN_SELECTOR]: {
backTo?: Routes;
};
[SCREENS.TRAVEL.VERIFY_ACCOUNT]: {
domain: string;
};
};

type ReportsSplitNavigatorParamList = {
Expand Down
20 changes: 20 additions & 0 deletions src/pages/Travel/VerifyAccountPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type {StackScreenProps} from '@react-navigation/stack';
import React from 'react';
import type {TravelNavigatorParamList} from '@libs/Navigation/types';
import VerifyAccountPageBase from '@pages/settings/VerifyAccountPageBase';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';

type VerifyAccountPageProps = StackScreenProps<TravelNavigatorParamList, typeof SCREENS.TRAVEL.VERIFY_ACCOUNT>;

function VerifyAccountPage({route}: VerifyAccountPageProps) {
return (
<VerifyAccountPageBase
navigateBackTo={ROUTES.TRAVEL_MY_TRIPS}
navigateForwardTo={ROUTES.TRAVEL_TCS.getRoute(route.params.domain)}
/>
);
}

VerifyAccountPage.displayName = 'VerifyAccountPage';
export default VerifyAccountPage;
4 changes: 1 addition & 3 deletions src/pages/Travel/WorkspaceAddressForTravelPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ function WorkspaceAddressForTravelPage({route}: WorkspaceAddressForTravelPagePro
country: values.country,
});
if (!isUserValidated) {
Navigation.navigate(
ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(ROUTES.TRAVEL_MY_TRIPS, ROUTES.TRAVEL_TCS.getRoute(route.params.domain) ?? CONST.TRAVEL.DEFAULT_DOMAIN),
);
Navigation.navigate(ROUTES.TRAVEL_VERIFY_ACCOUNT.getRoute(route.params.domain));
return;
}
Navigation.navigate(ROUTES.TRAVEL_TCS.getRoute(route.params.domain ?? CONST.TRAVEL.DEFAULT_DOMAIN), {forceReplace: true});
Expand Down
Loading