-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionInternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffWeeklyKSv2KSv2
Description
Description
Current State:
- Routes are defined as static paths in
ROUTES.ts - Each
verify-accountvariant requires a separate route definition - The
VERIFY_ACCOUNTconstant exists (line 52) but is just a string literal - No centralized configuration for dynamic route suffixes
- Each verify-account screen has its own type definition and linking config entry
Implementation:
This task sets up all the configuration required for dynamic routes across 4 files:
ROUTES.ts- AddDYNAMIC_ROUTESconfiguration and typesSCREENS.ts- Add screen key constanttypes.ts- Add dynamic route param typeslinkingConfig/config.ts- Add dynamic route screen mapping
Part A: ROUTES.ts Configuration
File: App/src/ROUTES.ts
Add DynamicRouteConfig type definition and DYNAMIC_ROUTES configuration object:
type DynamicRouteConfig = {
path: string;
entryScreens: Screen[];
};
const DYNAMIC_ROUTES = {
VERIFY_ACCOUNT: {
path: 'verify-account',
entryScreens: [], // Populated during migration
},
} as const satisfies Record<string, DynamicRouteConfig>;
type DynamicRouteSuffix = (typeof DYNAMIC_ROUTES)[keyof typeof DYNAMIC_ROUTES]['path'];Part B: SCREENS.ts Configuration
File: App/src/SCREENS.ts
Add screen key constant:
DYNAMIC: {
VERIFY_ACCOUNT: 'Dynamic_Verify_Account',
},Part C: Type Definitions
File: App/src/libs/Navigation/types.ts
Add dynamic route param types and exports.
Part D: Linking Config
File: App/src/libs/Navigation/linkingConfig/config.ts
Add dynamic route screen entry to the appropriate navigator.
Scope
Files:
App/src/ROUTES.tsApp/src/SCREENS.tsApp/src/libs/Navigation/types.tsApp/src/libs/Navigation/linkingConfig/config.ts
Dependencies: None (first task in sequence)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionInternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffWeeklyKSv2KSv2