Skip to content
Snippets Groups Projects
Commit bbb443ad authored by danieldeng2's avatar danieldeng2
Browse files

Change default route to dashboard to resolve breadcrumb confusion

parent a2b45aa7
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ class App extends React.Component<{}, AppState> {
render() {
const horizontalBarPages = [
{ name: "Home", path: "/home", icon: faHome },
{ name: "Dashboard", path: "/dashboard", icon: faHome },
{ name: "Modules", path: "/modules", icon: faChalkboardTeacher },
{ name: "Timeline", path: "/timeline", icon: faCalendarWeek },
{ name: "Exams", path: "/exams", icon: faBookOpen },
......
......@@ -5,8 +5,7 @@ import styles from "./style.module.scss";
import withBreadcrumbs from "react-router-breadcrumbs-hoc";
import { Link } from "react-router-dom";
// delete [{ path: "/", breadcrumb: "" }] to enable Home in front of breadcrumbs
const MyBreadcrumbs = withBreadcrumbs([{ path: "/", breadcrumb: "" }])(
const MyBreadcrumbs = withBreadcrumbs()(
({ breadcrumbs }: { breadcrumbs: any }) => (
<Breadcrumb className={styles.breadcrumb}>
{breadcrumbs.map(
......
......@@ -4,7 +4,7 @@ import SideBarTabGroup from "components/molecules/SideBarTabGroup";
import { faGitlab } from "@fortawesome/free-brands-svg-icons";
import { faFlask, faAward, faDatabase, faEnvelopeOpen } from "@fortawesome/free-solid-svg-icons";
const LeftBarHome: React.FC = () => {
const LeftBarDashboard: React.FC = () => {
let linkButtons = [
{
title: "GitLab",
......@@ -40,4 +40,4 @@ const LeftBarHome: React.FC = () => {
);
};
export default LeftBarHome;
export default LeftBarDashboard;
......@@ -9,7 +9,7 @@ import classNames from "classnames";
import ModuleList from "../ModuleList";
import ModuleResources from "../ModuleResources";
import ModuleFeedback from "../ModuleFeedback";
import LeftBarHome from "components/organisms/LeftBarHome";
import LeftBarDashboard from "components/organisms/LeftBarDashboard";
import LeftBarModuleList from "components/organisms/LeftBarModuleList";
import LeftBarModule from "components/organisms/LeftBarModule";
import Container from "react-bootstrap/esm/Container";
......@@ -48,15 +48,15 @@ const StandardView: React.FC<StandardViewProps> = ({
</Route>
<Route path="/">
<LeftBarHome />
<LeftBarDashboard />
</Route>
</Switch>
<div id="sidenav-overlay" onClick={(e) => onOverlayClick(e)}></div>
<Container className={classNames("py-4", "px-5", "pageContainer")}>
<Switch>
<Route path="/home">
<ExamplePage name="Home" />
<Route path="/dashboard">
<ExamplePage name="Dashboard" />
</Route>
<Route exact path="/modules">
......@@ -89,7 +89,7 @@ const StandardView: React.FC<StandardViewProps> = ({
<Redirect to={`/modules/${props.match.params.id}/overview`} />
)}
/>
<Route path="/" render={() => <Redirect to="/home" />} />
<Route path="/" render={() => <Redirect to="/dashboard" />} />
</Switch>
</Container>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment