refactor: replacement of injectIntl (#625)

This commit is contained in:
Jacobo Dominguez
2025-08-29 11:05:16 -06:00
committed by GitHub
parent 43684dce91
commit 8f67fdba68
8 changed files with 188 additions and 228 deletions

View File

@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { useIntl } from '@edx/frontend-platform/i18n';
import {
Avatar,
} from '@openedx/paragon';
@@ -14,9 +14,8 @@ const UserMenu = ({
authenticatedUserAvatar,
isMobile,
isAdmin,
// injected
intl,
}) => {
const intl = useIntl();
const avatar = authenticatedUserAvatar ? (
<img
className="d-block w-100 h-100"
@@ -55,8 +54,6 @@ UserMenu.propTypes = {
authenticatedUserAvatar: PropTypes.string,
isMobile: PropTypes.bool,
isAdmin: PropTypes.bool,
// injected
intl: intlShape.isRequired,
};
UserMenu.defaultProps = {
@@ -66,4 +63,4 @@ UserMenu.defaultProps = {
username: null,
};
export default injectIntl(UserMenu);
export default UserMenu;