From 3a7b7054e7e8f4a5ce026f639f13ac99ae23d421 Mon Sep 17 00:00:00 2001 From: Awais Ansari <79941147+awais-ansari@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:04:02 +0500 Subject: [PATCH] fix: user content unavailable content issue for learner (#674) --- .../NavigationBar/CourseTabsNavigation.jsx | 32 +----- src/components/NavigationBar/data/api.js | 14 +-- src/components/NavigationBar/data/thunks.js | 4 +- .../ContentUnavailable.jsx} | 10 +- src/discussions/data/hooks.js | 2 + src/discussions/data/selectors.js | 12 +- .../discussions-home/DiscussionsHome.jsx | 107 ++++++++---------- 7 files changed, 75 insertions(+), 106 deletions(-) rename src/discussions/{course-content-unavailable/CourseContentUnavailable.jsx => content-unavailable/ContentUnavailable.jsx} (88%) diff --git a/src/components/NavigationBar/CourseTabsNavigation.jsx b/src/components/NavigationBar/CourseTabsNavigation.jsx index 9d4af37d7..603343739 100644 --- a/src/components/NavigationBar/CourseTabsNavigation.jsx +++ b/src/components/NavigationBar/CourseTabsNavigation.jsx @@ -1,30 +1,21 @@ -import React, { useEffect } from 'react'; -import PropTypes from 'prop-types'; +import React from 'react'; import classNames from 'classnames'; -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { useIntl } from '@edx/frontend-platform/i18n'; -import fetchTab from './data/thunks'; import Tabs from './tabs/Tabs'; import messages from './messages'; import './navBar.scss'; -const CourseTabsNavigation = ({ - activeTab, className, courseId, rootSlug, -}) => { - const dispatch = useDispatch(); +const CourseTabsNavigation = () => { const intl = useIntl(); const tabs = useSelector(state => state.courseTabs.tabs); - useEffect(() => { - dispatch(fetchTab(courseId, rootSlug)); - }, [courseId]); - return ( -