Skip to content

Commit ca488d6

Browse files
refactor: Replace of injectIntl with useIntl
1 parent 880525f commit ca488d6

File tree

5 files changed

+689
-749
lines changed

5 files changed

+689
-749
lines changed

src/components/NewFeatureAlertBrowseAndRequest/index.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Alert, Button } from '@openedx/paragon';
33
import PropTypes from 'prop-types';
44
import { connect } from 'react-redux';
55
import { useNavigate } from 'react-router-dom';
6-
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
6+
import { useIntl } from '@edx/frontend-platform/i18n';
77

88
import {
99
BROWSE_AND_REQUEST_ALERT_COOKIE_PREFIX,
@@ -18,7 +18,11 @@ import { ACCESS_TAB } from '../settings/data/constants';
1818
*/
1919
export const generateBrowseAndRequestAlertCookieName = (enterpriseId) => `${BROWSE_AND_REQUEST_ALERT_COOKIE_PREFIX}-${enterpriseId}`;
2020

21-
const NewFeatureAlertBrowseAndRequest = ({ enterpriseId, enterpriseSlug, intl }) => {
21+
const NewFeatureAlertBrowseAndRequest = ({
22+
enterpriseId,
23+
enterpriseSlug,
24+
}) => {
25+
const intl = useIntl();
2226
const browseAndRequestAlertCookieName = generateBrowseAndRequestAlertCookieName(enterpriseId);
2327
const hideAlert = global.localStorage.getItem(browseAndRequestAlertCookieName);
2428

@@ -68,12 +72,11 @@ const NewFeatureAlertBrowseAndRequest = ({ enterpriseId, enterpriseSlug, intl })
6872
NewFeatureAlertBrowseAndRequest.propTypes = {
6973
enterpriseId: PropTypes.string.isRequired,
7074
enterpriseSlug: PropTypes.string.isRequired,
71-
intl: intlShape.isRequired,
7275
};
7376

7477
const mapStateToProps = state => ({
7578
enterpriseId: state.portalConfiguration.enterpriseId,
7679
enterpriseSlug: state.portalConfiguration.enterpriseSlug,
7780
});
7881

79-
export default connect(mapStateToProps)(injectIntl(NewFeatureAlertBrowseAndRequest));
82+
export default connect(mapStateToProps)(NewFeatureAlertBrowseAndRequest);

0 commit comments

Comments
 (0)