* Moving model-store into “generic” sub-directory. Also adding a README.md to explain what belongs in “generic” * Moving user-messages into “generic” sub-directory. * Moving PageLoading into “generic” sub-directory. * Moving “tabs” module into “generic” sub-directory. * Moving InstructorToolbar and MasqueradeWidget up to instructor-toolbar. The masquerade widget is a sub-module of instructor-toolbar. * Co-locating celebration APIs with celebration utils. Also adding an ADR about thunk/API naming conventions and making some other areas of the code adhere to it. * Moving courseware data (thunks, api) into the courseware module. Note that cousre-home/data/api still uses normalizeBlocks - this should be fixed so it’s not reaching across. Maybe we pull that particular API up top. This PR includes a few TODOs for things I saw, as well as a tiny bit of whitespace cleanup.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { Switch, Route, useRouteMatch } from 'react-router';
|
|
import { getConfig } from '@edx/frontend-platform';
|
|
import { FormattedMessage } from '@edx/frontend-platform/i18n';
|
|
import PageLoading from './generic/PageLoading';
|
|
|
|
export default () => {
|
|
const { path } = useRouteMatch();
|
|
return (
|
|
<div className="flex-grow-1">
|
|
<PageLoading srMessage={(
|
|
<FormattedMessage
|
|
id="learn.redirect.interstitial.message"
|
|
description="The screen-reader message when a page is about to redirect"
|
|
defaultMessage="Redirecting..."
|
|
/>
|
|
)}
|
|
/>
|
|
|
|
<Switch>
|
|
<Route
|
|
path={`${path}/course-home/:courseId`}
|
|
render={({ match }) => {
|
|
global.location.assign(`${getConfig().LMS_BASE_URL}/courses/${match.params.courseId}/course/`);
|
|
}}
|
|
/>
|
|
<Route
|
|
path={`${path}/dashboard`}
|
|
render={({ location }) => {
|
|
global.location.assign(`${getConfig().LMS_BASE_URL}/dashboard${location.search}`);
|
|
}}
|
|
/>
|
|
</Switch>
|
|
</div>
|
|
);
|
|
};
|