Revert "Perf: improved discussions MFE's components re-rendering and loading time (#485)" (#512)

This reverts commit 59b4366edd.
This commit is contained in:
Awais Ansari
2023-05-08 15:34:43 +05:00
committed by GitHub
parent 59b4366edd
commit 7b7c249abd
86 changed files with 1970 additions and 2486 deletions

View File

@@ -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);