diff --git a/src/components/pages/ModuleList/index.tsx b/src/components/pages/ModuleList/index.tsx index dcb261a1d37d9c81b198d8eed84df414602d5469..097a8ee51bd98a992bdb34a558be85935a85ee77 100644 --- a/src/components/pages/ModuleList/index.tsx +++ b/src/components/pages/ModuleList/index.tsx @@ -15,6 +15,7 @@ import databaseIllustration from "assets/images/database-illustration.png"; import ModuleCard, { Term, ProgressStatus } from "components/atoms/ModuleCard"; import Dandruff from "components/molecules/Dandruff"; +import { modulesList } from "./list"; export interface ModuleListProps { modulesFilter: String; @@ -37,7 +38,7 @@ const ModuleList: React.FC<ModuleListProps> = ({ </p> <Row style={{ marginLeft: "-0.625rem", marginRight: "-0.625rem" }}> - {modules + {modulesList .filter( ({ progressStatus }) => modulesFilter === "" || progressStatus === modulesFilter @@ -50,88 +51,4 @@ const ModuleList: React.FC<ModuleListProps> = ({ ); }; -export default ModuleList; - -let modules = [ - { - title: "Introduction to Logic", - code: "CO140", - image: logicIllustration, - terms: [Term.AUTUMN], - progressStatus: ProgressStatus.IN_PROGRESS, - progressPercent: 50, - content: "" - }, - { - title: "Discrete Mathematics", - code: "CO142", - image: discreteIllustration, - terms: [Term.AUTUMN], - progressStatus: ProgressStatus.IN_PROGRESS, - progressPercent: 60, - content: "" - }, - { - title: "Introduction to Computer Systems", - code: "CO112", - image: systemsIllustration, - terms: [Term.AUTUMN], - progressStatus: ProgressStatus.IN_PROGRESS, - progressPercent: 93, - content: "" - }, - { - title: "Mathematical Methods", - code: "CO145", - terms: [Term.AUTUMN], - image: methodsIllustration, - progressStatus: ProgressStatus.IN_PROGRESS, - progressPercent: 45, - content: "" - }, - { - title: "Java", - code: "CO120.2", - image: javaIllustration, - terms: [Term.AUTUMN, Term.SPRING, Term.SUMMER], - progressStatus: ProgressStatus.IN_PROGRESS, - progressPercent: 20, - content: "" - }, - { - title: "Graphs and Algorithms", - code: "CO150", - image: graphIllustration, - terms: [Term.SPRING], - progressStatus: ProgressStatus.NOT_STARTED, - progressPercent: 0, - content: "" - }, - { - title: "Introduction to Computer Architecture", - code: "CO113", - image: architectureIllustration, - terms: [Term.SPRING], - progressStatus: ProgressStatus.NOT_STARTED, - progressPercent: 0, - content: "" - }, - { - title: "Reasoning About Programs", - code: "CO141", - image: reasoningIllustration, - terms: [Term.SPRING], - progressStatus: ProgressStatus.NOT_STARTED, - progressPercent: 0, - content: "" - }, - { - title: "Introduction to Databases", - code: "CO130", - image: databaseIllustration, - terms: [Term.SPRING], - progressStatus: ProgressStatus.NOT_STARTED, - progressPercent: 0, - content: "" - } -]; +export default ModuleList; \ No newline at end of file diff --git a/src/components/pages/ModuleList/list.ts b/src/components/pages/ModuleList/list.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa3b28f916674f924992d57c79db880e74b028a8 --- /dev/null +++ b/src/components/pages/ModuleList/list.ts @@ -0,0 +1,95 @@ +import logicIllustration from "assets/images/logic-illustration.svg"; +import discreteIllustration from "assets/images/discrete-illustration.svg"; +import systemsIllustration from "assets/images/systems-illustration.svg"; +import methodsIllustration from "assets/images/methods-illustration.svg"; +import graphIllustration from "assets/images/graph-illustration.svg"; +import javaIllustration from "assets/images/java-illustration.png"; +import reasoningIllustration from "assets/images/reasoning-illustration.png"; +import architectureIllustration from "assets/images/architecture-illustration.png"; +import databaseIllustration from "assets/images/database-illustration.png"; + +import { Term, ProgressStatus } from "components/atoms/ModuleCard"; + +export const modulesList = [ + { + title: "Introduction to Logic", + code: "CO140", + image: logicIllustration, + terms: [Term.AUTUMN], + progressStatus: ProgressStatus.IN_PROGRESS, + progressPercent: 50, + content: "", + }, + { + title: "Discrete Mathematics", + code: "CO142", + image: discreteIllustration, + terms: [Term.AUTUMN], + progressStatus: ProgressStatus.IN_PROGRESS, + progressPercent: 60, + content: "", + }, + { + title: "Introduction to Computer Systems", + code: "CO112", + image: systemsIllustration, + terms: [Term.AUTUMN], + progressStatus: ProgressStatus.IN_PROGRESS, + progressPercent: 93, + content: "", + }, + { + title: "Mathematical Methods", + code: "CO145", + terms: [Term.AUTUMN], + image: methodsIllustration, + progressStatus: ProgressStatus.IN_PROGRESS, + progressPercent: 45, + content: "", + }, + { + title: "Java", + code: "CO120.2", + image: javaIllustration, + terms: [Term.AUTUMN, Term.SPRING, Term.SUMMER], + progressStatus: ProgressStatus.IN_PROGRESS, + progressPercent: 20, + content: "", + }, + { + title: "Graphs and Algorithms", + code: "CO150", + image: graphIllustration, + terms: [Term.SPRING], + progressStatus: ProgressStatus.NOT_STARTED, + progressPercent: 0, + content: "", + }, + { + title: "Introduction to Computer Architecture", + code: "CO113", + image: architectureIllustration, + terms: [Term.SPRING], + progressStatus: ProgressStatus.NOT_STARTED, + progressPercent: 0, + content: "", + }, + { + title: "Reasoning About Programs", + code: "CO141", + image: reasoningIllustration, + terms: [Term.SPRING], + progressStatus: ProgressStatus.NOT_STARTED, + progressPercent: 0, + content: "", + }, + { + title: "Introduction to Databases", + code: "CO130", + image: databaseIllustration, + terms: [Term.SPRING], + progressStatus: ProgressStatus.NOT_STARTED, + progressPercent: 0, + content: "", + }, +]; diff --git a/src/components/pages/Timeline/components/WeekHeading/index.tsx b/src/components/pages/Timeline/components/WeekHeading/index.tsx index 6cb1f20b4b3d9e72914d8591ce0b30ba0b7f999d..bb806839d1408a30fb4cdbba28a11c4d30c57df7 100644 --- a/src/components/pages/Timeline/components/WeekHeading/index.tsx +++ b/src/components/pages/Timeline/components/WeekHeading/index.tsx @@ -42,14 +42,15 @@ const WeekHeading: React.FC<WeekHeadingProps> = ({ </Card.Header> <Card.Body> {days.map((day, i) => { - if ( - activeDay.getTime() === - dateRangeStart.getTime() + i * 86400000 - ) { - return <div className={styles.activeDay}>{day}</div>; - } else { - return <div className={styles.dayIndicator}>{day}</div>; - } + let isActive = + activeDay.getTime() === dateRangeStart.getTime() + i * 86400000; + return ( + <div + className={isActive ? styles.activeDay : styles.dayIndicator} + > + {day} + </div> + ); })} </Card.Body> </Card> diff --git a/src/components/pages/Timeline/index.tsx b/src/components/pages/Timeline/index.tsx index b94adb736ca318de757676cfa149fa430056c521..7bd5413427d895301ff2c0149afa41a073bf6e61 100644 --- a/src/components/pages/Timeline/index.tsx +++ b/src/components/pages/Timeline/index.tsx @@ -4,6 +4,7 @@ import styles from "./style.module.scss"; import TermSwitcher from "./components/TermSwitcher"; import ModuleHeading from "./components/ModuleHeading"; import WeekHeading from "./components/WeekHeading"; +import { modulesList } from "../ModuleList/list"; interface TimelineProps { initSideBar: () => void; @@ -49,14 +50,14 @@ class Timeline extends React.Component<TimelineProps, {}> { ))} </div> <div className={styles.timelineModuleColumn}> - {modules.map((module) => ( + {modulesList.map((module) => ( <div className={styles.moduleHeading}> <ModuleHeading moduleCode={module.code} title={module.title} /> </div> ))} </div> <div className={styles.timelineWeekBackground}> - {[...Array(12)].map((e, i) => { + {[...Array(numWeeks)].map(() => { return <div className={styles.timelineBackground}> </div>; })} </div> @@ -66,39 +67,4 @@ class Timeline extends React.Component<TimelineProps, {}> { } } -let modules = [ - { - title: "Introduction to Computer Systems", - code: "CO112", - }, - { - title: "Programming I (Haskell)", - code: "CO120.1", - }, - { - title: "Programming II (Java)", - code: "CO120.2", - }, - { - title: "Introduction to Logic", - code: "CO140", - }, - { - title: "Discrete Mathematics", - code: "CO142", - }, - { - title: "Mathematical Methods", - code: "CO145", - }, - { - title: "Computing Practical I", - code: "CO161", - }, - { - title: "Professional Issues", - code: "CO166", - }, -]; - export default Timeline; diff --git a/src/components/pages/Timeline/style.module.scss b/src/components/pages/Timeline/style.module.scss index e7d0a059417c9cdd740a68ec7b0e549bb09f8672..ce694e8d53777bfb5c2831642ef7061e399bc8a2 100644 --- a/src/components/pages/Timeline/style.module.scss +++ b/src/components/pages/Timeline/style.module.scss @@ -12,9 +12,9 @@ margin-bottom: 1.25rem; margin-left: -0.625rem; grid-template-columns: 16.875rem auto; - overflow: scroll; - scrollbar-width: thin; + scrollbar-width: thin; + height: calc(99vh - 11rem); scrollbar-color: var(--background-color) var(--background-color); }