diff --git a/src/course-home/goal-unsubscribe/GoalUnsubscribe.jsx b/src/course-home/goal-unsubscribe/GoalUnsubscribe.jsx index 3a6922ee..5b69d814 100644 --- a/src/course-home/goal-unsubscribe/GoalUnsubscribe.jsx +++ b/src/course-home/goal-unsubscribe/GoalUnsubscribe.jsx @@ -3,7 +3,7 @@ import { useParams } from 'react-router-dom'; import { sendTrackEvent } from '@edx/frontend-platform/analytics'; import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; -import { LearningHeader as Header } from '@edx/frontend-component-header'; +import HeaderSlot from '../../plugin-slots/HeaderSlot'; import PageLoading from '../../generic/PageLoading'; import { unsubscribeFromCourseGoal } from '../data/api'; @@ -38,7 +38,7 @@ const GoalUnsubscribe = ({ intl }) => { return ( <> -
+
{isLoading && ( diff --git a/src/generic/CourseAccessErrorPage.jsx b/src/generic/CourseAccessErrorPage.jsx index ac6ab3f9..25f4779a 100644 --- a/src/generic/CourseAccessErrorPage.jsx +++ b/src/generic/CourseAccessErrorPage.jsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import { LearningHeader as Header } from '@edx/frontend-component-header'; import { useParams, Navigate } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; import FooterSlot from '@openedx/frontend-slot-footer'; import { LOADED, LOADING } from '@src/constants'; +import HeaderSlot from '../plugin-slots/HeaderSlot'; import useActiveEnterpriseAlert from '../alerts/active-enteprise-alert'; import { AlertList } from './user-messages'; import { fetchDiscussionTab } from '../course-home/data/thunks'; @@ -28,7 +28,7 @@ const CourseAccessErrorPage = ({ intl }) => { if (courseStatus === LOADING) { return ( <> -
+ @@ -41,7 +41,7 @@ const CourseAccessErrorPage = ({ intl }) => { } return ( <> -
+
( + <> +

🌞

+

courseOrg: {courseOrg}

+

courseNumber: {courseNumber}

+

courseTitle: {courseTitle}

+

showUserDropdown: {showUserDropdown ? '👍' : '👎'}

+

🌚

+ + ), + }, + }, + ] + } + }, +} + +export default config; +``` diff --git a/src/plugin-slots/HeaderSlot/images/header_custom_component.png b/src/plugin-slots/HeaderSlot/images/header_custom_component.png new file mode 100644 index 00000000..a2a33875 Binary files /dev/null and b/src/plugin-slots/HeaderSlot/images/header_custom_component.png differ diff --git a/src/plugin-slots/HeaderSlot/index.jsx b/src/plugin-slots/HeaderSlot/index.jsx new file mode 100644 index 00000000..11808f21 --- /dev/null +++ b/src/plugin-slots/HeaderSlot/index.jsx @@ -0,0 +1,44 @@ +import PropTypes from 'prop-types'; +import { PluginSlot } from '@openedx/frontend-plugin-framework'; + +import { LearningHeader as Header } from '@edx/frontend-component-header'; + +const HeaderSlot = ({ + courseOrg, courseNumber, courseTitle, showUserDropdown, +}) => ( + +
+ +); + +HeaderSlot.propTypes = { + courseOrg: PropTypes.string, + courseNumber: PropTypes.string, + courseTitle: PropTypes.string, + showUserDropdown: PropTypes.bool, +}; + +HeaderSlot.defaultProps = { + courseOrg: null, + courseNumber: null, + courseTitle: null, + showUserDropdown: true, +}; + +export default HeaderSlot; diff --git a/src/plugin-slots/README.md b/src/plugin-slots/README.md index f7c775d2..5c20d87f 100644 --- a/src/plugin-slots/README.md +++ b/src/plugin-slots/README.md @@ -1,5 +1,6 @@ # `frontend-app-learning` Plugin Slots +* [`header_slot`](./HeaderSlot/) * [`footer_slot`](./FooterSlot/) * [`sequence_container_slot`](./SequenceContainerSlot/) * [`unit_title_slot`](./UnitTitleSlot/) diff --git a/src/tab-page/TabPage.jsx b/src/tab-page/TabPage.jsx index c9c29ed5..d1fe47bc 100644 --- a/src/tab-page/TabPage.jsx +++ b/src/tab-page/TabPage.jsx @@ -5,8 +5,8 @@ import { useDispatch, useSelector } from 'react-redux'; import { Navigate } from 'react-router-dom'; import { Toast } from '@openedx/paragon'; -import { LearningHeader as Header } from '@edx/frontend-component-header'; import FooterSlot from '@openedx/frontend-slot-footer'; +import HeaderSlot from '../plugin-slots/HeaderSlot'; import PageLoading from '../generic/PageLoading'; import { getAccessDeniedRedirectUrl } from '../shared/access'; import { useModel } from '../generic/model-store'; @@ -64,7 +64,7 @@ const TabPage = ({ intl, ...props }) => { )} -
+ {courseStatus === 'loading' && (