From ae91c0b4177bd7acb84f1849612fee104968f071 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 8 Feb 2023 18:47:53 +0500 Subject: [PATCH 1/2] fix: updated AppHeader call --- src/CourseAuthoringPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CourseAuthoringPage.jsx b/src/CourseAuthoringPage.jsx index adf8ca190e..bd2980533d 100644 --- a/src/CourseAuthoringPage.jsx +++ b/src/CourseAuthoringPage.jsx @@ -57,7 +57,7 @@ const CourseAuthoringPage = ({ courseId, children }) => { we shouldn't have the header and footer on these pages. This functionality will be removed in TNL-9591 */} {inProgress ? !pathname.includes('/editor/') && - : } + : AppHeader(courseNumber, courseOrg, courseTitle, courseId)} {children} {!inProgress && } From 9e7e6aeb916ffd921ec1e627519af0d5c5633fed Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Thu, 9 Feb 2023 15:42:09 +0500 Subject: [PATCH 2/2] fix: AppHeader function signature changed to react component --- src/CourseAuthoringPage.jsx | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/CourseAuthoringPage.jsx b/src/CourseAuthoringPage.jsx index bd2980533d..8c524c0beb 100644 --- a/src/CourseAuthoringPage.jsx +++ b/src/CourseAuthoringPage.jsx @@ -14,20 +14,34 @@ import { getCourseAppsApiStatus, getLoadingStatus } from './pages-and-resources/ import { RequestStatus } from './data/constants'; import Loading from './generic/Loading'; -const AppHeader = (courseNumber, courseOrg, courseTitle, courseId) => ( +const AppHeader = ({ + courseNumber, courseOrg, courseTitle, courseId, +}) => (
- ); +); - const AppFooter = () => ( -
-
-
- ); +AppHeader.propTypes = { + courseId: PropTypes.string.isRequired, + courseNumber: PropTypes.string, + courseOrg: PropTypes.string, + courseTitle: PropTypes.string.isRequired, +}; + +AppHeader.defaultProps = { + courseNumber: null, + courseOrg: null, +}; + +const AppFooter = () => ( +
+
+
+); const CourseAuthoringPage = ({ courseId, children }) => { const dispatch = useDispatch(); @@ -57,7 +71,14 @@ const CourseAuthoringPage = ({ courseId, children }) => { we shouldn't have the header and footer on these pages. This functionality will be removed in TNL-9591 */} {inProgress ? !pathname.includes('/editor/') && - : AppHeader(courseNumber, courseOrg, courseTitle, courseId)} + : ( + + )} {children} {!inProgress && }