Files
frontend-app-authoring/src/CourseAuthoringRoutes.jsx
David Joy 78667fa972 Discussion tool selection page skeleton (#44)
* Added new components for Discussion Tool Selection

* Incorporating discussion tool selector page into CourseAuthoringRoutes

* Improving tool selection - will now unselect

Also using a pointer cursor.

* Styling tweaks, logo size and text color

Making the logo so it doesn’t scale vertically - picked 100px arbitrarily.  It will be changed, but is now at least a little more inline with how the Pages & Resources view behaves.

Also darkening text color - it looked disabled.

* Adding a “Configure forum” button

It appears when a tool is selected.

This is a temporary location, depending on whether or not we insist on this page being a full-page modal.  In my opinion we should just keep it a normal page.

Co-authored-by: Aayush <ayush@opencraft.com>
2021-01-08 14:07:24 -05:00

48 lines
1.8 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { Switch, useRouteMatch } from 'react-router';
import { PageRoute } from '@edx/frontend-platform/react';
import CourseAuthoringPage from './CourseAuthoringPage';
import { CoursePageResources } from './course-page-resources';
import ProctoredExamSettings from './proctored-exam-settings/ProctoredExamSettings';
import DiscussionToolSelectorContainer from './discussion-tool-selector/DiscussionToolSelectorContainer';
/**
* As of this writing, these routes are mounted at a path prefixed with the following:
*
* /course/:courseId
*
* Meaning that their absolute paths look like:
*
* /course/:courseId/course-pages
* /course/:courseId/proctored-exam-settings
*
* This component and CourseAuthoringPage should maybe be combined once we no longer need to have
* CourseAuthoringPage split out for use in LegacyProctoringRoute. Once that route is removed, we
* can move the Header/Footer rendering to this component and likely pull the course detail loading
* in as well, and it'd feel a bit better-factored and the roles would feel more clear.
*/
export default function CourseAuthoringRoutes({ courseId }) {
const { path } = useRouteMatch();
return (
<CourseAuthoringPage courseId={courseId}>
<Switch>
<PageRoute exact path={`${path}/pages`}>
<CoursePageResources courseId={courseId} />
</PageRoute>
<PageRoute path={`${path}/pages/discussion`}>
<DiscussionToolSelectorContainer courseId={courseId} />
</PageRoute>
<PageRoute path={`${path}/proctored-exam-settings`}>
<ProctoredExamSettings courseId={courseId} />
</PageRoute>
</Switch>
</CourseAuthoringPage>
);
}
CourseAuthoringRoutes.propTypes = {
courseId: PropTypes.string.isRequired,
};