From 6da6c133853424982e3463ea493dd7a989847f31 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 15:38:39 +0100 Subject: [PATCH 01/17] Add all screens to SCREENS.ts --- src/SCREENS.ts | 168 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index f4cbcf4f2564..59e456310fe2 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -22,6 +22,23 @@ const SCREENS = { WORKSPACES: 'Settings_Workspaces', SECURITY: 'Settings_Security', STATUS: 'Settings_Status', + PROFILE: 'Settings_Profile', + PRONOUNS: 'Settings_Pronouns', + DISPLAY_NAME: 'Settings_Display_Name', + TIMEZONE: 'Settings_Timezone', + TIMEZONE_SELECT: 'Settings_Timezone_Select', + PERSONAL_DETAILS_INITIAL: 'Settings_PersonalDetails_Initial', + PERSONAL_DETAILS_LEGAL_NAME: 'Settings_PersonalDetails_LegalName', + PERSONAL_DETAILS_DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth', + PERSONAL_DETAILS_ADDRESS: 'Settings_PersonalDetails_Address', + PERSONAL_DETAILS_ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country', + CONTACT_METHODS: 'Settings_ContactMethods', + CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails', + NEW_CONTACT_METHOD: 'Settings_NewContactMethod', + SHARE_CODE: 'Settings_Share_Code', + ABOUT: 'Settings_About', + APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links', + LOUNGE_ACCESS: 'Settings_Lounge_Access', WALLET: 'Settings_Wallet', WALLET_DOMAIN_CARD: 'Settings_Wallet_DomainCard', WALLET_CARD_GET_PHYSICAL: { @@ -30,14 +47,165 @@ const SCREENS = { ADDRESS: 'Settings_Card_Get_Physical_Address', CONFIRM: 'Settings_Card_Get_Physical_Confirm', }, + WALLET_TRANSFER_BALANCE: 'Settings_Wallet_Transfer_Balance', + WALLET_CHOOSE_TRANSFER_ACCOUNT: 'Settings_Wallet_Choose_Transfer_Account', + WALLET_ENABLE_PAYMENTS: 'Settings_Wallet_EnablePayments', + WALLET_CARD_ACTIVATE: 'Settings_Wallet_Card_Activate', + WALLET_REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud', + WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address', + ADD_DEBIT_CARD: 'Settings_Add_Debit_Card', + ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account', + PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode', + PREFERENCES_LANGUAGE: 'Settings_Preferences_Language', + PREFERENCES_THEME: 'Settings_Preferences_Theme', + CLOSE: 'Settings_Close', + STATUS_SET: 'Settings_Status_Set', + TWO_FACTOR_AUTH: 'Settings_TwoFactorAuth', + REPORT_CARD_LOST_OR_DAMAGED: 'Settings_ReportCardLostOrDamaged', }, SAVE_THE_WORLD: { ROOT: 'SaveTheWorld_Root', }, + RIGHT_MODAL: { + SETTINGS: 'Settings', + NEW_CHAT: 'NewChat', + SEARCH: 'Search', + DETAILS: 'Details', + PROFILE: 'Profile', + REPORT_DETAILS: 'Report_Details', + REPORT_SETTINGS: 'Report_Settings', + REPORT_WELCOME_MESSAGE: 'Report_WelcomeMessage', + PARTICIPANTS: 'Participants', + MONEY_REQUEST: 'MoneyRequest', + NEW_TASK: 'NewTask', + TEACHERS_UNITE: 'TeachersUnite', + TASK_DETAILS: 'Task_Details', + ENABLE_PAYMENTS: 'EnablePayments', + SPLIT_DETAILS: 'SplitDetails', + ADD_PERSONAL_BANK_ACCOUNT: 'AddPersonalBankAccount', + WALLET_STATEMENT: 'Wallet_Statement', + FLAG_COMMENT: 'Flag_Comment', + EDIT_REQUEST: 'EditRequest', + SIGN_IN: 'SignIn', + PRIVATE_NOTES: 'Private_Notes', + ROOM_MEMBERS: 'RoomMembers', + ROOM_INVITE: 'RoomInvite', + REFERRAL: 'Referral', + }, SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop', SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop', DESKTOP_SIGN_IN_REDIRECT: 'DesktopSignInRedirect', SAML_SIGN_IN: 'SAMLSignIn', + + MONEY_REQUEST: { + MANUAL_TAB: 'manual', + SCAN_TAB: 'scan', + DISTANCE_TAB: 'distance', + ROOT: 'Money_Request', + AMOUNT: 'Money_Request_Amount', + PARTICIPANTS: 'Money_Request_Participants', + CONFIRMATION: 'Money_Request_Confirmation', + CURRENCY: 'Money_Request_Currency', + DATE: 'Money_Request_Date', + DESCRIPTION: 'Money_Request_Description', + CATEGORY: 'Money_Request_Category', + TAG: 'Money_Request_Tag', + MERCHANT: 'Money_Request_Merchant', + WAYPOINT: 'Money_Request_Waypoint', + EDIT_WAYPOINT: 'Money_Request_Edit_Waypoint', + DISTANCE: 'Money_Request_Distance', + RECEIPT: 'Money_Request_Receipt', + }, + + IOU_SEND: { + ADD_BANK_ACCOUNT: 'IOU_Send_Add_Bank_Account', + ADD_DEBIT_CARD: 'IOU_Send_Add_Debit_Card', + ENABLE_PAYMENTS: 'IOU_Send_Enable_Payments', + }, + + REPORT_SETTINGS: { + ROOT: 'Report_Settings_Root', + ROOM_NAME: 'Report_Settings_Room_Name', + NOTIFICATION_PREFERENCES: 'Report_Settings_Notification_Preferences', + WRITE_CAPABILITY: 'Report_Settings_Write_Capability', + }, + + NEW_TASK: { + ROOT: 'NewTask_Root', + TASK_ASSIGNEE_SELECTOR: 'NewTask_TaskAssigneeSelector', + TASK_SHARE_DESTINATION_SELECTOR: 'NewTask_TaskShareDestinationSelector', + DETAILS: 'NewTask_Details', + TITLE: 'NewTask_Title', + DESCRIPTION: 'NewTask_Description', + }, + + TASK: { + TITLE: 'Task_Title', + DESCRIPTION: 'Task_Description', + ASSIGNEE: 'Task_Assignee', + }, + + PRIVATE_NOTES: { + VIEW: 'PrivateNotes_View', + LIST: 'PrivateNotes_List', + EDIT: 'PrivateNotes_Edit', + }, + + REPORT_DETAILS: { + ROOT: 'Report_Details_Root', + SHARE_CODE: 'Report_Details_Share_Code', + }, + + WORKSPACE: { + INITIAL: 'Workspace_Initial', + SETTINGS: 'Workspace_Settings', + CARD: 'Workspace_Card', + REIMBURSE: 'Workspace_Reimburse', + RATE_AND_UNIT: 'Workspace_RateAndUnit', + BILLS: 'Workspace_Bills', + INVOICES: 'Workspace_Invoices', + TRAVEL: 'Workspace_Travel', + MEMBERS: 'Workspace_Members', + INVITE: 'Workspace_Invite', + INVITE_MESSAGE: 'Workspace_Invite_Message', + CURRENCY: 'Workspace_Settings_Currency', + }, + + EDIT_REQUEST: { + ROOT: 'EditRequest_Root', + CURRENCY: 'EditRequest_Currency', + }, + + I_KNOW_A_TEACHER: 'I_Know_A_Teacher', + INTRO_SCHOOL_PRINCIPAL: 'Intro_School_Principal', + I_AM_A_TEACHER: 'I_Am_A_Teacher', + + ENABLE_PAYMENTS_ROOT: 'EnablePayments_Root', + ADD_PERSONAL_BANK_ACCOUNT_ROOT: 'AddPersonalBankAccount_Root', + REIMBURSEMENT_ACCOUNT_ROOT: 'Reimbursement_Account_Root', + WALLET_STATEMENT_ROOT: 'WalletStatement_Root', + SIGN_IN_ROOT: 'SignIn_Root', + REFERRAL_DETAILS: 'Referral_Details', + + SPLIT_DETAILS: { + ROOT: 'SplitDetails_Root', + EDIT_REQUEST: 'SplitDetails_Edit_Request', + EDIT_CURRENCY: 'SplitDetails_Edit_Currency', + }, + + DETAILS_ROOT: 'Details_Root', + PROFILE_ROOT: 'Profile_Root', + REPORT_WELCOME_MESSAGE_ROOT: 'Report_WelcomeMessage_Root', + REPORT_PARTICIPANTS_ROOT: 'ReportParticipants_Root', + ROOM_MEMBERS_ROOT: 'RoomMembers_Root', + ROOM_INVITE_ROOT: 'RoomInvite_Root', + SEARCH_ROOT: 'Search_Root', + NEW_CHAT_ROOT: 'NewChat_Root', + FLAG_COMMENT_ROOT: 'FlagComment_Root', + REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount', + GET_ASSISTANCE: 'GetAssistance', + + KEYBOARD_SHORTCUTS: 'KeyboardShortcuts', } as const; export default SCREENS; From 76085ddcc5756f336e7cb92f30fa9234f98b33da Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 15:39:10 +0100 Subject: [PATCH 02/17] Use constant names for screens from SCREENS.ts --- src/libs/Navigation/types.ts | 279 +++++++++++++++++++---------------- 1 file changed, 148 insertions(+), 131 deletions(-) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 41df21d8e237..4e4ade108028 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -42,313 +42,313 @@ type CentralPaneNavigatorParamList = { type SettingsNavigatorParamList = { [SCREENS.SETTINGS.ROOT]: undefined; - Settings_Share_Code: undefined; + [SCREENS.SETTINGS.SHARE_CODE]: undefined; [SCREENS.SETTINGS.WORKSPACES]: undefined; - Settings_Profile: undefined; - Settings_Pronouns: undefined; - Settings_Display_Name: undefined; - Settings_Timezone: undefined; - Settings_Timezone_Select: undefined; - Settings_PersonalDetails_Initial: undefined; - Settings_PersonalDetails_LegalName: undefined; - Settings_PersonalDetails_DateOfBirth: undefined; - Settings_PersonalDetails_Address: undefined; - Settings_PersonalDetails_Address_Country: undefined; - Settings_ContactMethods: undefined; - Settings_ContactMethodDetails: undefined; - Settings_NewContactMethod: undefined; + [SCREENS.SETTINGS.PROFILE]: undefined; + [SCREENS.SETTINGS.PRONOUNS]: undefined; + [SCREENS.SETTINGS.DISPLAY_NAME]: undefined; + [SCREENS.SETTINGS.TIMEZONE]: undefined; + [SCREENS.SETTINGS.TIMEZONE_SELECT]: undefined; + [SCREENS.SETTINGS.PERSONAL_DETAILS_INITIAL]: undefined; + [SCREENS.SETTINGS.PERSONAL_DETAILS_LEGAL_NAME]: undefined; + [SCREENS.SETTINGS.PERSONAL_DETAILS_DATE_OF_BIRTH]: undefined; + [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS]: undefined; + [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS_COUNTRY]: undefined; + [SCREENS.SETTINGS.CONTACT_METHODS]: undefined; + [SCREENS.SETTINGS.CONTACT_METHOD_DETAILS]: undefined; + [SCREENS.SETTINGS.NEW_CONTACT_METHOD]: undefined; [SCREENS.SETTINGS.PREFERENCES]: undefined; - Settings_Preferences_PriorityMode: undefined; - Settings_Preferences_Language: undefined; - Settings_Preferences_Theme: undefined; - Settings_Close: undefined; + [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: undefined; + [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: undefined; + [SCREENS.SETTINGS.PREFERENCES_THEME]: undefined; + [SCREENS.SETTINGS.CLOSE]: undefined; [SCREENS.SETTINGS.SECURITY]: undefined; - Settings_About: undefined; - Settings_App_Download_Links: undefined; - Settings_Lounge_Access: undefined; - Settings_Wallet: undefined; - Settings_Wallet_Cards_Digital_Details_Update_Address: undefined; - Settings_Wallet_DomainCard: undefined; - Settings_Wallet_ReportVirtualCardFraud: undefined; - Settings_Wallet_Card_Activate: undefined; + [SCREENS.SETTINGS.ABOUT]: undefined; + [SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: undefined; + [SCREENS.SETTINGS.LOUNGE_ACCESS]: undefined; + [SCREENS.SETTINGS.WALLET]: undefined; + [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: undefined; + [SCREENS.SETTINGS.WALLET_DOMAIN_CARD]: undefined; + [SCREENS.SETTINGS.WALLET_REPORT_VIRTUAL_CARD_FRAUD]: undefined; + [SCREENS.SETTINGS.WALLET_CARD_ACTIVATE]: undefined; [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.NAME]: undefined; [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.PHONE]: undefined; [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.ADDRESS]: undefined; [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.CONFIRM]: undefined; - Settings_Wallet_Transfer_Balance: undefined; - Settings_Wallet_Choose_Transfer_Account: undefined; - Settings_Wallet_EnablePayments: undefined; - Settings_Add_Debit_Card: undefined; - Settings_Add_Bank_Account: undefined; + [SCREENS.SETTINGS.WALLET_TRANSFER_BALANCE]: undefined; + [SCREENS.SETTINGS.WALLET_CHOOSE_TRANSFER_ACCOUNT]: undefined; + [SCREENS.SETTINGS.WALLET_ENABLE_PAYMENTS]: undefined; + [SCREENS.SETTINGS.ADD_DEBIT_CARD]: undefined; + [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: undefined; [SCREENS.SETTINGS.STATUS]: undefined; - Settings_Status_Set: undefined; - Workspace_Initial: undefined; - Workspace_Settings: undefined; - Workspace_Settings_Currency: undefined; - Workspace_Card: { + [SCREENS.SETTINGS.STATUS_SET]: undefined; + [SCREENS.WORKSPACE.INITIAL]: undefined; + [SCREENS.WORKSPACE.SETTINGS]: undefined; + [SCREENS.WORKSPACE.CURRENCY]: undefined; + [SCREENS.WORKSPACE.CARD]: { policyID: string; }; - Workspace_Reimburse: { + [SCREENS.WORKSPACE.REIMBURSE]: { policyID: string; }; - Workspace_RateAndUnit: undefined; - Workspace_Bills: { + [SCREENS.WORKSPACE.RATE_AND_UNIT]: undefined; + [SCREENS.WORKSPACE.BILLS]: { policyID: string; }; - Workspace_Invoices: { + [SCREENS.WORKSPACE.INVOICES]: { policyID: string; }; - Workspace_Travel: { + [SCREENS.WORKSPACE.TRAVEL]: { policyID: string; }; - Workspace_Members: { + [SCREENS.WORKSPACE.MEMBERS]: { policyID: string; }; - Workspace_Invite: { + [SCREENS.WORKSPACE.INVITE]: { policyID: string; }; - Workspace_Invite_Message: { + [SCREENS.WORKSPACE.INVITE_MESSAGE]: { policyID: string; }; - ReimbursementAccount: { + [SCREENS.REIMBURSEMENT_ACCOUNT]: { stepToOpen: string; policyID: string; }; - GetAssistance: { + [SCREENS.GET_ASSISTANCE]: { taskID: string; }; - Settings_TwoFactorAuth: undefined; - Settings_ReportCardLostOrDamaged: undefined; - KeyboardShortcuts: undefined; + [SCREENS.SETTINGS.TWO_FACTOR_AUTH]: undefined; + [SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED]: undefined; + [SCREENS.KEYBOARD_SHORTCUTS]: undefined; }; type NewChatNavigatorParamList = { - NewChat_Root: undefined; + [SCREENS.NEW_CHAT_ROOT]: undefined; }; type SearchNavigatorParamList = { - Search_Root: undefined; + [SCREENS.SEARCH_ROOT]: undefined; }; type DetailsNavigatorParamList = { - Details_Root: { + [SCREENS.DETAILS_ROOT]: { login: string; reportID: string; }; }; type ProfileNavigatorParamList = { - Profile_Root: { + [SCREENS.PROFILE_ROOT]: { accountID: string; reportID: string; }; }; type ReportDetailsNavigatorParamList = { - Report_Details_Root: undefined; - Report_Details_Share_Code: { + [SCREENS.REPORT_DETAILS.ROOT]: undefined; + [SCREENS.REPORT_DETAILS.SHARE_CODE]: { reportID: string; }; }; type ReportSettingsNavigatorParamList = { - Report_Settings_Root: undefined; - Report_Settings_Room_Name: undefined; - Report_Settings_Notification_Preferences: undefined; - Report_Settings_Write_Capability: undefined; + [SCREENS.REPORT_SETTINGS.ROOT]: undefined; + [SCREENS.REPORT_SETTINGS.ROOM_NAME]: undefined; + [SCREENS.REPORT_SETTINGS.NOTIFICATION_PREFERENCES]: undefined; + [SCREENS.REPORT_SETTINGS.WRITE_CAPABILITY]: undefined; }; type ReportWelcomeMessageNavigatorParamList = { - Report_WelcomeMessage_Root: {reportID: string}; + [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: {reportID: string}; }; type ParticipantsNavigatorParamList = { - ReportParticipants_Root: {reportID: string}; + [SCREENS.REPORT_PARTICIPANTS_ROOT]: {reportID: string}; }; type RoomMembersNavigatorParamList = { - RoomMembers_Root: undefined; + [SCREENS.ROOM_MEMBERS_ROOT]: undefined; }; type RoomInviteNavigatorParamList = { - RoomInvite_Root: undefined; + [SCREENS.ROOM_INVITE_ROOT]: undefined; }; type MoneyRequestNavigatorParamList = { - Money_Request: undefined; - Money_Request_Amount: undefined; - Money_Request_Participants: { + [SCREENS.MONEY_REQUEST.ROOT]: undefined; + [SCREENS.MONEY_REQUEST.AMOUNT]: undefined; + [SCREENS.MONEY_REQUEST.PARTICIPANTS]: { iouType: string; reportID: string; }; - Money_Request_Confirmation: { + [SCREENS.MONEY_REQUEST.CONFIRMATION]: { iouType: string; reportID: string; }; - Money_Request_Currency: { + [SCREENS.MONEY_REQUEST.CURRENCY]: { iouType: string; reportID: string; currency: string; backTo: string; }; - Money_Request_Date: { + [SCREENS.MONEY_REQUEST.DATE]: { iouType: string; reportID: string; field: string; threadReportID: string; }; - Money_Request_Description: { + [SCREENS.MONEY_REQUEST.DESCRIPTION]: { iouType: string; reportID: string; field: string; threadReportID: string; }; - Money_Request_Category: { + [SCREENS.MONEY_REQUEST.CATEGORY]: { iouType: string; reportID: string; }; - Money_Request_Tag: { + [SCREENS.MONEY_REQUEST.TAG]: { iouType: string; reportID: string; }; - Money_Request_Merchant: { + [SCREENS.MONEY_REQUEST.MERCHANT]: { iouType: string; reportID: string; field: string; threadReportID: string; }; - IOU_Send_Enable_Payments: undefined; - IOU_Send_Add_Bank_Account: undefined; - IOU_Send_Add_Debit_Card: undefined; - Money_Request_Waypoint: { + [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: undefined; + [SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: undefined; + [SCREENS.IOU_SEND.ADD_DEBIT_CARD]: undefined; + [SCREENS.MONEY_REQUEST.WAYPOINT]: { iouType: string; transactionID: string; waypointIndex: string; threadReportID: number; }; - Money_Request_Edit_Waypoint: { + [SCREENS.MONEY_REQUEST.EDIT_WAYPOINT]: { iouType: string; transactionID: string; waypointIndex: string; threadReportID: number; }; - Money_Request_Distance: { + [SCREENS.MONEY_REQUEST.DISTANCE]: { iouType: ValueOf; reportID: string; }; - Money_Request_Receipt: { + [SCREENS.MONEY_REQUEST.RECEIPT]: { iouType: string; reportID: string; }; }; type NewTaskNavigatorParamList = { - NewTask_Root: undefined; - NewTask_TaskAssigneeSelector: undefined; - NewTask_TaskShareDestinationSelector: undefined; - NewTask_Details: undefined; - NewTask_Title: undefined; - NewTask_Description: undefined; + [SCREENS.NEW_TASK.ROOT]: undefined; + [SCREENS.NEW_TASK.TASK_ASSIGNEE_SELECTOR]: undefined; + [SCREENS.NEW_TASK.TASK_SHARE_DESTINATION_SELECTOR]: undefined; + [SCREENS.NEW_TASK.DETAILS]: undefined; + [SCREENS.NEW_TASK.TITLE]: undefined; + [SCREENS.NEW_TASK.DESCRIPTION]: undefined; }; type TeachersUniteNavigatorParamList = { [SCREENS.SAVE_THE_WORLD.ROOT]: undefined; - I_Know_A_Teacher: undefined; - Intro_School_Principal: undefined; - I_Am_A_Teacher: undefined; + [SCREENS.I_KNOW_A_TEACHER]: undefined; + [SCREENS.INTRO_SCHOOL_PRINCIPAL]: undefined; + [SCREENS.I_AM_A_TEACHER]: undefined; }; type TaskDetailsNavigatorParamList = { - Task_Title: undefined; - Task_Description: undefined; - Task_Assignee: { + [SCREENS.TASK.TITLE]: undefined; + [SCREENS.TASK.DESCRIPTION]: undefined; + [SCREENS.TASK.ASSIGNEE]: { reportID: string; }; }; type EnablePaymentsNavigatorParamList = { - EnablePayments_Root: undefined; + [SCREENS.ENABLE_PAYMENTS_ROOT]: undefined; }; type SplitDetailsNavigatorParamList = { - SplitDetails_Root: { + [SCREENS.SPLIT_DETAILS.ROOT]: { reportActionID: string; }; - SplitDetails_Edit_Request: undefined; - SplitDetails_Edit_Currency: undefined; + [SCREENS.SPLIT_DETAILS.EDIT_REQUEST]: undefined; + [SCREENS.SPLIT_DETAILS.EDIT_CURRENCY]: undefined; }; type AddPersonalBankAccountNavigatorParamList = { - AddPersonalBankAccount_Root: undefined; + [SCREENS.ADD_PERSONAL_BANK_ACCOUNT_ROOT]: undefined; }; type WalletStatementNavigatorParamList = { - WalletStatement_Root: undefined; + [SCREENS.WALLET_STATEMENT_ROOT]: undefined; }; type FlagCommentNavigatorParamList = { - FlagComment_Root: { + [SCREENS.FLAG_COMMENT_ROOT]: { reportID: string; reportActionID: string; }; }; type EditRequestNavigatorParamList = { - EditRequest_Root: { + [SCREENS.EDIT_REQUEST.ROOT]: { field: string; threadReportID: string; }; - EditRequest_Currency: undefined; + [SCREENS.EDIT_REQUEST.CURRENCY]: undefined; }; type SignInNavigatorParamList = { - SignIn_Root: undefined; + [SCREENS.SIGN_IN_ROOT]: undefined; }; type ReferralDetailsNavigatorParamList = { - Referral_Details: undefined; + [SCREENS.REFERRAL_DETAILS]: undefined; }; type PrivateNotesNavigatorParamList = { - PrivateNotes_View: { + [SCREENS.PRIVATE_NOTES.VIEW]: { reportID: string; accountID: string; }; - PrivateNotes_List: { + [SCREENS.PRIVATE_NOTES.LIST]: { reportID: string; accountID: string; }; - PrivateNotes_Edit: { + [SCREENS.PRIVATE_NOTES.EDIT]: { reportID: string; accountID: string; }; }; type RightModalNavigatorParamList = { - Settings: NavigatorScreenParams; - NewChat: NavigatorScreenParams; - Search: NavigatorScreenParams; - Details: NavigatorScreenParams; - Profile: NavigatorScreenParams; - Report_Details: NavigatorScreenParams; - Report_Settings: NavigatorScreenParams; - Report_WelcomeMessage: NavigatorScreenParams; - Participants: NavigatorScreenParams; - RoomMembers: NavigatorScreenParams; - RoomInvite: NavigatorScreenParams; - MoneyRequest: NavigatorScreenParams; - NewTask: NavigatorScreenParams; - TeachersUnite: NavigatorScreenParams; - Task_Details: NavigatorScreenParams; - EnablePayments: NavigatorScreenParams; - SplitDetails: NavigatorScreenParams; - AddPersonalBankAccount: NavigatorScreenParams; - Wallet_Statement: NavigatorScreenParams; - Flag_Comment: NavigatorScreenParams; - EditRequest: NavigatorScreenParams; - SignIn: NavigatorScreenParams; - Referral: NavigatorScreenParams; - Private_Notes: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.SETTINGS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.NEW_CHAT]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.SEARCH]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.DETAILS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.PROFILE]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.REPORT_DETAILS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.REPORT_SETTINGS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.REPORT_WELCOME_MESSAGE]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.PARTICIPANTS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.ROOM_MEMBERS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.ROOM_INVITE]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.MONEY_REQUEST]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.NEW_TASK]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.TASK_DETAILS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.ENABLE_PAYMENTS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.SPLIT_DETAILS]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.ADD_PERSONAL_BANK_ACCOUNT]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.WALLET_STATEMENT]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.FLAG_COMMENT]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.EDIT_REQUEST]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.SIGN_IN]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.REFERRAL]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.PRIVATE_NOTES]: NavigatorScreenParams; }; type PublicScreensParamList = { @@ -390,6 +390,12 @@ type AuthScreensParamList = { reportID: string; source: string; }; + [CONST.DEMO_PAGES.SAASTR]: { + name: string; + }; + [CONST.DEMO_PAGES.SBE]: { + name: string; + }; [SCREENS.NOT_FOUND]: undefined; [NAVIGATORS.RIGHT_MODAL_NAVIGATOR]: NavigatorScreenParams; [SCREENS.DESKTOP_SIGN_IN_REDIRECT]: undefined; @@ -398,4 +404,15 @@ type AuthScreensParamList = { type RootStackParamList = PublicScreensParamList & AuthScreensParamList; -export type {NavigationRef, StackNavigationAction, CentralPaneNavigatorParamList, RootStackParamList, StateOrRoute, NavigationStateRoute, NavigationRoot}; +export type { + NavigationRef, + StackNavigationAction, + CentralPaneNavigatorParamList, + RootStackParamList, + StateOrRoute, + NavigationStateRoute, + NavigationRoot, + AuthScreensParamList, + RightModalNavigatorParamList, + PublicScreensParamList, +}; From 351ab20bece93da578bff9d0a83c4717f0ae0b63 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 15:39:26 +0100 Subject: [PATCH 03/17] Use constant names for screens in linking config from SCREENS.ts --- src/libs/Navigation/linkingConfig.ts | 266 +++++++++++++-------------- 1 file changed, 133 insertions(+), 133 deletions(-) diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index 92a04778b9a6..add2208a9bf1 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -39,7 +39,7 @@ const linkingConfig: LinkingOptions = { [NAVIGATORS.RIGHT_MODAL_NAVIGATOR]: { screens: { - Settings: { + [SCREENS.RIGHT_MODAL.SETTINGS]: { screens: { [SCREENS.SETTINGS.ROOT]: { path: ROUTES.SETTINGS, @@ -52,19 +52,19 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_PREFERENCES, exact: true, }, - Settings_Preferences_PriorityMode: { + [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: { path: ROUTES.SETTINGS_PRIORITY_MODE, exact: true, }, - Settings_Preferences_Language: { + [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: { path: ROUTES.SETTINGS_LANGUAGE, exact: true, }, - Settings_Preferences_Theme: { + [SCREENS.SETTINGS.PREFERENCES_THEME]: { path: ROUTES.SETTINGS_THEME, exact: true, }, - Settings_Close: { + [SCREENS.SETTINGS.CLOSE]: { path: ROUTES.SETTINGS_CLOSE, exact: true, }, @@ -72,15 +72,15 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_SECURITY, exact: true, }, - Settings_Wallet: { + [SCREENS.SETTINGS.WALLET]: { path: ROUTES.SETTINGS_WALLET, exact: true, }, - Settings_Wallet_DomainCard: { + [SCREENS.SETTINGS.WALLET_DOMAIN_CARD]: { path: ROUTES.SETTINGS_WALLET_DOMAINCARD.route, exact: true, }, - Settings_Wallet_ReportVirtualCardFraud: { + [SCREENS.SETTINGS.WALLET_REPORT_VIRTUAL_CARD_FRAUD]: { path: ROUTES.SETTINGS_REPORT_FRAUD.route, exact: true, }, @@ -100,105 +100,105 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_WALLET_CARD_GET_PHYSICAL_CONFIRM.route, exact: true, }, - Settings_Wallet_EnablePayments: { + [SCREENS.SETTINGS.WALLET_ENABLE_PAYMENTS]: { path: ROUTES.SETTINGS_ENABLE_PAYMENTS, exact: true, }, - Settings_Wallet_Transfer_Balance: { + [SCREENS.SETTINGS.WALLET_TRANSFER_BALANCE]: { path: ROUTES.SETTINGS_WALLET_TRANSFER_BALANCE, exact: true, }, - Settings_Wallet_Choose_Transfer_Account: { + [SCREENS.SETTINGS.WALLET_CHOOSE_TRANSFER_ACCOUNT]: { path: ROUTES.SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT, exact: true, }, - Settings_ReportCardLostOrDamaged: { + [SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED]: { path: ROUTES.SETTINGS_WALLET_REPORT_CARD_LOST_OR_DAMAGED.route, exact: true, }, - Settings_Wallet_Card_Activate: { + [SCREENS.SETTINGS.WALLET_CARD_ACTIVATE]: { path: ROUTES.SETTINGS_WALLET_CARD_ACTIVATE.route, exact: true, }, - Settings_Wallet_Cards_Digital_Details_Update_Address: { - path: ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.route, + [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: { + path: ROUTES.SETTINGS_WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS.route, exact: true, }, - Settings_Add_Debit_Card: { + [SCREENS.SETTINGS.ADD_DEBIT_CARD]: { path: ROUTES.SETTINGS_ADD_DEBIT_CARD, exact: true, }, - Settings_Add_Bank_Account: { + [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: { path: ROUTES.SETTINGS_ADD_BANK_ACCOUNT, exact: true, }, - Settings_Profile: { + [SCREENS.SETTINGS.PROFILE]: { path: ROUTES.SETTINGS_PROFILE, exact: true, }, - Settings_Pronouns: { + [SCREENS.SETTINGS.PRONOUNS]: { path: ROUTES.SETTINGS_PRONOUNS, exact: true, }, - Settings_Display_Name: { + [SCREENS.SETTINGS.DISPLAY_NAME]: { path: ROUTES.SETTINGS_DISPLAY_NAME, exact: true, }, - Settings_Timezone: { + [SCREENS.SETTINGS.TIMEZONE]: { path: ROUTES.SETTINGS_TIMEZONE, exact: true, }, - Settings_Timezone_Select: { + [SCREENS.SETTINGS.TIMEZONE_SELECT]: { path: ROUTES.SETTINGS_TIMEZONE_SELECT, exact: true, }, - Settings_About: { + [SCREENS.SETTINGS.ABOUT]: { path: ROUTES.SETTINGS_ABOUT, exact: true, }, - Settings_App_Download_Links: { + [SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: { path: ROUTES.SETTINGS_APP_DOWNLOAD_LINKS, exact: true, }, - Settings_ContactMethods: { + [SCREENS.SETTINGS.CONTACT_METHODS]: { path: ROUTES.SETTINGS_CONTACT_METHODS.route, exact: true, }, - Settings_ContactMethodDetails: { + [SCREENS.SETTINGS.CONTACT_METHOD_DETAILS]: { path: ROUTES.SETTINGS_CONTACT_METHOD_DETAILS.route, }, - Settings_Lounge_Access: { + [SCREENS.SETTINGS.LOUNGE_ACCESS]: { path: ROUTES.SETTINGS_LOUNGE_ACCESS, }, - Settings_NewContactMethod: { + [SCREENS.SETTINGS.NEW_CONTACT_METHOD]: { path: ROUTES.SETTINGS_NEW_CONTACT_METHOD.route, exact: true, }, - Settings_PersonalDetails_Initial: { + [SCREENS.SETTINGS.PERSONAL_DETAILS_INITIAL]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS, exact: true, }, - Settings_PersonalDetails_LegalName: { + [SCREENS.SETTINGS.PERSONAL_DETAILS_LEGAL_NAME]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_LEGAL_NAME, exact: true, }, - Settings_PersonalDetails_DateOfBirth: { + [SCREENS.SETTINGS.PERSONAL_DETAILS_DATE_OF_BIRTH]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_DATE_OF_BIRTH, exact: true, }, - Settings_PersonalDetails_Address: { + [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS, exact: true, }, - Settings_PersonalDetails_Address_Country: { + [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS_COUNTRY]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS_COUNTRY.route, exact: true, }, - Settings_TwoFactorAuth: { + [SCREENS.SETTINGS.TWO_FACTOR_AUTH]: { path: ROUTES.SETTINGS_2FA.route, exact: true, }, - Settings_Share_Code: { + [SCREENS.SETTINGS.SHARE_CODE]: { path: ROUTES.SETTINGS_SHARE_CODE, exact: true, }, @@ -206,93 +206,93 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_STATUS, exact: true, }, - Settings_Status_Set: { + [SCREENS.SETTINGS.STATUS_SET]: { path: ROUTES.SETTINGS_STATUS_SET, exact: true, }, - Workspace_Initial: { + [SCREENS.WORKSPACE.INITIAL]: { path: ROUTES.WORKSPACE_INITIAL.route, }, - Workspace_Settings: { + [SCREENS.WORKSPACE.SETTINGS]: { path: ROUTES.WORKSPACE_SETTINGS.route, }, - Workspace_Settings_Currency: { + [SCREENS.WORKSPACE.CURRENCY]: { path: ROUTES.WORKSPACE_SETTINGS_CURRENCY.route, }, - Workspace_Card: { + [SCREENS.WORKSPACE.CARD]: { path: ROUTES.WORKSPACE_CARD.route, }, - Workspace_Reimburse: { + [SCREENS.WORKSPACE.REIMBURSE]: { path: ROUTES.WORKSPACE_REIMBURSE.route, }, - Workspace_RateAndUnit: { + [SCREENS.WORKSPACE.RATE_AND_UNIT]: { path: ROUTES.WORKSPACE_RATE_AND_UNIT.route, }, - Workspace_Bills: { + [SCREENS.WORKSPACE.BILLS]: { path: ROUTES.WORKSPACE_BILLS.route, }, - Workspace_Invoices: { + [SCREENS.WORKSPACE.INVOICES]: { path: ROUTES.WORKSPACE_INVOICES.route, }, - Workspace_Travel: { + [SCREENS.WORKSPACE.TRAVEL]: { path: ROUTES.WORKSPACE_TRAVEL.route, }, - Workspace_Members: { + [SCREENS.WORKSPACE.MEMBERS]: { path: ROUTES.WORKSPACE_MEMBERS.route, }, - Workspace_Invite: { + [SCREENS.WORKSPACE.INVITE]: { path: ROUTES.WORKSPACE_INVITE.route, }, - Workspace_Invite_Message: { + [SCREENS.WORKSPACE.INVITE_MESSAGE]: { path: ROUTES.WORKSPACE_INVITE_MESSAGE.route, }, - ReimbursementAccount: { + [SCREENS.REIMBURSEMENT_ACCOUNT]: { path: ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.route, exact: true, }, - GetAssistance: { + [SCREENS.GET_ASSISTANCE]: { path: ROUTES.GET_ASSISTANCE.route, }, - KeyboardShortcuts: { + [SCREENS.KEYBOARD_SHORTCUTS]: { path: ROUTES.KEYBOARD_SHORTCUTS, }, }, }, - Private_Notes: { + [SCREENS.RIGHT_MODAL.PRIVATE_NOTES]: { screens: { - PrivateNotes_View: ROUTES.PRIVATE_NOTES_VIEW.route, - PrivateNotes_List: ROUTES.PRIVATE_NOTES_LIST.route, - PrivateNotes_Edit: ROUTES.PRIVATE_NOTES_EDIT.route, + [SCREENS.PRIVATE_NOTES.VIEW]: ROUTES.PRIVATE_NOTES_VIEW.route, + [SCREENS.PRIVATE_NOTES.LIST]: ROUTES.PRIVATE_NOTES_LIST.route, + [SCREENS.PRIVATE_NOTES.EDIT]: ROUTES.PRIVATE_NOTES_EDIT.route, }, }, - Report_Details: { + [SCREENS.RIGHT_MODAL.REPORT_DETAILS]: { screens: { - Report_Details_Root: ROUTES.REPORT_WITH_ID_DETAILS.route, - Report_Details_Share_Code: ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.route, + [SCREENS.REPORT_DETAILS.ROOT]: ROUTES.REPORT_WITH_ID_DETAILS.route, + [SCREENS.REPORT_DETAILS.SHARE_CODE]: ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.route, }, }, - Report_Settings: { + [SCREENS.RIGHT_MODAL.REPORT_SETTINGS]: { screens: { - Report_Settings_Root: { + [SCREENS.REPORT_SETTINGS.ROOT]: { path: ROUTES.REPORT_SETTINGS.route, }, - Report_Settings_Room_Name: { + [SCREENS.REPORT_SETTINGS.ROOM_NAME]: { path: ROUTES.REPORT_SETTINGS_ROOM_NAME.route, }, - Report_Settings_Notification_Preferences: { + [SCREENS.REPORT_SETTINGS.NOTIFICATION_PREFERENCES]: { path: ROUTES.REPORT_SETTINGS_NOTIFICATION_PREFERENCES.route, }, - Report_Settings_Write_Capability: { + [SCREENS.REPORT_SETTINGS.WRITE_CAPABILITY]: { path: ROUTES.REPORT_SETTINGS_WRITE_CAPABILITY.route, }, }, }, - Report_WelcomeMessage: { + [SCREENS.RIGHT_MODAL.REPORT_WELCOME_MESSAGE]: { screens: { - Report_WelcomeMessage_Root: ROUTES.REPORT_WELCOME_MESSAGE.route, + [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: ROUTES.REPORT_WELCOME_MESSAGE.route, }, }, - NewChat: { + [SCREENS.RIGHT_MODAL.NEW_CHAT]: { screens: { NewChat_Root: { path: ROUTES.NEW, @@ -310,140 +310,140 @@ const linkingConfig: LinkingOptions = { }, }, }, - NewTask: { + [SCREENS.RIGHT_MODAL.NEW_CHAT]: { screens: { - NewTask_Root: ROUTES.NEW_TASK, - NewTask_TaskAssigneeSelector: ROUTES.NEW_TASK_ASSIGNEE, - NewTask_TaskShareDestinationSelector: ROUTES.NEW_TASK_SHARE_DESTINATION, - NewTask_Details: ROUTES.NEW_TASK_DETAILS, - NewTask_Title: ROUTES.NEW_TASK_TITLE, - NewTask_Description: ROUTES.NEW_TASK_DESCRIPTION, + [SCREENS.NEW_TASK.ROOT]: ROUTES.NEW_TASK, + [SCREENS.NEW_TASK.TASK_ASSIGNEE_SELECTOR]: ROUTES.NEW_TASK_ASSIGNEE, + [SCREENS.NEW_TASK.TASK_SHARE_DESTINATION_SELECTOR]: ROUTES.NEW_TASK_SHARE_DESTINATION, + [SCREENS.NEW_TASK.DETAILS]: ROUTES.NEW_TASK_DETAILS, + [SCREENS.NEW_TASK.TITLE]: ROUTES.NEW_TASK_TITLE, + [SCREENS.NEW_TASK.DESCRIPTION]: ROUTES.NEW_TASK_DESCRIPTION, }, }, - TeachersUnite: { + [SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: { screens: { [SCREENS.SAVE_THE_WORLD.ROOT]: ROUTES.TEACHERS_UNITE, - I_Know_A_Teacher: ROUTES.I_KNOW_A_TEACHER, - Intro_School_Principal: ROUTES.INTRO_SCHOOL_PRINCIPAL, - I_Am_A_Teacher: ROUTES.I_AM_A_TEACHER, + [SCREENS.I_KNOW_A_TEACHER]: ROUTES.I_KNOW_A_TEACHER, + [SCREENS.INTRO_SCHOOL_PRINCIPAL]: ROUTES.INTRO_SCHOOL_PRINCIPAL, + [SCREENS.I_AM_A_TEACHER]: ROUTES.I_AM_A_TEACHER, }, }, - Search: { + [SCREENS.RIGHT_MODAL.SEARCH]: { screens: { - Search_Root: ROUTES.SEARCH, + [SCREENS.SEARCH_ROOT]: ROUTES.SEARCH, }, }, - Details: { + [SCREENS.RIGHT_MODAL.DETAILS]: { screens: { - Details_Root: ROUTES.DETAILS.route, + [SCREENS.DETAILS_ROOT]: ROUTES.DETAILS.route, }, }, - Profile: { + [SCREENS.RIGHT_MODAL.PROFILE]: { screens: { - Profile_Root: ROUTES.PROFILE.route, + [SCREENS.PROFILE_ROOT]: ROUTES.PROFILE.route, }, }, - Participants: { + [SCREENS.RIGHT_MODAL.PARTICIPANTS]: { screens: { - ReportParticipants_Root: ROUTES.REPORT_PARTICIPANTS.route, + [SCREENS.REPORT_PARTICIPANTS_ROOT]: ROUTES.REPORT_PARTICIPANTS.route, }, }, - RoomInvite: { + [SCREENS.RIGHT_MODAL.ROOM_INVITE]: { screens: { - RoomInvite_Root: ROUTES.ROOM_INVITE.route, + [SCREENS.ROOM_INVITE_ROOT]: ROUTES.ROOM_INVITE.route, }, }, - RoomMembers: { + [SCREENS.RIGHT_MODAL.ROOM_MEMBERS]: { screens: { - RoomMembers_Root: ROUTES.ROOM_MEMBERS.route, + [SCREENS.ROOM_MEMBERS_ROOT]: ROUTES.ROOM_MEMBERS.route, }, }, - MoneyRequest: { + [SCREENS.RIGHT_MODAL.MONEY_REQUEST]: { screens: { - Money_Request: { + [SCREENS.MONEY_REQUEST.ROOT]: { path: ROUTES.MONEY_REQUEST.route, exact: true, screens: { - manual: { + [SCREENS.MONEY_REQUEST.MANUAL_TAB]: { path: ROUTES.MONEY_REQUEST_MANUAL_TAB, exact: true, }, - scan: { + [SCREENS.MONEY_REQUEST.SCAN_TAB]: { path: ROUTES.MONEY_REQUEST_SCAN_TAB, exact: true, }, - distance: { + [SCREENS.MONEY_REQUEST.DISTANCE_TAB]: { path: ROUTES.MONEY_REQUEST_DISTANCE_TAB.route, exact: true, }, }, }, - Money_Request_Amount: ROUTES.MONEY_REQUEST_AMOUNT.route, - Money_Request_Participants: ROUTES.MONEY_REQUEST_PARTICIPANTS.route, - Money_Request_Confirmation: ROUTES.MONEY_REQUEST_CONFIRMATION.route, - Money_Request_Date: ROUTES.MONEY_REQUEST_DATE.route, - Money_Request_Currency: ROUTES.MONEY_REQUEST_CURRENCY.route, - Money_Request_Description: ROUTES.MONEY_REQUEST_DESCRIPTION.route, - Money_Request_Category: ROUTES.MONEY_REQUEST_CATEGORY.route, - Money_Request_Tag: ROUTES.MONEY_REQUEST_TAG.route, - Money_Request_Merchant: ROUTES.MONEY_REQUEST_MERCHANT.route, - Money_Request_Waypoint: ROUTES.MONEY_REQUEST_WAYPOINT.route, - Money_Request_Edit_Waypoint: ROUTES.MONEY_REQUEST_EDIT_WAYPOINT.route, - Money_Request_Receipt: ROUTES.MONEY_REQUEST_RECEIPT.route, - Money_Request_Distance: ROUTES.MONEY_REQUEST_DISTANCE.route, - IOU_Send_Enable_Payments: ROUTES.IOU_SEND_ENABLE_PAYMENTS, - IOU_Send_Add_Bank_Account: ROUTES.IOU_SEND_ADD_BANK_ACCOUNT, - IOU_Send_Add_Debit_Card: ROUTES.IOU_SEND_ADD_DEBIT_CARD, + [SCREENS.MONEY_REQUEST.AMOUNT]: ROUTES.MONEY_REQUEST_AMOUNT.route, + [SCREENS.MONEY_REQUEST.PARTICIPANTS]: ROUTES.MONEY_REQUEST_PARTICIPANTS.route, + [SCREENS.MONEY_REQUEST.CONFIRMATION]: ROUTES.MONEY_REQUEST_CONFIRMATION.route, + [SCREENS.MONEY_REQUEST.DATE]: ROUTES.MONEY_REQUEST_DATE.route, + [SCREENS.MONEY_REQUEST.CURRENCY]: ROUTES.MONEY_REQUEST_CURRENCY.route, + [SCREENS.MONEY_REQUEST.DESCRIPTION]: ROUTES.MONEY_REQUEST_DESCRIPTION.route, + [SCREENS.MONEY_REQUEST.CATEGORY]: ROUTES.MONEY_REQUEST_CATEGORY.route, + [SCREENS.MONEY_REQUEST.TAG]: ROUTES.MONEY_REQUEST_TAG.route, + [SCREENS.MONEY_REQUEST.MERCHANT]: ROUTES.MONEY_REQUEST_MERCHANT.route, + [SCREENS.MONEY_REQUEST.WAYPOINT]: ROUTES.MONEY_REQUEST_WAYPOINT.route, + [SCREENS.MONEY_REQUEST.EDIT_WAYPOINT]: ROUTES.MONEY_REQUEST_EDIT_WAYPOINT.route, + [SCREENS.MONEY_REQUEST.RECEIPT]: ROUTES.MONEY_REQUEST_RECEIPT.route, + [SCREENS.MONEY_REQUEST.DISTANCE]: ROUTES.MONEY_REQUEST_DISTANCE.route, + [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: ROUTES.IOU_SEND_ENABLE_PAYMENTS, + [SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: ROUTES.IOU_SEND_ADD_BANK_ACCOUNT, + [SCREENS.IOU_SEND.ADD_DEBIT_CARD]: ROUTES.IOU_SEND_ADD_DEBIT_CARD, }, }, - SplitDetails: { + [SCREENS.RIGHT_MODAL.SPLIT_DETAILS]: { screens: { - SplitDetails_Root: ROUTES.SPLIT_BILL_DETAILS.route, - SplitDetails_Edit_Request: ROUTES.EDIT_SPLIT_BILL.route, - SplitDetails_Edit_Currency: ROUTES.EDIT_SPLIT_BILL_CURRENCY.route, + [SCREENS.SPLIT_DETAILS.ROOT]: ROUTES.SPLIT_BILL_DETAILS.route, + [SCREENS.SPLIT_DETAILS.EDIT_REQUEST]: ROUTES.EDIT_SPLIT_BILL.route, + [SCREENS.SPLIT_DETAILS.EDIT_CURRENCY]: ROUTES.EDIT_SPLIT_BILL_CURRENCY.route, }, }, - Task_Details: { + [SCREENS.RIGHT_MODAL.TASK_DETAILS]: { screens: { - Task_Title: ROUTES.TASK_TITLE.route, - Task_Description: ROUTES.TASK_DESCRIPTION.route, - Task_Assignee: ROUTES.TASK_ASSIGNEE.route, + [SCREENS.TASK.TITLE]: ROUTES.TASK_TITLE.route, + [SCREENS.TASK.DESCRIPTION]: ROUTES.TASK_DESCRIPTION.route, + [SCREENS.TASK.ASSIGNEE]: ROUTES.TASK_ASSIGNEE.route, }, }, - AddPersonalBankAccount: { + [SCREENS.RIGHT_MODAL.ADD_PERSONAL_BANK_ACCOUNT]: { screens: { - AddPersonalBankAccount_Root: ROUTES.BANK_ACCOUNT_PERSONAL, + [SCREENS.ADD_PERSONAL_BANK_ACCOUNT_ROOT]: ROUTES.BANK_ACCOUNT_PERSONAL, }, }, - EnablePayments: { + [SCREENS.RIGHT_MODAL.ENABLE_PAYMENTS]: { screens: { - EnablePayments_Root: ROUTES.ENABLE_PAYMENTS, + [SCREENS.ENABLE_PAYMENTS_ROOT]: ROUTES.ENABLE_PAYMENTS, }, }, - Wallet_Statement: { + [SCREENS.RIGHT_MODAL.WALLET_STATEMENT]: { screens: { - WalletStatement_Root: ROUTES.WALLET_STATEMENT_WITH_DATE, + [SCREENS.WALLET_STATEMENT_ROOT]: ROUTES.WALLET_STATEMENT_WITH_DATE, }, }, - Flag_Comment: { + [SCREENS.RIGHT_MODAL.FLAG_COMMENT]: { screens: { - FlagComment_Root: ROUTES.FLAG_COMMENT.route, + [SCREENS.FLAG_COMMENT_ROOT]: ROUTES.FLAG_COMMENT.route, }, }, - EditRequest: { + [SCREENS.RIGHT_MODAL.EDIT_REQUEST]: { screens: { - EditRequest_Root: ROUTES.EDIT_REQUEST.route, - EditRequest_Currency: ROUTES.EDIT_CURRENCY_REQUEST.route, + [SCREENS.EDIT_REQUEST.ROOT]: ROUTES.EDIT_REQUEST.route, + [SCREENS.EDIT_REQUEST.CURRENCY]: ROUTES.EDIT_CURRENCY_REQUEST.route, }, }, - SignIn: { + [SCREENS.RIGHT_MODAL.SIGN_IN]: { screens: { - SignIn_Root: ROUTES.SIGN_IN_MODAL, + [SCREENS.SIGN_IN_ROOT]: ROUTES.SIGN_IN_MODAL, }, }, - Referral: { + [SCREENS.RIGHT_MODAL.REFERRAL]: { screens: { - Referral_Details: ROUTES.REFERRAL_DETAILS_MODAL.route, + [SCREENS.REFERRAL_DETAILS]: ROUTES.REFERRAL_DETAILS_MODAL.route, }, }, }, From 21fed0dab107798a274b0e0bc267b07b62964137 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 15:39:46 +0100 Subject: [PATCH 04/17] Use constant names for screens in modal stack navigator from SCREENS.ts --- .../AppNavigator/ModalStackNavigators.js | 215 +++++++++--------- 1 file changed, 108 insertions(+), 107 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index be803e62a98b..1c8f742e72b5 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -44,195 +44,196 @@ function createModalStackNavigator(screens) { } const MoneyRequestModalStackNavigator = createModalStackNavigator({ - Money_Request: () => require('../../../pages/iou/MoneyRequestSelectorPage').default, - Money_Request_Amount: () => require('../../../pages/iou/steps/NewRequestAmountPage').default, - Money_Request_Participants: () => require('../../../pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage').default, - Money_Request_Confirmation: () => require('../../../pages/iou/steps/MoneyRequestConfirmPage').default, - Money_Request_Currency: () => require('../../../pages/iou/IOUCurrencySelection').default, - Money_Request_Date: () => require('../../../pages/iou/MoneyRequestDatePage').default, - Money_Request_Description: () => require('../../../pages/iou/MoneyRequestDescriptionPage').default, - Money_Request_Category: () => require('../../../pages/iou/MoneyRequestCategoryPage').default, - Money_Request_Tag: () => require('../../../pages/iou/MoneyRequestTagPage').default, - Money_Request_Merchant: () => require('../../../pages/iou/MoneyRequestMerchantPage').default, - IOU_Send_Add_Bank_Account: () => require('../../../pages/AddPersonalBankAccountPage').default, - IOU_Send_Add_Debit_Card: () => require('../../../pages/settings/Wallet/AddDebitCardPage').default, - IOU_Send_Enable_Payments: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default, - Money_Request_Waypoint: () => require('../../../pages/iou/NewDistanceRequestWaypointEditorPage').default, - Money_Request_Edit_Waypoint: () => require('../../../pages/iou/MoneyRequestEditWaypointPage').default, - Money_Request_Distance: () => require('../../../pages/iou/NewDistanceRequestPage').default, - Money_Request_Receipt: () => require('../../../pages/EditRequestReceiptPage').default, + [SCREENS.MONEY_REQUEST.ROOT]: () => require('../../../pages/iou/MoneyRequestSelectorPage').default, + [SCREENS.MONEY_REQUEST.AMOUNT]: () => require('../../../pages/iou/steps/NewRequestAmountPage').default, + [SCREENS.MONEY_REQUEST.PARTICIPANTS]: () => require('../../../pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage').default, + [SCREENS.MONEY_REQUEST.CONFIRMATION]: () => require('../../../pages/iou/steps/MoneyRequestConfirmPage').default, + [SCREENS.MONEY_REQUEST.CURRENCY]: () => require('../../../pages/iou/IOUCurrencySelection').default, + [SCREENS.MONEY_REQUEST.DATE]: () => require('../../../pages/iou/MoneyRequestDatePage').default, + [SCREENS.MONEY_REQUEST.DESCRIPTION]: () => require('../../../pages/iou/MoneyRequestDescriptionPage').default, + [SCREENS.MONEY_REQUEST.CATEGORY]: () => require('../../../pages/iou/MoneyRequestCategoryPage').default, + [SCREENS.MONEY_REQUEST.TAG]: () => require('../../../pages/iou/MoneyRequestTagPage').default, + [SCREENS.MONEY_REQUEST.MERCHANT]: () => require('../../../pages/iou/MoneyRequestMerchantPage').default, + [SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: () => require('../../../pages/AddPersonalBankAccountPage').default, + [SCREENS.IOU_SEND.ADD_DEBIT_CARD]: () => require('../../../pages/settings/Wallet/AddDebitCardPage').default, + [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default, + [SCREENS.MONEY_REQUEST.WAYPOINT]: () => require('../../../pages/iou/NewDistanceRequestWaypointEditorPage').default, + [SCREENS.MONEY_REQUEST.EDIT_WAYPOINT]: () => require('../../../pages/iou/MoneyRequestEditWaypointPage').default, + [SCREENS.MONEY_REQUEST.DISTANCE]: () => require('../../../pages/iou/NewDistanceRequestPage').default, + [SCREENS.MONEY_REQUEST.RECEIPT]: () => require('../../../pages/EditRequestReceiptPage').default, }); const SplitDetailsModalStackNavigator = createModalStackNavigator({ - SplitDetails_Root: () => require('../../../pages/iou/SplitBillDetailsPage').default, - SplitDetails_Edit_Request: () => require('../../../pages/EditSplitBillPage').default, - SplitDetails_Edit_Currency: () => require('../../../pages/iou/IOUCurrencySelection').default, + [SCREENS.SPLIT_DETAILS.ROOT]: () => require('../../../pages/iou/SplitBillDetailsPage').default, + [SCREENS.SPLIT_DETAILS.EDIT_REQUEST]: () => require('../../../pages/EditSplitBillPage').default, + [SCREENS.SPLIT_DETAILS.EDIT_CURRENCY]: () => require('../../../pages/iou/IOUCurrencySelection').default, }); const DetailsModalStackNavigator = createModalStackNavigator({ - Details_Root: () => require('../../../pages/DetailsPage').default, + [SCREENS.DETAILS_ROOT]: () => require('../../../pages/DetailsPage').default, }); const ProfileModalStackNavigator = createModalStackNavigator({ - Profile_Root: () => require('../../../pages/ProfilePage').default, + [SCREENS.PROFILE_ROOT]: () => require('../../../pages/ProfilePage').default, }); const ReportDetailsModalStackNavigator = createModalStackNavigator({ - Report_Details_Root: () => require('../../../pages/ReportDetailsPage').default, - Report_Details_Share_Code: () => require('../../../pages/home/report/ReportDetailsShareCodePage').default, + [SCREENS.REPORT_DETAILS.ROOT]: () => require('../../../pages/ReportDetailsPage').default, + [SCREENS.REPORT_DETAILS.SHARE_CODE]: () => require('../../../pages/home/report/ReportDetailsShareCodePage').default, }); const ReportSettingsModalStackNavigator = createModalStackNavigator({ - Report_Settings_Root: () => require('../../../pages/settings/Report/ReportSettingsPage').default, - Report_Settings_Room_Name: () => require('../../../pages/settings/Report/RoomNamePage').default, - Report_Settings_Notification_Preferences: () => require('../../../pages/settings/Report/NotificationPreferencePage').default, - Report_Settings_Write_Capability: () => require('../../../pages/settings/Report/WriteCapabilityPage').default, + [SCREENS.REPORT_SETTINGS.ROOT]: () => require('../../../pages/settings/Report/ReportSettingsPage').default, + [SCREENS.REPORT_SETTINGS.ROOM_NAME]: () => require('../../../pages/settings/Report/RoomNamePage').default, + [SCREENS.REPORT_SETTINGS.NOTIFICATION_PREFERENCES]: () => require('../../../pages/settings/Report/NotificationPreferencePage').default, + [SCREENS.REPORT_SETTINGS.WRITE_CAPABILITY]: () => require('../../../pages/settings/Report/WriteCapabilityPage').default, }); const TaskModalStackNavigator = createModalStackNavigator({ - Task_Title: () => require('../../../pages/tasks/TaskTitlePage').default, - Task_Description: () => require('../../../pages/tasks/TaskDescriptionPage').default, - Task_Assignee: () => require('../../../pages/tasks/TaskAssigneeSelectorModal').default, + [SCREENS.TASK.TITLE]: () => require('../../../pages/tasks/TaskTitlePage').default, + [SCREENS.TASK.DESCRIPTION]: () => require('../../../pages/tasks/TaskDescriptionPage').default, + [SCREENS.TASK.ASSIGNEE]: () => require('../../../pages/tasks/TaskAssigneeSelectorModal').default, }); const ReportWelcomeMessageModalStackNavigator = createModalStackNavigator({ - Report_WelcomeMessage_Root: () => require('../../../pages/ReportWelcomeMessagePage').default, + [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: () => require('../../../pages/ReportWelcomeMessagePage').default, }); const ReportParticipantsModalStackNavigator = createModalStackNavigator({ - ReportParticipants_Root: () => require('../../../pages/ReportParticipantsPage').default, + [SCREENS.REPORT_PARTICIPANTS_ROOT]: () => require('../../../pages/ReportParticipantsPage').default, }); const RoomMembersModalStackNavigator = createModalStackNavigator({ - RoomMembers_Root: () => require('../../../pages/RoomMembersPage').default, + [SCREENS.ROOM_MEMBERS_ROOT]: () => require('../../../pages/RoomMembersPage').default, }); const RoomInviteModalStackNavigator = createModalStackNavigator({ - RoomInvite_Root: () => require('../../../pages/RoomInvitePage').default, + [SCREENS.ROOM_INVITE_ROOT]: () => require('../../../pages/RoomInvitePage').default, }); const SearchModalStackNavigator = createModalStackNavigator({ - Search_Root: () => require('../../../pages/SearchPage').default, + [SCREENS.SEARCH_ROOT]: () => require('../../../pages/SearchPage').default, }); const NewChatModalStackNavigator = createModalStackNavigator({ - NewChat_Root: () => require('../../../pages/NewChatSelectorPage').default, + [SCREENS.NEW_CHAT_ROOT]: () => require('../../../pages/NewChatSelectorPage').default, }); const NewTaskModalStackNavigator = createModalStackNavigator({ - NewTask_Root: () => require('../../../pages/tasks/NewTaskPage').default, - NewTask_TaskAssigneeSelector: () => require('../../../pages/tasks/TaskAssigneeSelectorModal').default, - NewTask_TaskShareDestinationSelector: () => require('../../../pages/tasks/TaskShareDestinationSelectorModal').default, - NewTask_Details: () => require('../../../pages/tasks/NewTaskDetailsPage').default, - NewTask_Title: () => require('../../../pages/tasks/NewTaskTitlePage').default, - NewTask_Description: () => require('../../../pages/tasks/NewTaskDescriptionPage').default, + [SCREENS.NEW_TASK.ROOT]: () => require('../../../pages/tasks/NewTaskPage').default, + [SCREENS.NEW_TASK.TASK_ASSIGNEE_SELECTOR]: () => require('../../../pages/tasks/TaskAssigneeSelectorModal').default, + [SCREENS.NEW_TASK.TASK_SHARE_DESTINATION_SELECTOR]: () => require('../../../pages/tasks/TaskShareDestinationSelectorModal').default, + [SCREENS.NEW_TASK.DETAILS]: () => require('../../../pages/tasks/NewTaskDetailsPage').default, + [SCREENS.NEW_TASK.TITLE]: () => require('../../../pages/tasks/NewTaskTitlePage').default, + [SCREENS.NEW_TASK.DESCRIPTION]: () => require('../../../pages/tasks/NewTaskDescriptionPage').default, }); const NewTeachersUniteNavigator = createModalStackNavigator({ [SCREENS.SAVE_THE_WORLD.ROOT]: () => require('../../../pages/TeachersUnite/SaveTheWorldPage').default, - I_Know_A_Teacher: () => require('../../../pages/TeachersUnite/KnowATeacherPage').default, - Intro_School_Principal: () => require('../../../pages/TeachersUnite/ImTeacherPage').default, - I_Am_A_Teacher: () => require('../../../pages/TeachersUnite/ImTeacherPage').default, + [SCREENS.I_KNOW_A_TEACHER]: () => require('../../../pages/TeachersUnite/KnowATeacherPage').default, + [SCREENS.INTRO_SCHOOL_PRINCIPAL]: () => require('../../../pages/TeachersUnite/ImTeacherPage').default, + [SCREENS.I_AM_A_TEACHER]: () => require('../../../pages/TeachersUnite/ImTeacherPage').default, }); const SettingsModalStackNavigator = createModalStackNavigator({ [SCREENS.SETTINGS.ROOT]: () => require('../../../pages/settings/InitialSettingsPage').default, - Settings_Share_Code: () => require('../../../pages/ShareCodePage').default, + [SCREENS.SETTINGS.SHARE_CODE]: () => require('../../../pages/ShareCodePage').default, [SCREENS.SETTINGS.WORKSPACES]: () => require('../../../pages/workspace/WorkspacesListPage').default, - Settings_Profile: () => require('../../../pages/settings/Profile/ProfilePage').default, - Settings_Pronouns: () => require('../../../pages/settings/Profile/PronounsPage').default, - Settings_Display_Name: () => require('../../../pages/settings/Profile/DisplayNamePage').default, - Settings_Timezone: () => require('../../../pages/settings/Profile/TimezoneInitialPage').default, - Settings_Timezone_Select: () => require('../../../pages/settings/Profile/TimezoneSelectPage').default, - Settings_PersonalDetails_Initial: () => require('../../../pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage').default, - Settings_PersonalDetails_LegalName: () => require('../../../pages/settings/Profile/PersonalDetails/LegalNamePage').default, - Settings_PersonalDetails_DateOfBirth: () => require('../../../pages/settings/Profile/PersonalDetails/DateOfBirthPage').default, - Settings_PersonalDetails_Address: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default, - Settings_PersonalDetails_Address_Country: () => require('../../../pages/settings/Profile/PersonalDetails/CountrySelectionPage').default, - Settings_ContactMethods: () => require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default, - Settings_ContactMethodDetails: () => require('../../../pages/settings/Profile/Contacts/ContactMethodDetailsPage').default, - Settings_NewContactMethod: () => require('../../../pages/settings/Profile/Contacts/NewContactMethodPage').default, + [SCREENS.SETTINGS.PROFILE]: () => require('../../../pages/settings/Profile/ProfilePage').default, + [SCREENS.SETTINGS.PRONOUNS]: () => require('../../../pages/settings/Profile/PronounsPage').default, + [SCREENS.SETTINGS.DISPLAY_NAME]: () => require('../../../pages/settings/Profile/DisplayNamePage').default, + [SCREENS.SETTINGS.TIMEZONE]: () => require('../../../pages/settings/Profile/TimezoneInitialPage').default, + [SCREENS.SETTINGS.TIMEZONE_SELECT]: () => require('../../../pages/settings/Profile/TimezoneSelectPage').default, + [SCREENS.SETTINGS.PERSONAL_DETAILS_INITIAL]: () => require('../../../pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage').default, + [SCREENS.SETTINGS.PERSONAL_DETAILS_LEGAL_NAME]: () => require('../../../pages/settings/Profile/PersonalDetails/LegalNamePage').default, + [SCREENS.SETTINGS.PERSONAL_DETAILS_DATE_OF_BIRTH]: () => require('../../../pages/settings/Profile/PersonalDetails/DateOfBirthPage').default, + [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS]: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default, + [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS_COUNTRY]: () => require('../../../pages/settings/Profile/PersonalDetails/CountrySelectionPage').default, + [SCREENS.SETTINGS.CONTACT_METHODS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default, + [SCREENS.SETTINGS.CONTACT_METHOD_DETAILS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodDetailsPage').default, + [SCREENS.SETTINGS.NEW_CONTACT_METHOD]: () => require('../../../pages/settings/Profile/Contacts/NewContactMethodPage').default, [SCREENS.SETTINGS.PREFERENCES]: () => require('../../../pages/settings/Preferences/PreferencesPage').default, - Settings_Preferences_PriorityMode: () => require('../../../pages/settings/Preferences/PriorityModePage').default, - Settings_Preferences_Language: () => require('../../../pages/settings/Preferences/LanguagePage').default, + [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: () => require('../../../pages/settings/Preferences/PriorityModePage').default, + [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: () => require('../../../pages/settings/Preferences/LanguagePage').default, // Will be uncommented as part of https://github.com/Expensify/App/issues/21670 - // Settings_Preferences_Theme: () => require('../../../pages/settings/Preferences/ThemePage').default, - Settings_Close: () => require('../../../pages/settings/Security/CloseAccountPage').default, + // [SCREENS.SETTINGS.PREFERENCES_THEME]: () => require('../../../pages/settings/Preferences/ThemePage').default, + [SCREENS.SETTINGS.CLOSE]: () => require('../../../pages/settings/Security/CloseAccountPage').default, [SCREENS.SETTINGS.SECURITY]: () => require('../../../pages/settings/Security/SecuritySettingsPage').default, - Settings_About: () => require('../../../pages/settings/AboutPage/AboutPage').default, - Settings_App_Download_Links: () => require('../../../pages/settings/AppDownloadLinks').default, - Settings_Lounge_Access: () => require('../../../pages/settings/Profile/LoungeAccessPage').default, - Settings_Wallet: () => require('../../../pages/settings/Wallet/WalletPage').default, - Settings_Wallet_Cards_Digital_Details_Update_Address: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default, - Settings_Wallet_DomainCard: () => require('../../../pages/settings/Wallet/ExpensifyCardPage').default, - Settings_Wallet_ReportVirtualCardFraud: () => require('../../../pages/settings/Wallet/ReportVirtualCardFraudPage').default, - Settings_Wallet_Card_Activate: () => require('../../../pages/settings/Wallet/ActivatePhysicalCardPage').default, + [SCREENS.SETTINGS.ABOUT]: () => require('../../../pages/settings/AboutPage/AboutPage').default, + [SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: () => require('../../../pages/settings/AppDownloadLinks').default, + [SCREENS.SETTINGS.LOUNGE_ACCESS]: () => require('../../../pages/settings/Profile/LoungeAccessPage').default, + [SCREENS.SETTINGS.WALLET]: () => require('../../../pages/settings/Wallet/WalletPage').default, + [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default, + [SCREENS.SETTINGS.WALLET_DOMAIN_CARD]: () => require('../../../pages/settings/Wallet/ExpensifyCardPage').default, + [SCREENS.SETTINGS.WALLET_REPORT_VIRTUAL_CARD_FRAUD]: () => require('../../../pages/settings/Wallet/ReportVirtualCardFraudPage').default, + [SCREENS.SETTINGS.WALLET_CARD_ACTIVATE]: () => require('../../../pages/settings/Wallet/ActivatePhysicalCardPage').default, [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.NAME]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardName').default, [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.PHONE]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardPhone').default, [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.ADDRESS]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardAddress').default, [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.CONFIRM]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardConfirm').default, - Settings_Wallet_Transfer_Balance: () => require('../../../pages/settings/Wallet/TransferBalancePage').default, - Settings_Wallet_Choose_Transfer_Account: () => require('../../../pages/settings/Wallet/ChooseTransferAccountPage').default, - Settings_Wallet_EnablePayments: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default, - Settings_Add_Debit_Card: () => require('../../../pages/settings/Wallet/AddDebitCardPage').default, - Settings_Add_Bank_Account: () => require('../../../pages/AddPersonalBankAccountPage').default, + [SCREENS.SETTINGS.WALLET_TRANSFER_BALANCE]: () => require('../../../pages/settings/Wallet/TransferBalancePage').default, + [SCREENS.SETTINGS.WALLET_CHOOSE_TRANSFER_ACCOUNT]: () => require('../../../pages/settings/Wallet/ChooseTransferAccountPage').default, + [SCREENS.SETTINGS.WALLET_ENABLE_PAYMENTS]: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default, + [SCREENS.SETTINGS.ADD_DEBIT_CARD]: () => require('../../../pages/settings/Wallet/AddDebitCardPage').default, + [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: () => require('../../../pages/AddPersonalBankAccountPage').default, [SCREENS.SETTINGS.STATUS]: () => require('../../../pages/settings/Profile/CustomStatus/StatusPage').default, - Settings_Status_Set: () => require('../../../pages/settings/Profile/CustomStatus/StatusSetPage').default, - Workspace_Initial: () => require('../../../pages/workspace/WorkspaceInitialPage').default, - Workspace_Settings: () => require('../../../pages/workspace/WorkspaceSettingsPage').default, - Workspace_Settings_Currency: () => require('../../../pages/workspace/WorkspaceSettingsCurrencyPage').default, - Workspace_Card: () => require('../../../pages/workspace/card/WorkspaceCardPage').default, - Workspace_Reimburse: () => require('../../../pages/workspace/reimburse/WorkspaceReimbursePage').default, - Workspace_RateAndUnit: () => require('../../../pages/workspace/reimburse/WorkspaceRateAndUnitPage').default, - Workspace_Bills: () => require('../../../pages/workspace/bills/WorkspaceBillsPage').default, - Workspace_Invoices: () => require('../../../pages/workspace/invoices/WorkspaceInvoicesPage').default, - Workspace_Travel: () => require('../../../pages/workspace/travel/WorkspaceTravelPage').default, - Workspace_Members: () => require('../../../pages/workspace/WorkspaceMembersPage').default, - Workspace_Invite: () => require('../../../pages/workspace/WorkspaceInvitePage').default, - Workspace_Invite_Message: () => require('../../../pages/workspace/WorkspaceInviteMessagePage').default, - ReimbursementAccount: () => require('../../../pages/ReimbursementAccount/ReimbursementAccountPage').default, - GetAssistance: () => require('../../../pages/GetAssistancePage').default, - Settings_TwoFactorAuth: () => require('../../../pages/settings/Security/TwoFactorAuth/TwoFactorAuthPage').default, - Settings_ReportCardLostOrDamaged: () => require('../../../pages/settings/Wallet/ReportCardLostPage').default, - KeyboardShortcuts: () => require('../../../pages/KeyboardShortcutsPage').default, + [SCREENS.SETTINGS.STATUS_SET]: () => require('../../../pages/settings/Profile/CustomStatus/StatusSetPage').default, + [SCREENS.WORKSPACE.INITIAL]: () => require('../../../pages/workspace/WorkspaceInitialPage').default, + [SCREENS.WORKSPACE.SETTINGS]: () => require('../../../pages/workspace/WorkspaceSettingsPage').default, + [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceSettingsCurrencyPage').default, + [SCREENS.WORKSPACE.CARD]: () => require('../../../pages/workspace/card/WorkspaceCardPage').default, + [SCREENS.WORKSPACE.REIMBURSE]: () => require('../../../pages/workspace/reimburse/WorkspaceReimbursePage').default, + [SCREENS.WORKSPACE.RATE_AND_UNIT]: () => require('../../../pages/workspace/reimburse/WorkspaceRateAndUnitPage').default, + [SCREENS.WORKSPACE.BILLS]: () => require('../../../pages/workspace/bills/WorkspaceBillsPage').default, + [SCREENS.WORKSPACE.INVOICES]: () => require('../../../pages/workspace/invoices/WorkspaceInvoicesPage').default, + [SCREENS.WORKSPACE.TRAVEL]: () => require('../../../pages/workspace/travel/WorkspaceTravelPage').default, + [SCREENS.WORKSPACE.MEMBERS]: () => require('../../../pages/workspace/WorkspaceMembersPage').default, + [SCREENS.WORKSPACE.INVITE]: () => require('../../../pages/workspace/WorkspaceInvitePage').default, + [SCREENS.WORKSPACE.INVITE_MESSAGE]: () => require('../../../pages/workspace/WorkspaceInviteMessagePage').default, + [SCREENS.REIMBURSEMENT_ACCOUNT]: () => require('../../../pages/ReimbursementAccount/ReimbursementAccountPage').default, + [SCREENS.GET_ASSISTANCE]: () => require('../../../pages/GetAssistancePage').default, + [SCREENS.SETTINGS.TWO_FACTOR_AUTH]: () => require('../../../pages/settings/Security/TwoFactorAuth/TwoFactorAuthPage').default, + [SCREENS.SETTINGS.REPORT_CARD_LOST_OR_DAMAGED]: () => require('../../../pages/settings/Wallet/ReportCardLostPage').default, + [SCREENS.KEYBOARD_SHORTCUTS]: () => require('../../../pages/KeyboardShortcutsPage').default, }); const EnablePaymentsStackNavigator = createModalStackNavigator({ - EnablePayments_Root: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default, + [SCREENS.ENABLE_PAYMENTS_ROOT]: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default, }); const AddPersonalBankAccountModalStackNavigator = createModalStackNavigator({ - AddPersonalBankAccount_Root: () => require('../../../pages/AddPersonalBankAccountPage').default, + [SCREENS.ADD_PERSONAL_BANK_ACCOUNT_ROOT]: () => require('../../../pages/AddPersonalBankAccountPage').default, }); const ReimbursementAccountModalStackNavigator = createModalStackNavigator({ - ReimbursementAccount_Root: () => require('../../../pages/ReimbursementAccount/ReimbursementAccountPage').default, + [SCREENS.REIMBURSEMENT_ACCOUNT_ROOT]: () => require('../../../pages/ReimbursementAccount/ReimbursementAccountPage').default, }); const WalletStatementStackNavigator = createModalStackNavigator({ - WalletStatement_Root: () => require('../../../pages/wallet/WalletStatementPage').default, + [SCREENS.WALLET_STATEMENT_ROOT]: () => require('../../../pages/wallet/WalletStatementPage').default, }); const FlagCommentStackNavigator = createModalStackNavigator({ - FlagComment_Root: () => require('../../../pages/FlagCommentPage').default, + [SCREENS.FLAG_COMMENT_ROOT]: () => require('../../../pages/FlagCommentPage').default, }); const EditRequestStackNavigator = createModalStackNavigator({ - EditRequest_Root: () => require('../../../pages/EditRequestPage').default, - EditRequest_Currency: () => require('../../../pages/iou/IOUCurrencySelection').default, + [SCREENS.EDIT_REQUEST.ROOT]: () => require('../../../pages/EditRequestPage').default, + [SCREENS.EDIT_REQUEST.CURRENCY]: () => require('../../../pages/iou/IOUCurrencySelection').default, }); const PrivateNotesModalStackNavigator = createModalStackNavigator({ - PrivateNotes_View: () => require('../../../pages/PrivateNotes/PrivateNotesViewPage').default, - PrivateNotes_List: () => require('../../../pages/PrivateNotes/PrivateNotesListPage').default, - PrivateNotes_Edit: () => require('../../../pages/PrivateNotes/PrivateNotesEditPage').default, + [SCREENS.PRIVATE_NOTES.VIEW]: () => require('../../../pages/PrivateNotes/PrivateNotesViewPage').default, + [SCREENS.PRIVATE_NOTES.LIST]: () => require('../../../pages/PrivateNotes/PrivateNotesListPage').default, + [SCREENS.PRIVATE_NOTES.EDIT]: () => require('../../../pages/PrivateNotes/PrivateNotesEditPage').default, }); const SignInModalStackNavigator = createModalStackNavigator({ - SignIn_Root: () => require('../../../pages/signin/SignInModal').default, + [SCREENS.SIGN_IN_ROOT]: () => require('../../../pages/signin/SignInModal').default, }); + const ReferralModalStackNavigator = createModalStackNavigator({ - Referral_Details: () => require('../../../pages/ReferralDetailsPage').default, + [SCREENS.REFERRAL_DETAILS]: () => require('../../../pages/ReferralDetailsPage').default, }); export { From b30090467e00bcdbdfaa4e29febba4f01ee00081 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 16:32:22 +0100 Subject: [PATCH 05/17] Fix linkingConfig --- src/SCREENS.ts | 2 +- src/libs/Navigation/linkingConfig.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 59e456310fe2..9b2ba43d841c 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -200,7 +200,7 @@ const SCREENS = { ROOM_MEMBERS_ROOT: 'RoomMembers_Root', ROOM_INVITE_ROOT: 'RoomInvite_Root', SEARCH_ROOT: 'Search_Root', - NEW_CHAT_ROOT: 'NewChat_Root', + NEW_CHAT: {ROOT: 'NewChat_Root', NEW_CHAT: 'chat', NEW_ROOM: 'room'}, FLAG_COMMENT_ROOT: 'FlagComment_Root', REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount', GET_ASSISTANCE: 'GetAssistance', diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index add2208a9bf1..62fb06dff72d 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -121,7 +121,7 @@ const linkingConfig: LinkingOptions = { exact: true, }, [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: { - path: ROUTES.SETTINGS_WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS.route, + path: ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.route, exact: true, }, [SCREENS.SETTINGS.ADD_DEBIT_CARD]: { @@ -294,15 +294,15 @@ const linkingConfig: LinkingOptions = { }, [SCREENS.RIGHT_MODAL.NEW_CHAT]: { screens: { - NewChat_Root: { + [SCREENS.NEW_CHAT.ROOT]: { path: ROUTES.NEW, exact: true, screens: { - chat: { + [SCREENS.NEW_CHAT.NEW_CHAT]: { path: ROUTES.NEW_CHAT, exact: true, }, - room: { + [SCREENS.NEW_CHAT.NEW_ROOM]: { path: ROUTES.NEW_ROOM, exact: true, }, @@ -310,7 +310,7 @@ const linkingConfig: LinkingOptions = { }, }, }, - [SCREENS.RIGHT_MODAL.NEW_CHAT]: { + [SCREENS.RIGHT_MODAL.NEW_TASK]: { screens: { [SCREENS.NEW_TASK.ROOT]: ROUTES.NEW_TASK, [SCREENS.NEW_TASK.TASK_ASSIGNEE_SELECTOR]: ROUTES.NEW_TASK_ASSIGNEE, From eab43351194dae8f682b4a5c566c7f9bdd43c5e7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 16:49:05 +0100 Subject: [PATCH 06/17] Last fixes in ModalStackNavigators --- src/libs/Navigation/AppNavigator/ModalStackNavigators.js | 2 +- src/libs/Navigation/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index 1c8f742e72b5..075e818820f7 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -116,7 +116,7 @@ const SearchModalStackNavigator = createModalStackNavigator({ }); const NewChatModalStackNavigator = createModalStackNavigator({ - [SCREENS.NEW_CHAT_ROOT]: () => require('../../../pages/NewChatSelectorPage').default, + [SCREENS.NEW_CHAT.ROOT]: () => require('../../../pages/NewChatSelectorPage').default, }); const NewTaskModalStackNavigator = createModalStackNavigator({ diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 4e4ade108028..012856f0807d 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -123,7 +123,7 @@ type SettingsNavigatorParamList = { }; type NewChatNavigatorParamList = { - [SCREENS.NEW_CHAT_ROOT]: undefined; + [SCREENS.NEW_CHAT.ROOT]: undefined; }; type SearchNavigatorParamList = { From ca5e2fa949253bf1edc83291aee778509f7dad56 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 17:07:54 +0100 Subject: [PATCH 07/17] Use constants in Right modal --- .../Navigators/RightModalNavigator.js | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.js b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.js index c5786a0fcfe4..06d35e9f995d 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.js +++ b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.js @@ -7,6 +7,7 @@ import useWindowDimensions from '@hooks/useWindowDimensions'; import * as ModalStackNavigators from '@libs/Navigation/AppNavigator/ModalStackNavigators'; import RHPScreenOptions from '@libs/Navigation/AppNavigator/RHPScreenOptions'; import useThemeStyles from '@styles/useThemeStyles'; +import SCREENS from '@src/SCREENS'; import Overlay from './Overlay'; const Stack = createStackNavigator(); @@ -29,99 +30,99 @@ function RightModalNavigator(props) { From fbc11ca729ffa4676fb3bc8cd110ac3890debff6 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 17:08:28 +0100 Subject: [PATCH 08/17] Use SCREEN.ts constant in a component --- src/libs/actions/Welcome.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Welcome.ts b/src/libs/actions/Welcome.ts index 7fd7adeafa96..02109804efb9 100644 --- a/src/libs/actions/Welcome.ts +++ b/src/libs/actions/Welcome.ts @@ -119,7 +119,7 @@ function show({routes, showCreateMenu = () => {}, showPopoverMenu = () => false} // If we are rendering the SidebarScreen at the same time as a workspace route that means we've already created a workspace via workspace/new and should not open the global // create menu right now. We should also stay on the workspace page if that is our destination. const topRoute = routes.length > 0 ? routes[routes.length - 1] : undefined; - const isWorkspaceRoute = topRoute !== undefined && topRoute.name === 'Settings' && topRoute.params?.path.includes('workspace'); + const isWorkspaceRoute = topRoute !== undefined && topRoute.name === SCREENS.RIGHT_MODAL.SETTINGS && topRoute.params?.path.includes('workspace'); const transitionRoute = routes.find((route) => route.name === SCREENS.TRANSITION_BETWEEN_APPS); const exitingToWorkspaceRoute = transitionRoute?.params?.exitTo === 'workspace/new'; const openOnAdminRoom = topRoute?.params?.openOnAdminRoom ?? false; From c257943d8de41f136187e43803d400d46f0f488d Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Mon, 4 Dec 2023 17:19:02 +0100 Subject: [PATCH 09/17] update nav docs --- contributingGuides/NAVIGATION.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/contributingGuides/NAVIGATION.md b/contributingGuides/NAVIGATION.md index 32d3919efbe4..d4e4b81bead0 100644 --- a/contributingGuides/NAVIGATION.md +++ b/contributingGuides/NAVIGATION.md @@ -40,7 +40,17 @@ When creating RHP flows, you have to remember a couple things: An example of adding `Settings_Workspaces` page: -1. Add path to `ROUTES.ts`: https://github.com/Expensify/App/blob/main/src/ROUTES.ts +1. Add the page name to `SCREENS.ts` which will be reused throughout the app (linkingConfig, navigators, etc.): + +```ts +const SCREENS = { + SETTINGS: { + WORKSPACES: 'Settings_Workspaces', + }, +} as const; +``` + +2. Add path to `ROUTES.ts`: https://github.com/Expensify/App/blob/main/src/ROUTES.ts ```ts export const ROUTES = { @@ -55,11 +65,11 @@ export const ROUTES = { ``` -2. Add `Settings_Workspaces` page to proper RHP flow in `linkingConfig.ts`: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/libs/Navigation/linkingConfig.js#L40-L42 +3. Add `Settings_Workspaces` page to proper RHP flow in `linkingConfig.ts`: https://github.com/software-mansion-labs/expensify-app-fork/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/linkingConfig.ts#L47-L50 -3. Add your page to proper navigator (it should be aligned with where you've put it in the previous step) https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/libs/Navigation/AppNavigator/ModalStackNavigators.js#L334-L338 +4. Add your page to proper navigator (it should be aligned with where you've put it in the previous step) https://github.com/software-mansion-labs/expensify-app-fork/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/AppNavigator/ModalStackNavigators.js#L141 -4. Make sure `HeaderWithBackButton` leads to the previous page in navigation flow of your page: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/pages/workspace/WorkspacesListPage.js#L186 +5. Make sure `HeaderWithBackButton` leads to the previous page in navigation flow of your page: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/pages/workspace/WorkspacesListPage.js#L186 ## Performance solutions From 9fb1085b2b7d23c43cc2e1d134dcfe23179526a7 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Tue, 5 Dec 2023 13:55:43 +0100 Subject: [PATCH 10/17] Modify links to og repo --- contributingGuides/NAVIGATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contributingGuides/NAVIGATION.md b/contributingGuides/NAVIGATION.md index d4e4b81bead0..c76a46ab8c06 100644 --- a/contributingGuides/NAVIGATION.md +++ b/contributingGuides/NAVIGATION.md @@ -65,9 +65,9 @@ export const ROUTES = { ``` -3. Add `Settings_Workspaces` page to proper RHP flow in `linkingConfig.ts`: https://github.com/software-mansion-labs/expensify-app-fork/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/linkingConfig.ts#L47-L50 +3. Add `Settings_Workspaces` page to proper RHP flow in `linkingConfig.ts`: https://github.com/Expensify/App/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/linkingConfig.ts#L47-L50 -4. Add your page to proper navigator (it should be aligned with where you've put it in the previous step) https://github.com/software-mansion-labs/expensify-app-fork/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/AppNavigator/ModalStackNavigators.js#L141 +4. Add your page to proper navigator (it should be aligned with where you've put it in the previous step) https://github.com/Expensify/App/blob/fbc11ca729ffa4676fb3bc8cd110ac3890debff6/src/libs/Navigation/AppNavigator/ModalStackNavigators.js#L141 5. Make sure `HeaderWithBackButton` leads to the previous page in navigation flow of your page: https://github.com/Expensify/App/blob/3531af22dcadaa94ed11eccf370517dca0b8c305/src/pages/workspace/WorkspacesListPage.js#L186 From 7f308b8642842b88c4ca4eb86a4adecbe8f59030 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 11:06:56 +0100 Subject: [PATCH 11/17] Extract WALLET screens --- src/SCREENS.ts | 46 +++++++++++-------- .../AppNavigator/ModalStackNavigators.tsx | 24 +++++----- src/libs/Navigation/linkingConfig.ts | 24 +++++----- src/libs/Navigation/types.ts | 24 +++++----- src/pages/settings/Wallet/WalletEmptyState.js | 2 +- src/styles/themes/default.ts | 2 +- src/styles/themes/light.ts | 2 +- 7 files changed, 67 insertions(+), 57 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 3ad23aae627e..74f88c96e91d 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -19,11 +19,37 @@ const SCREENS = { UNLINK_LOGIN: 'UnlinkLogin', SETTINGS: { ROOT: 'Settings_Root', - PREFERENCES: 'Settings_Preferences', + + SHARE_CODE: 'Settings_Share_Code', + WORKSPACES: 'Settings_Workspaces', + + PROFILE: 'Settings_Profile', + + PREFERENCES: 'Settings_Preferences', + SECURITY: 'Settings_Security', + + WALLET: { + ROOT: 'Settings_Wallet', + DOMAIN_CARD: 'Settings_Wallet_DomainCard', + CARD_GET_PHYSICAL: { + NAME: 'Settings_Card_Get_Physical_Name', + PHONE: 'Settings_Card_Get_Physical_Phone', + ADDRESS: 'Settings_Card_Get_Physical_Address', + CONFIRM: 'Settings_Card_Get_Physical_Confirm', + }, + TRANSFER_BALANCE: 'Settings_Wallet_Transfer_Balance', + CHOOSE_TRANSFER_ACCOUNT: 'Settings_Wallet_Choose_Transfer_Account', + ENABLE_PAYMENTS: 'Settings_Wallet_EnablePayments', + CARD_ACTIVATE: 'Settings_Wallet_Card_Activate', + REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud', + CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address', + }, + + ABOUT: 'Settings_About', + STATUS: 'Settings_Status', - PROFILE: 'Settings_Profile', PRONOUNS: 'Settings_Pronouns', DISPLAY_NAME: 'Settings_Display_Name', TIMEZONE: 'Settings_Timezone', @@ -36,24 +62,8 @@ const SCREENS = { CONTACT_METHODS: 'Settings_ContactMethods', CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails', NEW_CONTACT_METHOD: 'Settings_NewContactMethod', - SHARE_CODE: 'Settings_Share_Code', - ABOUT: 'Settings_About', APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links', LOUNGE_ACCESS: 'Settings_Lounge_Access', - WALLET: 'Settings_Wallet', - WALLET_DOMAIN_CARD: 'Settings_Wallet_DomainCard', - WALLET_CARD_GET_PHYSICAL: { - NAME: 'Settings_Card_Get_Physical_Name', - PHONE: 'Settings_Card_Get_Physical_Phone', - ADDRESS: 'Settings_Card_Get_Physical_Address', - CONFIRM: 'Settings_Card_Get_Physical_Confirm', - }, - WALLET_TRANSFER_BALANCE: 'Settings_Wallet_Transfer_Balance', - WALLET_CHOOSE_TRANSFER_ACCOUNT: 'Settings_Wallet_Choose_Transfer_Account', - WALLET_ENABLE_PAYMENTS: 'Settings_Wallet_EnablePayments', - WALLET_CARD_ACTIVATE: 'Settings_Wallet_Card_Activate', - WALLET_REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud', - WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address', ADD_DEBIT_CARD: 'Settings_Add_Debit_Card', ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account', PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 163423036362..c04a0989b636 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -191,18 +191,18 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType, [SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: () => require('../../../pages/settings/AppDownloadLinks').default as React.ComponentType, [SCREENS.SETTINGS.LOUNGE_ACCESS]: () => require('../../../pages/settings/Profile/LoungeAccessPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET]: () => require('../../../pages/settings/Wallet/WalletPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_DOMAIN_CARD]: () => require('../../../pages/settings/Wallet/ExpensifyCardPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_REPORT_VIRTUAL_CARD_FRAUD]: () => require('../../../pages/settings/Wallet/ReportVirtualCardFraudPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CARD_ACTIVATE]: () => require('../../../pages/settings/Wallet/ActivatePhysicalCardPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.NAME]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardName').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.PHONE]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardPhone').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.ADDRESS]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardAddress').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.CONFIRM]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardConfirm').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_TRANSFER_BALANCE]: () => require('../../../pages/settings/Wallet/TransferBalancePage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_CHOOSE_TRANSFER_ACCOUNT]: () => require('../../../pages/settings/Wallet/ChooseTransferAccountPage').default as React.ComponentType, - [SCREENS.SETTINGS.WALLET_ENABLE_PAYMENTS]: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.ROOT]: () => require('../../../pages/settings/Wallet/WalletPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.DOMAIN_CARD]: () => require('../../../pages/settings/Wallet/ExpensifyCardPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD]: () => require('../../../pages/settings/Wallet/ReportVirtualCardFraudPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CARD_ACTIVATE]: () => require('../../../pages/settings/Wallet/ActivatePhysicalCardPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.NAME]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardName').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.PHONE]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardPhone').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.ADDRESS]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardAddress').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.CONFIRM]: () => require('../../../pages/settings/Wallet/Card/GetPhysicalCardConfirm').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.TRANSFER_BALANCE]: () => require('../../../pages/settings/Wallet/TransferBalancePage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.CHOOSE_TRANSFER_ACCOUNT]: () => require('../../../pages/settings/Wallet/ChooseTransferAccountPage').default as React.ComponentType, + [SCREENS.SETTINGS.WALLET.ENABLE_PAYMENTS]: () => require('../../../pages/EnablePayments/EnablePaymentsPage').default as React.ComponentType, [SCREENS.SETTINGS.ADD_DEBIT_CARD]: () => require('../../../pages/settings/Wallet/AddDebitCardPage').default as React.ComponentType, [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: () => require('../../../pages/AddPersonalBankAccountPage').default as React.ComponentType, [SCREENS.SETTINGS.STATUS]: () => require('../../../pages/settings/Profile/CustomStatus/StatusPage').default as React.ComponentType, diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index 62fb06dff72d..e9f3a9f488ae 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -72,43 +72,43 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_SECURITY, exact: true, }, - [SCREENS.SETTINGS.WALLET]: { + [SCREENS.SETTINGS.WALLET.ROOT]: { path: ROUTES.SETTINGS_WALLET, exact: true, }, - [SCREENS.SETTINGS.WALLET_DOMAIN_CARD]: { + [SCREENS.SETTINGS.WALLET.DOMAIN_CARD]: { path: ROUTES.SETTINGS_WALLET_DOMAINCARD.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_REPORT_VIRTUAL_CARD_FRAUD]: { + [SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD]: { path: ROUTES.SETTINGS_REPORT_FRAUD.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.NAME]: { + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.NAME]: { path: ROUTES.SETTINGS_WALLET_CARD_GET_PHYSICAL_NAME.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.PHONE]: { + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.PHONE]: { path: ROUTES.SETTINGS_WALLET_CARD_GET_PHYSICAL_PHONE.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.ADDRESS]: { + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.ADDRESS]: { path: ROUTES.SETTINGS_WALLET_CARD_GET_PHYSICAL_ADDRESS.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.CONFIRM]: { + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.CONFIRM]: { path: ROUTES.SETTINGS_WALLET_CARD_GET_PHYSICAL_CONFIRM.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_ENABLE_PAYMENTS]: { + [SCREENS.SETTINGS.WALLET.ENABLE_PAYMENTS]: { path: ROUTES.SETTINGS_ENABLE_PAYMENTS, exact: true, }, - [SCREENS.SETTINGS.WALLET_TRANSFER_BALANCE]: { + [SCREENS.SETTINGS.WALLET.TRANSFER_BALANCE]: { path: ROUTES.SETTINGS_WALLET_TRANSFER_BALANCE, exact: true, }, - [SCREENS.SETTINGS.WALLET_CHOOSE_TRANSFER_ACCOUNT]: { + [SCREENS.SETTINGS.WALLET.CHOOSE_TRANSFER_ACCOUNT]: { path: ROUTES.SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT, exact: true, }, @@ -116,11 +116,11 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_WALLET_REPORT_CARD_LOST_OR_DAMAGED.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_CARD_ACTIVATE]: { + [SCREENS.SETTINGS.WALLET.CARD_ACTIVATE]: { path: ROUTES.SETTINGS_WALLET_CARD_ACTIVATE.route, exact: true, }, - [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: { + [SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: { path: ROUTES.SETTINGS_WALLET_CARD_DIGITAL_DETAILS_UPDATE_ADDRESS.route, exact: true, }, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index d48e14083c4c..4f29308a8f0e 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -67,18 +67,18 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.ABOUT]: undefined; [SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: undefined; [SCREENS.SETTINGS.LOUNGE_ACCESS]: undefined; - [SCREENS.SETTINGS.WALLET]: undefined; - [SCREENS.SETTINGS.WALLET_CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: undefined; - [SCREENS.SETTINGS.WALLET_DOMAIN_CARD]: undefined; - [SCREENS.SETTINGS.WALLET_REPORT_VIRTUAL_CARD_FRAUD]: undefined; - [SCREENS.SETTINGS.WALLET_CARD_ACTIVATE]: undefined; - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.NAME]: undefined; - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.PHONE]: undefined; - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.ADDRESS]: undefined; - [SCREENS.SETTINGS.WALLET_CARD_GET_PHYSICAL.CONFIRM]: undefined; - [SCREENS.SETTINGS.WALLET_TRANSFER_BALANCE]: undefined; - [SCREENS.SETTINGS.WALLET_CHOOSE_TRANSFER_ACCOUNT]: undefined; - [SCREENS.SETTINGS.WALLET_ENABLE_PAYMENTS]: undefined; + [SCREENS.SETTINGS.WALLET.ROOT]: undefined; + [SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: undefined; + [SCREENS.SETTINGS.WALLET.DOMAIN_CARD]: undefined; + [SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD]: undefined; + [SCREENS.SETTINGS.WALLET.CARD_ACTIVATE]: undefined; + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.NAME]: undefined; + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.PHONE]: undefined; + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.ADDRESS]: undefined; + [SCREENS.SETTINGS.WALLET.CARD_GET_PHYSICAL.CONFIRM]: undefined; + [SCREENS.SETTINGS.WALLET.TRANSFER_BALANCE]: undefined; + [SCREENS.SETTINGS.WALLET.CHOOSE_TRANSFER_ACCOUNT]: undefined; + [SCREENS.SETTINGS.WALLET.ENABLE_PAYMENTS]: undefined; [SCREENS.SETTINGS.ADD_DEBIT_CARD]: undefined; [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: undefined; [SCREENS.SETTINGS.STATUS]: undefined; diff --git a/src/pages/settings/Wallet/WalletEmptyState.js b/src/pages/settings/Wallet/WalletEmptyState.js index f2235dfafef2..f4609bdc8534 100644 --- a/src/pages/settings/Wallet/WalletEmptyState.js +++ b/src/pages/settings/Wallet/WalletEmptyState.js @@ -36,7 +36,7 @@ function WalletEmptyState({onAddPaymentMethod}) { const {translate} = useLocalize(); return ( Navigation.goBack(ROUTES.SETTINGS)} title={translate('common.wallet')} diff --git a/src/styles/themes/default.ts b/src/styles/themes/default.ts index 59de9b7269a8..97dd0469fcea 100644 --- a/src/styles/themes/default.ts +++ b/src/styles/themes/default.ts @@ -111,7 +111,7 @@ const darkTheme = { backgroundColor: colors.pink800, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, - [SCREENS.SETTINGS.WALLET]: { + [SCREENS.SETTINGS.WALLET.ROOT]: { backgroundColor: colors.darkAppBackground, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, diff --git a/src/styles/themes/light.ts b/src/styles/themes/light.ts index 1541c0e723d7..4f40c3fa274d 100644 --- a/src/styles/themes/light.ts +++ b/src/styles/themes/light.ts @@ -111,7 +111,7 @@ const lightTheme = { backgroundColor: colors.pink800, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, - [SCREENS.SETTINGS.WALLET]: { + [SCREENS.SETTINGS.WALLET.ROOT]: { backgroundColor: colors.darkAppBackground, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, From b34f8e1badeb862080798fcf51cdded8dc3a6b43 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 11:10:56 +0100 Subject: [PATCH 12/17] Reorder SCREENS --- src/SCREENS.ts | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 74f88c96e91d..f8ad8e277cd5 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -25,8 +25,26 @@ const SCREENS = { WORKSPACES: 'Settings_Workspaces', PROFILE: 'Settings_Profile', + DISPLAY_NAME: 'Settings_Display_Name', + CONTACT_METHODS: 'Settings_ContactMethods', + CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails', + NEW_CONTACT_METHOD: 'Settings_NewContactMethod', + STATUS: 'Settings_Status', + STATUS_SET: 'Settings_Status_Set', + PRONOUNS: 'Settings_Pronouns', + TIMEZONE: 'Settings_Timezone', + TIMEZONE_SELECT: 'Settings_Timezone_Select', + + PERSONAL_DETAILS_INITIAL: 'Settings_PersonalDetails_Initial', + PERSONAL_DETAILS_LEGAL_NAME: 'Settings_PersonalDetails_LegalName', + PERSONAL_DETAILS_DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth', + PERSONAL_DETAILS_ADDRESS: 'Settings_PersonalDetails_Address', + PERSONAL_DETAILS_ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country', PREFERENCES: 'Settings_Preferences', + PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode', + PREFERENCES_LANGUAGE: 'Settings_Preferences_Language', + PREFERENCES_THEME: 'Settings_Preferences_Theme', SECURITY: 'Settings_Security', @@ -49,28 +67,11 @@ const SCREENS = { ABOUT: 'Settings_About', - STATUS: 'Settings_Status', - PRONOUNS: 'Settings_Pronouns', - DISPLAY_NAME: 'Settings_Display_Name', - TIMEZONE: 'Settings_Timezone', - TIMEZONE_SELECT: 'Settings_Timezone_Select', - PERSONAL_DETAILS_INITIAL: 'Settings_PersonalDetails_Initial', - PERSONAL_DETAILS_LEGAL_NAME: 'Settings_PersonalDetails_LegalName', - PERSONAL_DETAILS_DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth', - PERSONAL_DETAILS_ADDRESS: 'Settings_PersonalDetails_Address', - PERSONAL_DETAILS_ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country', - CONTACT_METHODS: 'Settings_ContactMethods', - CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails', - NEW_CONTACT_METHOD: 'Settings_NewContactMethod', APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links', LOUNGE_ACCESS: 'Settings_Lounge_Access', ADD_DEBIT_CARD: 'Settings_Add_Debit_Card', ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account', - PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode', - PREFERENCES_LANGUAGE: 'Settings_Preferences_Language', - PREFERENCES_THEME: 'Settings_Preferences_Theme', CLOSE: 'Settings_Close', - STATUS_SET: 'Settings_Status_Set', TWO_FACTOR_AUTH: 'Settings_TwoFactorAuth', REPORT_CARD_LOST_OR_DAMAGED: 'Settings_ReportCardLostOrDamaged', }, From b71d6f8668feef3f0fc22f25b6df18a4e6de8071 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 11:16:04 +0100 Subject: [PATCH 13/17] Group PROFILE and PERSONAL DETAILS --- src/SCREENS.ts | 36 ++++++++++--------- .../AppNavigator/ModalStackNavigators.tsx | 32 ++++++++--------- src/libs/Navigation/linkingConfig.ts | 30 ++++++++-------- src/libs/Navigation/types.ts | 30 ++++++++-------- .../Profile/CustomStatus/StatusPage.js | 2 +- src/styles/themes/default.ts | 2 +- src/styles/themes/light.ts | 2 +- 7 files changed, 69 insertions(+), 65 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index f8ad8e277cd5..7e7c422777d8 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -24,22 +24,26 @@ const SCREENS = { WORKSPACES: 'Settings_Workspaces', - PROFILE: 'Settings_Profile', - DISPLAY_NAME: 'Settings_Display_Name', - CONTACT_METHODS: 'Settings_ContactMethods', - CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails', - NEW_CONTACT_METHOD: 'Settings_NewContactMethod', - STATUS: 'Settings_Status', - STATUS_SET: 'Settings_Status_Set', - PRONOUNS: 'Settings_Pronouns', - TIMEZONE: 'Settings_Timezone', - TIMEZONE_SELECT: 'Settings_Timezone_Select', - - PERSONAL_DETAILS_INITIAL: 'Settings_PersonalDetails_Initial', - PERSONAL_DETAILS_LEGAL_NAME: 'Settings_PersonalDetails_LegalName', - PERSONAL_DETAILS_DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth', - PERSONAL_DETAILS_ADDRESS: 'Settings_PersonalDetails_Address', - PERSONAL_DETAILS_ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country', + PROFILE: { + ROOT: 'Settings_Profile', + DISPLAY_NAME: 'Settings_Display_Name', + CONTACT_METHODS: 'Settings_ContactMethods', + CONTACT_METHOD_DETAILS: 'Settings_ContactMethodDetails', + NEW_CONTACT_METHOD: 'Settings_NewContactMethod', + STATUS: 'Settings_Status', + STATUS_SET: 'Settings_Status_Set', + PRONOUNS: 'Settings_Pronouns', + TIMEZONE: 'Settings_Timezone', + TIMEZONE_SELECT: 'Settings_Timezone_Select', + + PERSONAL_DETAILS: { + INITIAL: 'Settings_PersonalDetails_Initial', + LEGAL_NAME: 'Settings_PersonalDetails_LegalName', + DATE_OF_BIRTH: 'Settings_PersonalDetails_DateOfBirth', + ADDRESS: 'Settings_PersonalDetails_Address', + ADDRESS_COUNTRY: 'Settings_PersonalDetails_Address_Country', + }, + }, PREFERENCES: 'Settings_Preferences', PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index c04a0989b636..73fdefe06b8f 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -145,7 +145,7 @@ const SearchModalStackNavigator = createModalStackNavigator({ - [SCREENS.NEW_CHAT_ROOT]: () => require('../../../pages/NewChatSelectorPage').default as React.ComponentType, + [SCREENS.NEW_CHAT.ROOT]: () => require('../../../pages/NewChatSelectorPage').default as React.ComponentType, }); const NewTaskModalStackNavigator = createModalStackNavigator({ @@ -168,19 +168,19 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/settings/InitialSettingsPage').default as React.ComponentType, [SCREENS.SETTINGS.SHARE_CODE]: () => require('../../../pages/ShareCodePage').default as React.ComponentType, [SCREENS.SETTINGS.WORKSPACES]: () => require('../../../pages/workspace/WorkspacesListPage').default as React.ComponentType, - [SCREENS.SETTINGS.PROFILE]: () => require('../../../pages/settings/Profile/ProfilePage').default as React.ComponentType, - [SCREENS.SETTINGS.PRONOUNS]: () => require('../../../pages/settings/Profile/PronounsPage').default as React.ComponentType, - [SCREENS.SETTINGS.DISPLAY_NAME]: () => require('../../../pages/settings/Profile/DisplayNamePage').default as React.ComponentType, - [SCREENS.SETTINGS.TIMEZONE]: () => require('../../../pages/settings/Profile/TimezoneInitialPage').default as React.ComponentType, - [SCREENS.SETTINGS.TIMEZONE_SELECT]: () => require('../../../pages/settings/Profile/TimezoneSelectPage').default as React.ComponentType, - [SCREENS.SETTINGS.PERSONAL_DETAILS_INITIAL]: () => require('../../../pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage').default as React.ComponentType, - [SCREENS.SETTINGS.PERSONAL_DETAILS_LEGAL_NAME]: () => require('../../../pages/settings/Profile/PersonalDetails/LegalNamePage').default as React.ComponentType, - [SCREENS.SETTINGS.PERSONAL_DETAILS_DATE_OF_BIRTH]: () => require('../../../pages/settings/Profile/PersonalDetails/DateOfBirthPage').default as React.ComponentType, - [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS]: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default as React.ComponentType, - [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS_COUNTRY]: () => require('../../../pages/settings/Profile/PersonalDetails/CountrySelectionPage').default as React.ComponentType, - [SCREENS.SETTINGS.CONTACT_METHODS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default as React.ComponentType, - [SCREENS.SETTINGS.CONTACT_METHOD_DETAILS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodDetailsPage').default as React.ComponentType, - [SCREENS.SETTINGS.NEW_CONTACT_METHOD]: () => require('../../../pages/settings/Profile/Contacts/NewContactMethodPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.ROOT]: () => require('../../../pages/settings/Profile/ProfilePage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.PRONOUNS]: () => require('../../../pages/settings/Profile/PronounsPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.DISPLAY_NAME]: () => require('../../../pages/settings/Profile/DisplayNamePage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.TIMEZONE]: () => require('../../../pages/settings/Profile/TimezoneInitialPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.TIMEZONE_SELECT]: () => require('../../../pages/settings/Profile/TimezoneSelectPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.INITIAL]: () => require('../../../pages/settings/Profile/PersonalDetails/PersonalDetailsInitialPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.LEGAL_NAME]: () => require('../../../pages/settings/Profile/PersonalDetails/LegalNamePage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.DATE_OF_BIRTH]: () => require('../../../pages/settings/Profile/PersonalDetails/DateOfBirthPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.ADDRESS]: () => require('../../../pages/settings/Profile/PersonalDetails/AddressPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.ADDRESS_COUNTRY]: () => require('../../../pages/settings/Profile/PersonalDetails/CountrySelectionPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.CONTACT_METHODS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodDetailsPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD]: () => require('../../../pages/settings/Profile/Contacts/NewContactMethodPage').default as React.ComponentType, [SCREENS.SETTINGS.PREFERENCES]: () => require('../../../pages/settings/Preferences/PreferencesPage').default as React.ComponentType, [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: () => require('../../../pages/settings/Preferences/PriorityModePage').default as React.ComponentType, [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: () => require('../../../pages/settings/Preferences/LanguagePage').default as React.ComponentType, @@ -205,8 +205,8 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/EnablePayments/EnablePaymentsPage').default as React.ComponentType, [SCREENS.SETTINGS.ADD_DEBIT_CARD]: () => require('../../../pages/settings/Wallet/AddDebitCardPage').default as React.ComponentType, [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: () => require('../../../pages/AddPersonalBankAccountPage').default as React.ComponentType, - [SCREENS.SETTINGS.STATUS]: () => require('../../../pages/settings/Profile/CustomStatus/StatusPage').default as React.ComponentType, - [SCREENS.SETTINGS.STATUS_SET]: () => require('../../../pages/settings/Profile/CustomStatus/StatusSetPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.STATUS]: () => require('../../../pages/settings/Profile/CustomStatus/StatusPage').default as React.ComponentType, + [SCREENS.SETTINGS.PROFILE.STATUS_SET]: () => require('../../../pages/settings/Profile/CustomStatus/StatusSetPage').default as React.ComponentType, [SCREENS.WORKSPACE.INITIAL]: () => require('../../../pages/workspace/WorkspaceInitialPage').default as React.ComponentType, [SCREENS.WORKSPACE.SETTINGS]: () => require('../../../pages/workspace/WorkspaceSettingsPage').default as React.ComponentType, [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceSettingsCurrencyPage').default as React.ComponentType, diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index e9f3a9f488ae..5767ad116370 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -132,23 +132,23 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_ADD_BANK_ACCOUNT, exact: true, }, - [SCREENS.SETTINGS.PROFILE]: { + [SCREENS.SETTINGS.PROFILE.ROOT]: { path: ROUTES.SETTINGS_PROFILE, exact: true, }, - [SCREENS.SETTINGS.PRONOUNS]: { + [SCREENS.SETTINGS.PROFILE.PRONOUNS]: { path: ROUTES.SETTINGS_PRONOUNS, exact: true, }, - [SCREENS.SETTINGS.DISPLAY_NAME]: { + [SCREENS.SETTINGS.PROFILE.DISPLAY_NAME]: { path: ROUTES.SETTINGS_DISPLAY_NAME, exact: true, }, - [SCREENS.SETTINGS.TIMEZONE]: { + [SCREENS.SETTINGS.PROFILE.TIMEZONE]: { path: ROUTES.SETTINGS_TIMEZONE, exact: true, }, - [SCREENS.SETTINGS.TIMEZONE_SELECT]: { + [SCREENS.SETTINGS.PROFILE.TIMEZONE_SELECT]: { path: ROUTES.SETTINGS_TIMEZONE_SELECT, exact: true, }, @@ -160,37 +160,37 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_APP_DOWNLOAD_LINKS, exact: true, }, - [SCREENS.SETTINGS.CONTACT_METHODS]: { + [SCREENS.SETTINGS.PROFILE.CONTACT_METHODS]: { path: ROUTES.SETTINGS_CONTACT_METHODS.route, exact: true, }, - [SCREENS.SETTINGS.CONTACT_METHOD_DETAILS]: { + [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS]: { path: ROUTES.SETTINGS_CONTACT_METHOD_DETAILS.route, }, [SCREENS.SETTINGS.LOUNGE_ACCESS]: { path: ROUTES.SETTINGS_LOUNGE_ACCESS, }, - [SCREENS.SETTINGS.NEW_CONTACT_METHOD]: { + [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD]: { path: ROUTES.SETTINGS_NEW_CONTACT_METHOD.route, exact: true, }, - [SCREENS.SETTINGS.PERSONAL_DETAILS_INITIAL]: { + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.INITIAL]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS, exact: true, }, - [SCREENS.SETTINGS.PERSONAL_DETAILS_LEGAL_NAME]: { + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.LEGAL_NAME]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_LEGAL_NAME, exact: true, }, - [SCREENS.SETTINGS.PERSONAL_DETAILS_DATE_OF_BIRTH]: { + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.DATE_OF_BIRTH]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_DATE_OF_BIRTH, exact: true, }, - [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS]: { + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.ADDRESS]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS, exact: true, }, - [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS_COUNTRY]: { + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.ADDRESS_COUNTRY]: { path: ROUTES.SETTINGS_PERSONAL_DETAILS_ADDRESS_COUNTRY.route, exact: true, }, @@ -202,11 +202,11 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_SHARE_CODE, exact: true, }, - [SCREENS.SETTINGS.STATUS]: { + [SCREENS.SETTINGS.PROFILE.STATUS]: { path: ROUTES.SETTINGS_STATUS, exact: true, }, - [SCREENS.SETTINGS.STATUS_SET]: { + [SCREENS.SETTINGS.PROFILE.STATUS_SET]: { path: ROUTES.SETTINGS_STATUS_SET, exact: true, }, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 4f29308a8f0e..2d4496b2c314 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -45,19 +45,19 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.ROOT]: undefined; [SCREENS.SETTINGS.SHARE_CODE]: undefined; [SCREENS.SETTINGS.WORKSPACES]: undefined; - [SCREENS.SETTINGS.PROFILE]: undefined; - [SCREENS.SETTINGS.PRONOUNS]: undefined; - [SCREENS.SETTINGS.DISPLAY_NAME]: undefined; - [SCREENS.SETTINGS.TIMEZONE]: undefined; - [SCREENS.SETTINGS.TIMEZONE_SELECT]: undefined; - [SCREENS.SETTINGS.PERSONAL_DETAILS_INITIAL]: undefined; - [SCREENS.SETTINGS.PERSONAL_DETAILS_LEGAL_NAME]: undefined; - [SCREENS.SETTINGS.PERSONAL_DETAILS_DATE_OF_BIRTH]: undefined; - [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS]: undefined; - [SCREENS.SETTINGS.PERSONAL_DETAILS_ADDRESS_COUNTRY]: undefined; - [SCREENS.SETTINGS.CONTACT_METHODS]: undefined; - [SCREENS.SETTINGS.CONTACT_METHOD_DETAILS]: undefined; - [SCREENS.SETTINGS.NEW_CONTACT_METHOD]: undefined; + [SCREENS.SETTINGS.PROFILE.ROOT]: undefined; + [SCREENS.SETTINGS.PROFILE.PRONOUNS]: undefined; + [SCREENS.SETTINGS.PROFILE.DISPLAY_NAME]: undefined; + [SCREENS.SETTINGS.PROFILE.TIMEZONE]: undefined; + [SCREENS.SETTINGS.PROFILE.TIMEZONE_SELECT]: undefined; + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.INITIAL]: undefined; + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.LEGAL_NAME]: undefined; + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.DATE_OF_BIRTH]: undefined; + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.ADDRESS]: undefined; + [SCREENS.SETTINGS.PROFILE.PERSONAL_DETAILS.ADDRESS_COUNTRY]: undefined; + [SCREENS.SETTINGS.PROFILE.CONTACT_METHODS]: undefined; + [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS]: undefined; + [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD]: undefined; [SCREENS.SETTINGS.PREFERENCES]: undefined; [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: undefined; [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: undefined; @@ -81,8 +81,8 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.WALLET.ENABLE_PAYMENTS]: undefined; [SCREENS.SETTINGS.ADD_DEBIT_CARD]: undefined; [SCREENS.SETTINGS.ADD_BANK_ACCOUNT]: undefined; - [SCREENS.SETTINGS.STATUS]: undefined; - [SCREENS.SETTINGS.STATUS_SET]: undefined; + [SCREENS.SETTINGS.PROFILE.STATUS]: undefined; + [SCREENS.SETTINGS.PROFILE.STATUS_SET]: undefined; [SCREENS.WORKSPACE.INITIAL]: undefined; [SCREENS.WORKSPACE.SETTINGS]: undefined; [SCREENS.WORKSPACE.CURRENCY]: undefined; diff --git a/src/pages/settings/Profile/CustomStatus/StatusPage.js b/src/pages/settings/Profile/CustomStatus/StatusPage.js index 6850684cfda2..226d0fed8044 100644 --- a/src/pages/settings/Profile/CustomStatus/StatusPage.js +++ b/src/pages/settings/Profile/CustomStatus/StatusPage.js @@ -91,7 +91,7 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) { /> } headerContainerStyles={[styles.staticHeaderImage]} - backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.STATUS].backgroundColor} + backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.PROFILE.STATUS].backgroundColor} footer={footerComponent} > diff --git a/src/styles/themes/default.ts b/src/styles/themes/default.ts index 97dd0469fcea..a551c3751b9f 100644 --- a/src/styles/themes/default.ts +++ b/src/styles/themes/default.ts @@ -119,7 +119,7 @@ const darkTheme = { backgroundColor: colors.ice500, statusBarStyle: CONST.STATUS_BAR_STYLE.DARK_CONTENT, }, - [SCREENS.SETTINGS.STATUS]: { + [SCREENS.SETTINGS.PROFILE.STATUS]: { backgroundColor: colors.green700, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, diff --git a/src/styles/themes/light.ts b/src/styles/themes/light.ts index 4f40c3fa274d..bba3a9f1083a 100644 --- a/src/styles/themes/light.ts +++ b/src/styles/themes/light.ts @@ -119,7 +119,7 @@ const lightTheme = { backgroundColor: colors.ice500, statusBarStyle: CONST.STATUS_BAR_STYLE.DARK_CONTENT, }, - [SCREENS.SETTINGS.STATUS]: { + [SCREENS.SETTINGS.PROFILE.STATUS]: { backgroundColor: colors.green700, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, From cb2d7cc89f786dd710ab7504352f32610cf5f8da Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 11:34:54 +0100 Subject: [PATCH 14/17] Group PREFERENCES --- src/SCREENS.ts | 33 +++++++++---------- .../AppNavigator/ModalStackNavigators.tsx | 8 ++--- src/libs/Navigation/linkingConfig.ts | 8 ++--- src/libs/Navigation/types.ts | 8 ++--- .../settings/Preferences/PreferencesPage.js | 2 +- .../Wallet/ActivatePhysicalCardPage.js | 2 +- src/styles/themes/default.ts | 2 +- src/styles/themes/light.ts | 2 +- 8 files changed, 31 insertions(+), 34 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 7e7c422777d8..42c66bb49b9d 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -19,10 +19,17 @@ const SCREENS = { UNLINK_LOGIN: 'UnlinkLogin', SETTINGS: { ROOT: 'Settings_Root', - SHARE_CODE: 'Settings_Share_Code', - WORKSPACES: 'Settings_Workspaces', + SECURITY: 'Settings_Security', + ABOUT: 'Settings_About', + APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links', + LOUNGE_ACCESS: 'Settings_Lounge_Access', + ADD_DEBIT_CARD: 'Settings_Add_Debit_Card', + ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account', + CLOSE: 'Settings_Close', + TWO_FACTOR_AUTH: 'Settings_TwoFactorAuth', + REPORT_CARD_LOST_OR_DAMAGED: 'Settings_ReportCardLostOrDamaged', PROFILE: { ROOT: 'Settings_Profile', @@ -45,12 +52,12 @@ const SCREENS = { }, }, - PREFERENCES: 'Settings_Preferences', - PREFERENCES_PRIORITY_MODE: 'Settings_Preferences_PriorityMode', - PREFERENCES_LANGUAGE: 'Settings_Preferences_Language', - PREFERENCES_THEME: 'Settings_Preferences_Theme', - - SECURITY: 'Settings_Security', + PREFERENCES: { + ROOT: 'Settings_Preferences', + PRIORITY_MODE: 'Settings_Preferences_PriorityMode', + LANGUAGE: 'Settings_Preferences_Language', + THEME: 'Settings_Preferences_Theme', + }, WALLET: { ROOT: 'Settings_Wallet', @@ -68,16 +75,6 @@ const SCREENS = { REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud', CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address', }, - - ABOUT: 'Settings_About', - - APP_DOWNLOAD_LINKS: 'Settings_App_Download_Links', - LOUNGE_ACCESS: 'Settings_Lounge_Access', - ADD_DEBIT_CARD: 'Settings_Add_Debit_Card', - ADD_BANK_ACCOUNT: 'Settings_Add_Bank_Account', - CLOSE: 'Settings_Close', - TWO_FACTOR_AUTH: 'Settings_TwoFactorAuth', - REPORT_CARD_LOST_OR_DAMAGED: 'Settings_ReportCardLostOrDamaged', }, SAVE_THE_WORLD: { ROOT: 'SaveTheWorld_Root', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 73fdefe06b8f..39dcce7891a8 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -181,11 +181,11 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default as React.ComponentType, [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS]: () => require('../../../pages/settings/Profile/Contacts/ContactMethodDetailsPage').default as React.ComponentType, [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD]: () => require('../../../pages/settings/Profile/Contacts/NewContactMethodPage').default as React.ComponentType, - [SCREENS.SETTINGS.PREFERENCES]: () => require('../../../pages/settings/Preferences/PreferencesPage').default as React.ComponentType, - [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: () => require('../../../pages/settings/Preferences/PriorityModePage').default as React.ComponentType, - [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: () => require('../../../pages/settings/Preferences/LanguagePage').default as React.ComponentType, + [SCREENS.SETTINGS.PREFERENCES.ROOT]: () => require('../../../pages/settings/Preferences/PreferencesPage').default as React.ComponentType, + [SCREENS.SETTINGS.PREFERENCES.PRIORITY_MODE]: () => require('../../../pages/settings/Preferences/PriorityModePage').default as React.ComponentType, + [SCREENS.SETTINGS.PREFERENCES.LANGUAGE]: () => require('../../../pages/settings/Preferences/LanguagePage').default as React.ComponentType, // Will be uncommented as part of https://github.com/Expensify/App/issues/21670 - // [SCREENS.SETTINGS.PREFERENCES_THEME]: () => require('../../../pages/settings/Preferences/ThemePage').default as React.ComponentType, + // [SCREENS.SETTINGS.PREFERENCES.THEME]: () => require('../../../pages/settings/Preferences/ThemePage').default as React.ComponentType, [SCREENS.SETTINGS.CLOSE]: () => require('../../../pages/settings/Security/CloseAccountPage').default as React.ComponentType, [SCREENS.SETTINGS.SECURITY]: () => require('../../../pages/settings/Security/SecuritySettingsPage').default as React.ComponentType, [SCREENS.SETTINGS.ABOUT]: () => require('../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType, diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index 5767ad116370..15f5f6fc9a60 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -48,19 +48,19 @@ const linkingConfig: LinkingOptions = { path: ROUTES.SETTINGS_WORKSPACES, exact: true, }, - [SCREENS.SETTINGS.PREFERENCES]: { + [SCREENS.SETTINGS.PREFERENCES.ROOT]: { path: ROUTES.SETTINGS_PREFERENCES, exact: true, }, - [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: { + [SCREENS.SETTINGS.PREFERENCES.PRIORITY_MODE]: { path: ROUTES.SETTINGS_PRIORITY_MODE, exact: true, }, - [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: { + [SCREENS.SETTINGS.PREFERENCES.LANGUAGE]: { path: ROUTES.SETTINGS_LANGUAGE, exact: true, }, - [SCREENS.SETTINGS.PREFERENCES_THEME]: { + [SCREENS.SETTINGS.PREFERENCES.THEME]: { path: ROUTES.SETTINGS_THEME, exact: true, }, diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 2d4496b2c314..b69552f6fe0f 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -58,10 +58,10 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.PROFILE.CONTACT_METHODS]: undefined; [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS]: undefined; [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD]: undefined; - [SCREENS.SETTINGS.PREFERENCES]: undefined; - [SCREENS.SETTINGS.PREFERENCES_PRIORITY_MODE]: undefined; - [SCREENS.SETTINGS.PREFERENCES_LANGUAGE]: undefined; - [SCREENS.SETTINGS.PREFERENCES_THEME]: undefined; + [SCREENS.SETTINGS.PREFERENCES.ROOT]: undefined; + [SCREENS.SETTINGS.PREFERENCES.PRIORITY_MODE]: undefined; + [SCREENS.SETTINGS.PREFERENCES.LANGUAGE]: undefined; + [SCREENS.SETTINGS.PREFERENCES.THEME]: undefined; [SCREENS.SETTINGS.CLOSE]: undefined; [SCREENS.SETTINGS.SECURITY]: undefined; [SCREENS.SETTINGS.ABOUT]: undefined; diff --git a/src/pages/settings/Preferences/PreferencesPage.js b/src/pages/settings/Preferences/PreferencesPage.js index b010c3790056..6fa3e2df3474 100755 --- a/src/pages/settings/Preferences/PreferencesPage.js +++ b/src/pages/settings/Preferences/PreferencesPage.js @@ -46,7 +46,7 @@ function PreferencesPage(props) { Navigation.goBack(ROUTES.SETTINGS)} - backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.PREFERENCES].backgroundColor} + backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.PREFERENCES.ROOT].backgroundColor} illustration={LottieAnimations.PreferencesDJ} > diff --git a/src/pages/settings/Wallet/ActivatePhysicalCardPage.js b/src/pages/settings/Wallet/ActivatePhysicalCardPage.js index e45b4ad67f4e..788c571d9e7d 100644 --- a/src/pages/settings/Wallet/ActivatePhysicalCardPage.js +++ b/src/pages/settings/Wallet/ActivatePhysicalCardPage.js @@ -134,7 +134,7 @@ function ActivatePhysicalCardPage({ Navigation.navigate(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain))} - backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.PREFERENCES].backgroundColor} + backgroundColor={theme.PAGE_THEMES[SCREENS.SETTINGS.PREFERENCES.ROOT].backgroundColor} illustration={LottieAnimations.Magician} scrollViewContainerStyles={[styles.mnh100]} childrenContainerStyles={[styles.flex1]} diff --git a/src/styles/themes/default.ts b/src/styles/themes/default.ts index a551c3751b9f..2952ac02b5c2 100644 --- a/src/styles/themes/default.ts +++ b/src/styles/themes/default.ts @@ -103,7 +103,7 @@ const darkTheme = { backgroundColor: colors.tangerine800, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, - [SCREENS.SETTINGS.PREFERENCES]: { + [SCREENS.SETTINGS.PREFERENCES.ROOT]: { backgroundColor: colors.blue500, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, diff --git a/src/styles/themes/light.ts b/src/styles/themes/light.ts index bba3a9f1083a..630cbae37cea 100644 --- a/src/styles/themes/light.ts +++ b/src/styles/themes/light.ts @@ -103,7 +103,7 @@ const lightTheme = { backgroundColor: colors.tangerine800, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, - [SCREENS.SETTINGS.PREFERENCES]: { + [SCREENS.SETTINGS.PREFERENCES.ROOT]: { backgroundColor: colors.blue500, statusBarStyle: CONST.STATUS_BAR_STYLE.LIGHT_CONTENT, }, From 1da9216572baaefca7a5ca4eec07721f0e11cdcf Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 11:40:31 +0100 Subject: [PATCH 15/17] Clean git diff --- src/SCREENS.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 42c66bb49b9d..9c569bc914ab 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -198,14 +198,6 @@ const SCREENS = { REIMBURSEMENT_ACCOUNT_ROOT: 'Reimbursement_Account_Root', WALLET_STATEMENT_ROOT: 'WalletStatement_Root', SIGN_IN_ROOT: 'SignIn_Root', - REFERRAL_DETAILS: 'Referral_Details', - - SPLIT_DETAILS: { - ROOT: 'SplitDetails_Root', - EDIT_REQUEST: 'SplitDetails_Edit_Request', - EDIT_CURRENCY: 'SplitDetails_Edit_Currency', - }, - DETAILS_ROOT: 'Details_Root', PROFILE_ROOT: 'Profile_Root', REPORT_WELCOME_MESSAGE_ROOT: 'Report_WelcomeMessage_Root', @@ -215,9 +207,16 @@ const SCREENS = { SEARCH_ROOT: 'Search_Root', NEW_CHAT: {ROOT: 'NewChat_Root', NEW_CHAT: 'chat', NEW_ROOM: 'room'}, FLAG_COMMENT_ROOT: 'FlagComment_Root', + + SPLIT_DETAILS: { + ROOT: 'SplitDetails_Root', + EDIT_REQUEST: 'SplitDetails_Edit_Request', + EDIT_CURRENCY: 'SplitDetails_Edit_Currency', + }, + REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount', GET_ASSISTANCE: 'GetAssistance', - + REFERRAL_DETAILS: 'Referral_Details', KEYBOARD_SHORTCUTS: 'KeyboardShortcuts', } as const; From ff49052bedff77b39e58c6908683226a8e7cc4eb Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 11:41:57 +0100 Subject: [PATCH 16/17] Reorder screens --- src/SCREENS.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 9c569bc914ab..986c1158c6ea 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -189,10 +189,21 @@ const SCREENS = { CURRENCY: 'EditRequest_Currency', }, + NEW_CHAT: { + ROOT: 'NewChat_Root', + NEW_CHAT: 'chat', + NEW_ROOM: 'room', + }, + + SPLIT_DETAILS: { + ROOT: 'SplitDetails_Root', + EDIT_REQUEST: 'SplitDetails_Edit_Request', + EDIT_CURRENCY: 'SplitDetails_Edit_Currency', + }, + I_KNOW_A_TEACHER: 'I_Know_A_Teacher', INTRO_SCHOOL_PRINCIPAL: 'Intro_School_Principal', I_AM_A_TEACHER: 'I_Am_A_Teacher', - ENABLE_PAYMENTS_ROOT: 'EnablePayments_Root', ADD_PERSONAL_BANK_ACCOUNT_ROOT: 'AddPersonalBankAccount_Root', REIMBURSEMENT_ACCOUNT_ROOT: 'Reimbursement_Account_Root', @@ -205,15 +216,7 @@ const SCREENS = { ROOM_MEMBERS_ROOT: 'RoomMembers_Root', ROOM_INVITE_ROOT: 'RoomInvite_Root', SEARCH_ROOT: 'Search_Root', - NEW_CHAT: {ROOT: 'NewChat_Root', NEW_CHAT: 'chat', NEW_ROOM: 'room'}, FLAG_COMMENT_ROOT: 'FlagComment_Root', - - SPLIT_DETAILS: { - ROOT: 'SplitDetails_Root', - EDIT_REQUEST: 'SplitDetails_Edit_Request', - EDIT_CURRENCY: 'SplitDetails_Edit_Currency', - }, - REIMBURSEMENT_ACCOUNT: 'ReimbursementAccount', GET_ASSISTANCE: 'GetAssistance', REFERRAL_DETAILS: 'Referral_Details', From dfee4aeb2fce2033fa37ecd2db34f19ec303fb01 Mon Sep 17 00:00:00 2001 From: Blazej Kustra Date: Thu, 7 Dec 2023 12:06:21 +0100 Subject: [PATCH 17/17] Fix imports --- .../Navigation/AppNavigator/Navigators/RightModalNavigator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx index 7bb044db5081..10b8129bc3e7 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx @@ -7,8 +7,8 @@ import * as ModalStackNavigators from '@libs/Navigation/AppNavigator/ModalStackN import RHPScreenOptions from '@libs/Navigation/AppNavigator/RHPScreenOptions'; import type {AuthScreensParamList, RightModalNavigatorParamList} from '@navigation/types'; import useThemeStyles from '@styles/useThemeStyles'; -import SCREENS from '@src/SCREENS'; import NAVIGATORS from '@src/NAVIGATORS'; +import SCREENS from '@src/SCREENS'; import Overlay from './Overlay'; type RightModalNavigatorProps = StackScreenProps;