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> { ...@@ -52,7 +52,7 @@ class App extends React.Component<{}, AppState> {
render() { render() {
const horizontalBarPages = [ const horizontalBarPages = [
{ name: "Home", path: "/home", icon: faHome }, { name: "Dashboard", path: "/dashboard", icon: faHome },
{ name: "Modules", path: "/modules", icon: faChalkboardTeacher }, { name: "Modules", path: "/modules", icon: faChalkboardTeacher },
{ name: "Timeline", path: "/timeline", icon: faCalendarWeek }, { name: "Timeline", path: "/timeline", icon: faCalendarWeek },
{ name: "Exams", path: "/exams", icon: faBookOpen }, { name: "Exams", path: "/exams", icon: faBookOpen },
......
...@@ -5,8 +5,7 @@ import styles from "./style.module.scss"; ...@@ -5,8 +5,7 @@ import styles from "./style.module.scss";
import withBreadcrumbs from "react-router-breadcrumbs-hoc"; import withBreadcrumbs from "react-router-breadcrumbs-hoc";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
// delete [{ path: "/", breadcrumb: "" }] to enable Home in front of breadcrumbs const MyBreadcrumbs = withBreadcrumbs()(
const MyBreadcrumbs = withBreadcrumbs([{ path: "/", breadcrumb: "" }])(
({ breadcrumbs }: { breadcrumbs: any }) => ( ({ breadcrumbs }: { breadcrumbs: any }) => (
<Breadcrumb className={styles.breadcrumb}> <Breadcrumb className={styles.breadcrumb}>
{breadcrumbs.map( {breadcrumbs.map(
......
...@@ -4,7 +4,7 @@ import SideBarTabGroup from "components/molecules/SideBarTabGroup"; ...@@ -4,7 +4,7 @@ import SideBarTabGroup from "components/molecules/SideBarTabGroup";
import { faGitlab } from "@fortawesome/free-brands-svg-icons"; import { faGitlab } from "@fortawesome/free-brands-svg-icons";
import { faFlask, faAward, faDatabase, faEnvelopeOpen } from "@fortawesome/free-solid-svg-icons"; import { faFlask, faAward, faDatabase, faEnvelopeOpen } from "@fortawesome/free-solid-svg-icons";
const LeftBarHome: React.FC = () => { const LeftBarDashboard: React.FC = () => {
let linkButtons = [ let linkButtons = [
{ {
title: "GitLab", title: "GitLab",
...@@ -40,4 +40,4 @@ const LeftBarHome: React.FC = () => { ...@@ -40,4 +40,4 @@ const LeftBarHome: React.FC = () => {
); );
}; };
export default LeftBarHome; export default LeftBarDashboard;
...@@ -9,7 +9,7 @@ import classNames from "classnames"; ...@@ -9,7 +9,7 @@ import classNames from "classnames";
import ModuleList from "../ModuleList"; import ModuleList from "../ModuleList";
import ModuleResources from "../ModuleResources"; import ModuleResources from "../ModuleResources";
import ModuleFeedback from "../ModuleFeedback"; import ModuleFeedback from "../ModuleFeedback";
import LeftBarHome from "components/organisms/LeftBarHome"; import LeftBarDashboard from "components/organisms/LeftBarDashboard";
import LeftBarModuleList from "components/organisms/LeftBarModuleList"; import LeftBarModuleList from "components/organisms/LeftBarModuleList";
import LeftBarModule from "components/organisms/LeftBarModule"; import LeftBarModule from "components/organisms/LeftBarModule";
import Container from "react-bootstrap/esm/Container"; import Container from "react-bootstrap/esm/Container";
...@@ -48,15 +48,15 @@ const StandardView: React.FC<StandardViewProps> = ({ ...@@ -48,15 +48,15 @@ const StandardView: React.FC<StandardViewProps> = ({
</Route> </Route>
<Route path="/"> <Route path="/">
<LeftBarHome /> <LeftBarDashboard />
</Route> </Route>
</Switch> </Switch>
<div id="sidenav-overlay" onClick={(e) => onOverlayClick(e)}></div> <div id="sidenav-overlay" onClick={(e) => onOverlayClick(e)}></div>
<Container className={classNames("py-4", "px-5", "pageContainer")}> <Container className={classNames("py-4", "px-5", "pageContainer")}>
<Switch> <Switch>
<Route path="/home"> <Route path="/dashboard">
<ExamplePage name="Home" /> <ExamplePage name="Dashboard" />
</Route> </Route>
<Route exact path="/modules"> <Route exact path="/modules">
...@@ -89,7 +89,7 @@ const StandardView: React.FC<StandardViewProps> = ({ ...@@ -89,7 +89,7 @@ const StandardView: React.FC<StandardViewProps> = ({
<Redirect to={`/modules/${props.match.params.id}/overview`} /> <Redirect to={`/modules/${props.match.params.id}/overview`} />
)} )}
/> />
<Route path="/" render={() => <Redirect to="/home" />} /> <Route path="/" render={() => <Redirect to="/dashboard" />} />
</Switch> </Switch>
</Container> </Container>
</div> </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