From e24cb355fb60a3e1300fc90188161cd343a2f3ef Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Wed, 25 Oct 2023 16:39:39 +0200 Subject: [PATCH 1/5] Refactor workspace settings page --- src/pages/workspace/WorkspaceSettingsPage.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js index fd975ebc9247..f3964534a96d 100644 --- a/src/pages/workspace/WorkspaceSettingsPage.js +++ b/src/pages/workspace/WorkspaceSettingsPage.js @@ -26,6 +26,8 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '../../components/ import MenuItemWithTopDescription from '../../components/MenuItemWithTopDescription'; import Text from '../../components/Text'; import useLocalize from '../../hooks/useLocalize'; +import FormProvider from "../../components/Form/FormProvider"; +import InputWrapper from "../../components/Form/InputWrapper"; const propTypes = { /** Constant, list of available currencies */ @@ -98,7 +100,7 @@ function WorkspaceSettingsPage({policy, currencyList, windowWidth, route}) { guidesCallTaskID={CONST.GUIDES_CALL_TASK_IDS.WORKSPACE_SETTINGS} > {(hasVBA) => ( -
- -
+ )} ); From 4356a4b7ac4cc5fcc21d3b53ae1e042845dea3be Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Thu, 26 Oct 2023 17:00:21 +0200 Subject: [PATCH 2/5] Fix lint --- src/pages/workspace/WorkspaceSettingsPage.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js index f3964534a96d..93fd525e2d0a 100644 --- a/src/pages/workspace/WorkspaceSettingsPage.js +++ b/src/pages/workspace/WorkspaceSettingsPage.js @@ -16,7 +16,6 @@ import WorkspacePageWithSections from './WorkspacePageWithSections'; import withPolicy, {policyPropTypes, policyDefaultProps} from './withPolicy'; import {withNetwork} from '../../components/OnyxProvider'; import OfflineWithFeedback from '../../components/OfflineWithFeedback'; -import Form from '../../components/Form'; import * as ReportUtils from '../../libs/ReportUtils'; import * as UserUtils from '../../libs/UserUtils'; import Avatar from '../../components/Avatar'; @@ -26,8 +25,8 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '../../components/ import MenuItemWithTopDescription from '../../components/MenuItemWithTopDescription'; import Text from '../../components/Text'; import useLocalize from '../../hooks/useLocalize'; -import FormProvider from "../../components/Form/FormProvider"; -import InputWrapper from "../../components/Form/InputWrapper"; +import FormProvider from '../../components/Form/FormProvider'; +import InputWrapper from '../../components/Form/InputWrapper'; const propTypes = { /** Constant, list of available currencies */ From 8635361183fc3df9d2f988bb0e03b251e6f2d450 Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:02:54 +0100 Subject: [PATCH 3/5] fix proper submit button styling in FormWrapper --- src/components/Form/FormWrapper.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Form/FormWrapper.js b/src/components/Form/FormWrapper.js index 82e70b68b3f0..8e113b00ceb3 100644 --- a/src/components/Form/FormWrapper.js +++ b/src/components/Form/FormWrapper.js @@ -57,6 +57,9 @@ const propTypes = { /** Container styles */ style: stylePropTypes, + /** Submit button styles */ + submitButtonStyles: stylePropTypes, + /** Custom content to display in the footer after submit button */ footerContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node]), @@ -75,10 +78,11 @@ const defaultProps = { scrollContextEnabled: false, footerContent: null, style: [], + submitButtonStyles: [], }; function FormWrapper(props) { - const {onSubmit, children, formState, errors, inputRefs, submitButtonText, footerContent, isSubmitButtonVisible, style, enabledWhenOffline, isSubmitActionDangerous, formID} = props; + const {onSubmit, children, formState, errors, inputRefs, submitButtonText, footerContent, isSubmitButtonVisible, style, submitButtonStyles, enabledWhenOffline, isSubmitActionDangerous, formID} = props; const formRef = useRef(null); const formContentRef = useRef(null); const errorMessage = useMemo(() => { @@ -130,7 +134,7 @@ function FormWrapper(props) { focusInput.focus(); } }} - containerStyles={[styles.mh0, styles.mt5, styles.flex1]} + containerStyles={[styles.mh0, styles.mt5, styles.flex1, ...submitButtonStyles]} enabledWhenOffline={enabledWhenOffline} isSubmitActionDangerous={isSubmitActionDangerous} disablePressOnEnter From be30678985e07b0f48269a1058051e2f377fc5ba Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:31:41 +0100 Subject: [PATCH 4/5] fix proper margin in styling --- src/pages/workspace/WorkspaceSettingsPage.js | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js index 1738dcf43567..1f8ff88bfb64 100644 --- a/src/pages/workspace/WorkspaceSettingsPage.js +++ b/src/pages/workspace/WorkspaceSettingsPage.js @@ -141,17 +141,18 @@ function WorkspaceSettingsPage({policy, currencyList, windowWidth, route}) { originalFileName={policy.originalFileName} /> - + + + Date: Fri, 3 Nov 2023 23:53:07 +0100 Subject: [PATCH 5/5] revert adding a wrapper view with styling --- src/pages/workspace/WorkspaceSettingsPage.js | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js index c7dcea7b0992..2ec17294b17a 100644 --- a/src/pages/workspace/WorkspaceSettingsPage.js +++ b/src/pages/workspace/WorkspaceSettingsPage.js @@ -140,18 +140,17 @@ function WorkspaceSettingsPage({policy, currencyList, windowWidth, route}) { originalFileName={policy.originalFileName} /> - - - +