From a937de641ca4a3394d4165093a07e4d22b911450 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Wed, 4 Jan 2023 10:06:08 +0200 Subject: [PATCH 1/3] Clarify dangerous form submit prop --- src/components/Form.js | 6 +++--- src/components/FormAlertWithSubmitButton.js | 8 ++++---- src/pages/settings/Security/CloseAccountPage.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/Form.js b/src/components/Form.js index f3f4a5a0cfb2..f20a609da0ee 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -53,7 +53,7 @@ const propTypes = { enabledWhenOffline: PropTypes.bool, /** Whether the action is dangerous */ - isDangerousAction: PropTypes.bool, + isSubmitActionDangerous: PropTypes.bool, ...withLocalizePropTypes, }; @@ -66,7 +66,7 @@ const defaultProps = { }, draftValues: {}, enabledWhenOffline: false, - isDangerousAction: false, + isSubmitActionDangerous: false, }; class Form extends React.Component { @@ -280,7 +280,7 @@ class Form extends React.Component { }} containerStyles={[styles.mh0, styles.mt5, styles.flex1]} enabledWhenOffline={this.props.enabledWhenOffline} - isDangerousAction={this.props.isDangerousAction} + isSubmitActionDangerous={this.props.isSubmitActionDangerous} /> )} diff --git a/src/components/FormAlertWithSubmitButton.js b/src/components/FormAlertWithSubmitButton.js index fdace1fcc40f..38e01d6b1dbc 100644 --- a/src/components/FormAlertWithSubmitButton.js +++ b/src/components/FormAlertWithSubmitButton.js @@ -37,7 +37,7 @@ const propTypes = { enabledWhenOffline: PropTypes.bool, /** Whether the action is dangerous */ - isDangerousAction: PropTypes.bool, + isSubmitActionDangerous: PropTypes.bool, }; const defaultProps = { @@ -48,7 +48,7 @@ const defaultProps = { isLoading: false, onFixTheErrorsLinkPressed: () => {}, enabledWhenOffline: false, - isDangerousAction: false, + isSubmitActionDangerous: false, }; const FormAlertWithSubmitButton = props => ( @@ -65,7 +65,7 @@ const FormAlertWithSubmitButton = props => ( isDisabled text={props.buttonText} style={[styles.mb3]} - danger={props.isDangerousAction} + danger={props.isSubmitActionDangerous} /> ) : (