Skip to content

Commit

Permalink
fix "Fix the error" link on form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
aimane-chnaif committed Oct 14, 2022
1 parent 7044ab2 commit 1a8a78b
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 1a8a78b

Please sign in to comment.