From 9fb6409c49b43d051b41513af3b253219ff2c758 Mon Sep 17 00:00:00 2001 From: Sudarshan Sreeram <sudarshan.sreeram19@imperial.ac.uk> Date: Thu, 13 Aug 2020 22:01:36 +0530 Subject: [PATCH] Update the exams page --- .../organisms/LeftBarExams/index.tsx | 53 +++++++++++++++++++ .../organisms/LeftBarExams/style.module.scss | 0 .../src/components/pages/Dashboard/index.tsx | 4 +- frontend/src/components/pages/Exams/index.tsx | 12 +++++ .../components/pages/Exams/style.module.scss | 0 .../components/pages/StandardView/index.tsx | 8 ++- 6 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/organisms/LeftBarExams/index.tsx create mode 100644 frontend/src/components/organisms/LeftBarExams/style.module.scss create mode 100644 frontend/src/components/pages/Exams/index.tsx create mode 100644 frontend/src/components/pages/Exams/style.module.scss diff --git a/frontend/src/components/organisms/LeftBarExams/index.tsx b/frontend/src/components/organisms/LeftBarExams/index.tsx new file mode 100644 index 000000000..efef707f1 --- /dev/null +++ b/frontend/src/components/organisms/LeftBarExams/index.tsx @@ -0,0 +1,53 @@ +import React from "react"; +import LeftBar from "components/organisms/LeftBar"; +import SideBarTabGroup from "components/molecules/SideBarTabGroup"; +import { faCalendarAlt, faList, faUpload, faArchive, faGavel, faTable, faFont } from "@fortawesome/free-solid-svg-icons"; + +const LeftBarExams: React.FC = () => { + + let examButtons = [ + { + title: "Overview", + icon: faList, + activeURL: `/exams/`, + }, + { + title: "Past Papers", + icon: faArchive, + activeURL: `/exams/past-papers/`, + }, + { + title: "Submissions", + icon: faUpload, + activeURL: `/exams/past-papers/`, + }, + { + title: "Exam Timetable", + icon: faCalendarAlt, + activeURL: `/exams/past-papers/`, + }, + { + title: "Regulations", + icon: faGavel, + activeURL: `/exams/regulations/`, + }, + { + title: "Grading", + icon: faFont, + activeURL: `/exams/grading/`, + }, + { + title: "Rubrics", + icon: faTable, + activeURL: `/exams/rubrics`, + }, + ]; + + return ( + <LeftBar> + <SideBarTabGroup title="Links" buttons={examButtons} /> + </LeftBar> + ); +}; + +export default LeftBarExams; diff --git a/frontend/src/components/organisms/LeftBarExams/style.module.scss b/frontend/src/components/organisms/LeftBarExams/style.module.scss new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/src/components/pages/Dashboard/index.tsx b/frontend/src/components/pages/Dashboard/index.tsx index 33e8bcc3d..e3a599838 100644 --- a/frontend/src/components/pages/Dashboard/index.tsx +++ b/frontend/src/components/pages/Dashboard/index.tsx @@ -19,7 +19,7 @@ import tutorImage2 from "assets/images/tutor-2.png"; import tutorImage3 from "assets/images/tutor-3.png"; -const ModuleOverview: React.FC = () => { +const Dashboard: React.FC = () => { return ( <> <MyBreadcrumbs /> @@ -76,7 +76,7 @@ const ModuleOverview: React.FC = () => { ); }; -export default ModuleOverview; +export default Dashboard; const tutors = [ { diff --git a/frontend/src/components/pages/Exams/index.tsx b/frontend/src/components/pages/Exams/index.tsx new file mode 100644 index 000000000..8dc4cdad4 --- /dev/null +++ b/frontend/src/components/pages/Exams/index.tsx @@ -0,0 +1,12 @@ +import React, { useEffect } from "react"; +import Dandruff from "components/molecules/Dandruff"; + +const Exams: React.FC = () => { + return ( + <> + <Dandruff heading="Exams" /> + </> + ); +}; + +export default Exams; diff --git a/frontend/src/components/pages/Exams/style.module.scss b/frontend/src/components/pages/Exams/style.module.scss new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/src/components/pages/StandardView/index.tsx b/frontend/src/components/pages/StandardView/index.tsx index 4c5e61032..e48ab0e8a 100644 --- a/frontend/src/components/pages/StandardView/index.tsx +++ b/frontend/src/components/pages/StandardView/index.tsx @@ -3,6 +3,7 @@ import { Route, Switch, Redirect } from "react-router-dom"; import ExamplePage from "components/templates/ExamplePage"; import ModuleOverview from "components/pages/ModuleOverview"; import Dashboard from "components/pages/Dashboard"; +import Exams from "components/pages/Exams"; import "./style.scss"; import RightBar from "components/organisms/RightBar"; @@ -13,6 +14,7 @@ import ModuleFeedback from "../ModuleFeedback"; import LeftBarDashboard from "components/organisms/LeftBarDashboard"; import LeftBarModuleList from "components/organisms/LeftBarModuleList"; import LeftBarModule from "components/organisms/LeftBarModule"; +import LeftBarExams from "components/organisms/LeftBarExams"; import Container from "react-bootstrap/esm/Container"; interface StandardViewProps { @@ -49,6 +51,10 @@ const StandardView: React.FC<StandardViewProps> = ({ <LeftBarModuleList modulesFilter={modulesFilter} setModulesFilter={setModulesFilter}/> </Route> + <Route exact path="/exams"> + <LeftBarExams /> + </Route> + <Route path="/"> <LeftBarDashboard /> </Route> @@ -80,7 +86,7 @@ const StandardView: React.FC<StandardViewProps> = ({ </Route> <Route path="/exams"> - <ExamplePage name="Exams" /> + <Exams /> </Route> <Route -- GitLab