From 0d2dd81a1650b29ccca61e624a07091d09aa97b7 Mon Sep 17 00:00:00 2001 From: Mahesh Vagicherla Date: Fri, 8 Dec 2023 22:04:13 +0530 Subject: [PATCH] fix issues --- src/SCREENS.ts | 5 +++-- src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx | 1 + src/pages/workspace/WorkspaceSettingsNamePage.js | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 38bd88a87158..411b3a734bbd 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -183,6 +183,7 @@ const SCREENS = { INVITE: 'Workspace_Invite', INVITE_MESSAGE: 'Workspace_Invite_Message', CURRENCY: 'Workspace_Settings_Currency', + NAME: "Workspace_Settings_Name" }, EDIT_REQUEST: { @@ -224,5 +225,5 @@ const SCREENS = { type Screen = DeepValueOf; export default SCREENS; -export {PROTECTED_SCREENS}; -export type {Screen}; +export { PROTECTED_SCREENS }; +export type { Screen }; diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index c6a58d7c29ad..abce080ca35b 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -223,6 +223,7 @@ const SettingsModalStackNavigator = createModalStackNavigator 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, + [SCREENS.WORKSPACE.NAME]: () => require('../../../pages/workspace/WorkspaceSettingsNamePage').default as React.ComponentType, [SCREENS.WORKSPACE.CARD]: () => require('../../../pages/workspace/card/WorkspaceCardPage').default as React.ComponentType, [SCREENS.WORKSPACE.REIMBURSE]: () => require('../../../pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType, [SCREENS.WORKSPACE.RATE_AND_UNIT]: () => require('../../../pages/workspace/reimburse/WorkspaceRateAndUnitPage').default as React.ComponentType, diff --git a/src/pages/workspace/WorkspaceSettingsNamePage.js b/src/pages/workspace/WorkspaceSettingsNamePage.js index 6d91ee342e68..ff267ef0e8be 100644 --- a/src/pages/workspace/WorkspaceSettingsNamePage.js +++ b/src/pages/workspace/WorkspaceSettingsNamePage.js @@ -15,7 +15,7 @@ import * as Browser from '@libs/Browser'; import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ValidationUtils from '@libs/ValidationUtils'; -import styles from '@styles/styles'; +import useThemeStyles from '@styles/useThemeStyles'; import * as Policy from '@userActions/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -36,6 +36,7 @@ const defaultProps = { function WorkSpaceSettingsNamePage({policy, isLoadingReportData}) { const {translate} = useLocalize(); + const styles = useThemeStyles(); const focusTimeoutRef = useRef(); const inputRef = useRef(); @@ -89,6 +90,7 @@ function WorkSpaceSettingsNamePage({policy, isLoadingReportData}) { Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)} @@ -106,6 +108,8 @@ function WorkSpaceSettingsNamePage({policy, isLoadingReportData}) { onSubmit={submit} submitButtonText={translate('common.save')} enabledWhenOffline + shouldValidateOnBlur + shouldValidateOnChange >