This reverts commit 59b4366edd.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import React from 'react';
|
||||
import propTypes from 'prop-types';
|
||||
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
|
||||
import { useIsOnDesktop } from '../data/hooks';
|
||||
import { selectAreThreadsFiltered, selectPostThreadCount } from '../data/selectors';
|
||||
@@ -11,16 +11,16 @@ import messages from '../messages';
|
||||
import { messages as postMessages, showPostEditor } from '../posts';
|
||||
import EmptyPage from './EmptyPage';
|
||||
|
||||
const EmptyPosts = ({ subTitleMessage }) => {
|
||||
const intl = useIntl();
|
||||
function EmptyPosts({ intl, subTitleMessage }) {
|
||||
const dispatch = useDispatch();
|
||||
const isOnDesktop = useIsOnDesktop();
|
||||
|
||||
const isFiltered = useSelector(selectAreThreadsFiltered);
|
||||
const totalThreads = useSelector(selectPostThreadCount);
|
||||
const isOnDesktop = useIsOnDesktop();
|
||||
|
||||
const addPost = useCallback(() => (
|
||||
dispatch(showPostEditor())
|
||||
), []);
|
||||
function addPost() {
|
||||
return dispatch(showPostEditor());
|
||||
}
|
||||
|
||||
let title = messages.noPostSelected;
|
||||
let subTitle = null;
|
||||
@@ -49,7 +49,7 @@ const EmptyPosts = ({ subTitleMessage }) => {
|
||||
fullWidth={fullWidth}
|
||||
/>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
EmptyPosts.propTypes = {
|
||||
subTitleMessage: propTypes.shape({
|
||||
@@ -57,6 +57,7 @@ EmptyPosts.propTypes = {
|
||||
defaultMessage: propTypes.string,
|
||||
description: propTypes.string,
|
||||
}).isRequired,
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
export default React.memo(EmptyPosts);
|
||||
export default injectIntl(EmptyPosts);
|
||||
|
||||
Reference in New Issue
Block a user