refactor: Replace of injectIntl with useIntl() part 8 #2288 (#2357)

Co-authored-by: Ahtesham Quraish <ahtesham.quraish@192.168.1.4>
This commit is contained in:
Ahtesham Quraish
2025-08-20 23:07:24 +05:00
committed by GitHub
parent 33c445ebc2
commit 87af7e8973
14 changed files with 143 additions and 170 deletions

View File

@@ -1,28 +1,27 @@
import React from 'react';
import { injectIntl, intlShape, FormattedMessage } from '@edx/frontend-platform/i18n';
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
import { Alert } from '@openedx/paragon';
import { getConfig } from '@edx/frontend-platform';
import messages from '../messages';
const SaveFormConnectionErrorAlert = ({ intl }) => (
<Alert variant="danger" data-testid="connectionErrorAlert">
<FormattedMessage
id="authoring.alert.save.error.connection"
defaultMessage="We encountered a technical error when applying changes. This might be a temporary issue, so please try again in a few minutes. If the problem persists, please go to the {supportLink} for help."
values={{
supportLink: (
<Alert.Link href={getConfig().SUPPORT_URL}>
{intl.formatMessage(messages.supportText)}
</Alert.Link>
),
}}
/>
</Alert>
);
SaveFormConnectionErrorAlert.propTypes = {
intl: intlShape.isRequired,
const SaveFormConnectionErrorAlert = () => {
const intl = useIntl();
return (
<Alert variant="danger" data-testid="connectionErrorAlert">
<FormattedMessage
id="authoring.alert.save.error.connection"
defaultMessage="We encountered a technical error when applying changes. This might be a temporary issue, so please try again in a few minutes. If the problem persists, please go to the {supportLink} for help."
values={{
supportLink: (
<Alert.Link href={getConfig().SUPPORT_URL}>
{intl.formatMessage(messages.supportText)}
</Alert.Link>
),
}}
/>
</Alert>
);
};
export default injectIntl(SaveFormConnectionErrorAlert);
export default SaveFormConnectionErrorAlert;