Files
frontend-app-authoring/src/CourseAuthoringRoutes.jsx
David Joy 013aba58a6 Discussions LTI config UI. (#50)
* Adding font-awesome so we can use it with StatefulButton

* Rudimentary discussion config UI with mocked APIs.

* Updating Yellowdig logo URL

* Bumping and locking dependencies, adding formik and yup

* Wiring up the “Enable” button to go to the discussions config.

* Refactoring DiscussionConfig to use formik and yup.

* Using more paragon components - Card, CardGrid, and DataTable

* Adding keys to arrays of rendered components.

* Ignore module.config.js file.

* Bumping frontend-build to the latest version.

* Removing font-awesome again - it’s no longer necessary.

The latest version of Paragon uses <FontAwesomeIcon> for its closing “X”, rather than using CSS class names directly.

* Splitting discussion app list cards out into their own component.

They used to, but were folded in while refactoring to use Card and CardGrid.

* Adding comments to FeaturesTable.
2021-02-26 13:45:56 -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 { PagesAndResources } from './pages-and-resources';
import ProctoredExamSettings from './proctored-exam-settings/ProctoredExamSettings';
import DiscussionsRoutes from './pages-and-resources/discussions/DiscussionsRoutes';
/**
* 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-and-resources`}>
<PagesAndResources courseId={courseId} />
</PageRoute>
<PageRoute path={`${path}/pages-and-resources/discussion`}>
<DiscussionsRoutes courseId={courseId} />
</PageRoute>
<PageRoute path={`${path}/proctored-exam-settings`}>
<ProctoredExamSettings courseId={courseId} />
</PageRoute>
</Switch>
</CourseAuthoringPage>
);
}
CourseAuthoringRoutes.propTypes = {
courseId: PropTypes.string.isRequired,
};