Skip to content

Commit

Permalink
Merge pull request #11847 from aimane-chnaif/fix-11424
Browse files Browse the repository at this point in the history
fix "Fix the error" link on form submit
  • Loading branch information
NikkiWines authored Oct 19, 2022
2 parents c3a0129 + 1a8a78b commit ca501d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/FormAlertWithSubmitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const propTypes = {
message: PropTypes.string,

/** Callback fired when the "fix the errors" link is pressed */
onFixTheErrorsPressed: PropTypes.func,
onFixTheErrorsLinkPressed: PropTypes.func,

/** Submit function */
onSubmit: PropTypes.func.isRequired,
Expand All @@ -43,7 +43,7 @@ const defaultProps = {
isMessageHtml: false,
containerStyles: [],
isLoading: false,
onFixTheErrorsPressed: () => {},
onFixTheErrorsLinkPressed: () => {},
enabledWhenOffline: false,
};

Expand All @@ -53,7 +53,7 @@ const FormAlertWithSubmitButton = props => (
isAlertVisible={props.isAlertVisible}
isMessageHtml={props.isMessageHtml}
message={props.message}
onFixTheErrorsPressed={props.onFixTheErrorsPressed}
onFixTheErrorsLinkPressed={props.onFixTheErrorsLinkPressed}
>
{isOffline => ((isOffline && !props.enabledWhenOffline) ? (
<Button
Expand Down
6 changes: 3 additions & 3 deletions src/components/FormAlertWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const propTypes = {
network: networkPropTypes.isRequired,

/** Callback fired when the "fix the errors" link is pressed */
onFixTheErrorsPressed: PropTypes.func,
onFixTheErrorsLinkPressed: PropTypes.func,

...withLocalizePropTypes,
};
Expand All @@ -45,7 +45,7 @@ const defaultProps = {
isAlertVisible: false,
isMessageHtml: false,
message: '',
onFixTheErrorsPressed: () => {},
onFixTheErrorsLinkPressed: () => {},
};

// The FormAlertWrapper offers a standardized way of showing error messages and offline functionality.
Expand All @@ -69,7 +69,7 @@ const FormAlertWrapper = props => (
</Text>
<TextLink
style={styles.label}
onPress={props.onFixTheErrorsPressed}
onPress={props.onFixTheErrorsLinkPressed}
>
{props.translate('common.fixTheErrors')}
</TextLink>
Expand Down

0 comments on commit ca501d9

Please sign in to comment.