Skip to content

Commit 903fe28

Browse files
KristinAokibradenmacdonald
authored andcommittedApr 15, 2025
refactor: change to useIntl
1 parent 14c662d commit 903fe28

File tree

71 files changed

+746
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+746
-877
lines changed
 

‎src/alerts/access-expiration-alert/AccessExpirationAlert.jsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import PropTypes from 'prop-types';
22
import { sendTrackEvent } from '@edx/frontend-platform/analytics';
3-
import {
4-
FormattedMessage, FormattedDate, injectIntl, intlShape,
5-
} from '@edx/frontend-platform/i18n';
3+
import { FormattedMessage, FormattedDate, useIntl } from '@edx/frontend-platform/i18n';
64
import { Alert, Hyperlink } from '@openedx/paragon';
75
import { Info } from '@openedx/paragon/icons';
86

97
import messages from './messages';
108

11-
const AccessExpirationAlert = ({ intl, payload }) => {
9+
const AccessExpirationAlert = ({ payload }) => {
10+
const intl = useIntl();
1211
const {
1312
accessExpiration,
1413
courseId,
@@ -119,7 +118,6 @@ const AccessExpirationAlert = ({ intl, payload }) => {
119118
};
120119

121120
AccessExpirationAlert.propTypes = {
122-
intl: intlShape.isRequired,
123121
payload: PropTypes.shape({
124122
accessExpiration: PropTypes.shape({
125123
expirationDate: PropTypes.string.isRequired,
@@ -134,4 +132,4 @@ AccessExpirationAlert.propTypes = {
134132
}).isRequired,
135133
};
136134

137-
export default injectIntl(AccessExpirationAlert);
135+
export default AccessExpirationAlert;

‎src/alerts/active-enteprise-alert/ActiveEnterpriseAlert.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React from 'react';
2-
import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n';
2+
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
33
import PropTypes from 'prop-types';
44
import { Alert, Hyperlink } from '@openedx/paragon';
55
import { WarningFilled } from '@openedx/paragon/icons';
66

77
import { getConfig } from '@edx/frontend-platform';
88
import genericMessages from './messages';
99

10-
const ActiveEnterpriseAlert = ({ intl, payload }) => {
10+
const ActiveEnterpriseAlert = ({ payload }) => {
11+
const intl = useIntl();
1112
const { text, courseId } = payload;
1213
const changeActiveEnterprise = (
1314
<Hyperlink
@@ -38,11 +39,10 @@ const ActiveEnterpriseAlert = ({ intl, payload }) => {
3839
};
3940

4041
ActiveEnterpriseAlert.propTypes = {
41-
intl: intlShape.isRequired,
4242
payload: PropTypes.shape({
4343
text: PropTypes.string,
4444
courseId: PropTypes.string,
4545
}).isRequired,
4646
};
4747

48-
export default injectIntl(ActiveEnterpriseAlert);
48+
export default ActiveEnterpriseAlert;

0 commit comments

Comments
 (0)