fix: TypeError r is not function for custom pages
- fix TypeError r is not a function for custom pages by replacing injectIntl with useIntl() hook. - fix import for textbooks app
This commit is contained in:
committed by
Muhammad Faraz Maqsood
parent
c1302f1089
commit
03d732846e
@@ -4,7 +4,7 @@ import {
|
||||
} from 'react-router-dom';
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
import { PageWrap } from '@edx/frontend-platform/react';
|
||||
import { Textbooks } from 'CourseAuthoring/textbooks';
|
||||
import { Textbooks } from './textbooks';
|
||||
import CourseAuthoringPage from './CourseAuthoringPage';
|
||||
import { PagesAndResources } from './pages-and-resources';
|
||||
import EditorContainer from './editors/EditorContainer';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { intlShape, injectIntl } from '@edx/frontend-platform/i18n';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
ActionRow,
|
||||
IconButtonWithTooltip,
|
||||
@@ -27,9 +27,8 @@ const CustomPageCard = ({
|
||||
dispatch,
|
||||
deletePageStatus,
|
||||
setCurrentPage,
|
||||
// injected
|
||||
intl,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const [isDeleteConfirmationOpen, openDeleteConfirmation, closeDeleteConfirmation] = useToggle(false);
|
||||
const { path: customPagesPath } = useContext(CustomPagesContext);
|
||||
const navigate = useNavigate();
|
||||
@@ -129,8 +128,6 @@ CustomPageCard.propTypes = {
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
deletePageStatus: PropTypes.string.isRequired,
|
||||
setCurrentPage: PropTypes.func.isRequired,
|
||||
// injected
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
export default injectIntl(CustomPageCard);
|
||||
export default CustomPageCard;
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from 'react-router-dom';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { AppContext, PageWrap } from '@edx/frontend-platform/react';
|
||||
import { injectIntl, FormattedMessage, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
ActionRow,
|
||||
Breadcrumb,
|
||||
@@ -45,9 +45,8 @@ import { getPagePath } from '../utils';
|
||||
|
||||
const CustomPages = ({
|
||||
courseId,
|
||||
// injected
|
||||
intl,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useDispatch();
|
||||
const [orderedPages, setOrderedPages] = useState([]);
|
||||
@@ -278,8 +277,6 @@ const CustomPages = ({
|
||||
|
||||
CustomPages.propTypes = {
|
||||
courseId: PropTypes.string.isRequired,
|
||||
// injected
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
export default injectIntl(CustomPages);
|
||||
export default CustomPages;
|
||||
|
||||
Reference in New Issue
Block a user