diff --git a/src/components/atoms/PersonCard/index.tsx b/src/components/atoms/PersonCard/index.tsx index b4e989be97429e0ace64f122af8b578c23c392b4..17839a18c61a8c10111951309f076e8396bc8c3e 100644 --- a/src/components/atoms/PersonCard/index.tsx +++ b/src/components/atoms/PersonCard/index.tsx @@ -5,11 +5,6 @@ import styles from "./style.module.scss"; import userImage from "assets/images/user.png"; const PersonCard: React.FC = () => { - // @ts-ignore - useEffect(() => { - window.Holder.run(); - }); - return ( <> <Container className={styles.userCardContainer}> diff --git a/src/components/pages/Dashboard/index.tsx b/src/components/pages/Dashboard/index.tsx index 7c9ff4413505eef4350d1f3a2adb3b69907edd62..f24adb7af0601963a1cd025c1e209d8adeab5e4c 100644 --- a/src/components/pages/Dashboard/index.tsx +++ b/src/components/pages/Dashboard/index.tsx @@ -13,7 +13,7 @@ import { faFileInvoice, faDatabase, faQuestionCircle, - faBug, + faBug } from "@fortawesome/free-solid-svg-icons"; const Dashboard: React.FC = () => { @@ -21,12 +21,32 @@ const Dashboard: React.FC = () => { <> <MyBreadcrumbs /> <PersonCard /> - <PageButtonGroup buttons={buttons} style={{ marginTop: "2.8rem" }}/> + <PageButtonGroup buttons={buttons} style={{ marginTop: "2.8rem" }} /> <Row> - <Col xs={12} sm={12} md={12} lg={6} style={{ marginTop: "30px", paddingRight: "10px", paddingLeft: "10px"}}> + <Col + xs={12} + sm={12} + md={12} + lg={6} + style={{ + marginTop: "1.875rem", + paddingRight: "0.625rem", + paddingLeft: "0.625rem" + }} + > <TutorCardGroup /> </Col> - <Col xs={12} sm={12} md={12} lg={6} style={{ marginTop: "30px", paddingRight: "10px", paddingLeft: "10px"}}> + <Col + xs={12} + sm={12} + md={12} + lg={6} + style={{ + marginTop: "1.875rem", + paddingRight: "0.625rem", + paddingLeft: "0.625rem" + }} + > <NoticeBoard /> </Col> </Row> @@ -35,46 +55,46 @@ const Dashboard: React.FC = () => { }; const buttons = [ - { - title: "My Record", - icon: faFileInvoice, - url: "https://cate.doc.ic.ac.uk/student.cgi?key=2019", - }, - { - title: "My Website", - icon: faGlobe, - url: `https://www.doc.ic.ac.uk/~br819/`, - }, - { - title: "My Imperial", - icon: faFileAlt, - url: "https://my.imperial.ac.uk/HomeScreen.aspx", - }, - { - title: "TeachDB", - icon: faDatabase, - url: "https://teachdb.doc.ic.ac.uk/db/", - }, - { - title: "ICT Guides", - icon: faQuestionCircle, - url: "https://www.imperial.ac.uk/admin-services/ict/self-service/", - }, - { - title: "CSG Guides", - icon: faQuestionCircle, - url: "https://www.imperial.ac.uk/computing/csg/guides/", - }, - { - title: "Printing", - icon: faPrint, - url: "https://ictprintservice.imperial.ac.uk/safecom/webuser.dll/login", - }, - { - title: "Report Bugs", - icon: faBug, - url: "https://gitlab.doc.ic.ac.uk/edtech/scientia/-/issues/new", - }, + { + title: "My Record", + icon: faFileInvoice, + url: "https://cate.doc.ic.ac.uk/student.cgi?key=2019" + }, + { + title: "My Website", + icon: faGlobe, + url: `https://www.doc.ic.ac.uk/~br819/` + }, + { + title: "My Imperial", + icon: faFileAlt, + url: "https://my.imperial.ac.uk/HomeScreen.aspx" + }, + { + title: "TeachDB", + icon: faDatabase, + url: "https://teachdb.doc.ic.ac.uk/db/" + }, + { + title: "ICT Guides", + icon: faQuestionCircle, + url: "https://www.imperial.ac.uk/admin-services/ict/self-service/" + }, + { + title: "CSG Guides", + icon: faQuestionCircle, + url: "https://www.imperial.ac.uk/computing/csg/guides/" + }, + { + title: "Printing", + icon: faPrint, + url: "https://ictprintservice.imperial.ac.uk/safecom/webuser.dll/login" + }, + { + title: "Report Bugs", + icon: faBug, + url: "https://gitlab.doc.ic.ac.uk/edtech/scientia/-/issues/new" + } ]; export default Dashboard; diff --git a/src/components/pages/Exams/Grading/index.tsx b/src/components/pages/Exams/Grading/index.tsx index 230e9c5602c1ff0377ce7d4b507f500f6b32f001..452cc61695087133e4c28072a01f70a250a85100 100644 --- a/src/components/pages/Exams/Grading/index.tsx +++ b/src/components/pages/Exams/Grading/index.tsx @@ -6,9 +6,15 @@ const ExamGrading: React.FC = () => { <> <Dandruff heading="Grading" /> {/* TODO: Convert below into MarkDown */} - <p>Every Academic Year has its own schema, as determined annually by the Teaching Operations Committee or equivalent.</p> - <p>The grades below are to be used in the marking of coursework and labwork.</p> - <div className="table-responsive"> + <p> + Every Academic Year has its own schema, as determined annually by the + Teaching Operations Committee or equivalent. + </p> + <p> + The grades below are to be used in the marking of coursework and + labwork. + </p> + <div className="table-responsive"> <table className="table table-striped table-responsive table-bordered"> <tbody> <tr> diff --git a/src/components/pages/Exams/PastPapers/index.tsx b/src/components/pages/Exams/PastPapers/index.tsx index d1ead9c11daaf49feabf1c4ea8a7630849884fb8..9fee2eea26be173ed724d5326e813c73afd7bed3 100644 --- a/src/components/pages/Exams/PastPapers/index.tsx +++ b/src/components/pages/Exams/PastPapers/index.tsx @@ -13,7 +13,11 @@ import Card from "react-bootstrap/Card"; import Row from "react-bootstrap/esm/Row"; import Col from "react-bootstrap/esm/Col"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faInfoCircle, faFile, faFolder } from "@fortawesome/free-solid-svg-icons"; +import { + faInfoCircle, + faFile, + faFolder +} from "@fortawesome/free-solid-svg-icons"; const PastPapers: React.FC = () => { return ( @@ -33,14 +37,20 @@ const PastPapers: React.FC = () => { </InputGroup> <h5 - style={{ marginTop: "30px", marginBottom: "10px" }} + style={{ marginTop: "1.875rem", marginBottom: "0.625rem" }} className={classNames(styles.moduleSectionHeader)} > Folders </h5> - <Row style={{marginRight:"-10px", marginLeft:"-10px"}}> + <Row style={{ marginRight: "-0.625rem", marginLeft: "-0.625rem" }}> {[...Array(3)].map((e, i) => ( - <Col xs={6} sm={6} md={3} key={i} style={{paddingLeft: "10px", paddingRight: "10px"}}> + <Col + xs={6} + sm={6} + md={3} + key={i} + style={{ paddingLeft: "0.625rem", paddingRight: "0.625rem" }} + > <Card className={styles.folderCard}> <Card.Body style={{ padding: ".6rem" }}> <Card.Text style={{ marginBottom: 0 }}>Folder {i}</Card.Text> @@ -56,9 +66,17 @@ const PastPapers: React.FC = () => { <h5 className={classNames(styles.moduleSectionHeader)}>Quick Access</h5> - <Row style={{marginRight:"-10px", marginLeft:"-10px"}}> + <Row style={{ marginRight: "-0.625rem", marginLeft: "-0.625rem" }}> {[...Array(4)].map((e, i) => ( - <Col xs={12} sm={6} md={6} lg={4} xl={3} key={i} style={{paddingLeft: "10px", paddingRight: "10px"}}> + <Col + xs={12} + sm={6} + md={6} + lg={4} + xl={3} + key={i} + style={{ paddingLeft: "0.625rem", paddingRight: "0.625rem" }} + > <Card className={styles.quickViewCard}> <Card.Header> <span className={styles.assessmentResult}>40 / 50</span> @@ -89,7 +107,6 @@ const PastPapers: React.FC = () => { </Col> ))} </Row> - </> ); }; diff --git a/src/components/pages/Exams/PastPapers/style.module.scss b/src/components/pages/Exams/PastPapers/style.module.scss index c8af7cc6743a063c490e7b765e0d811b2b419716..95e9a89715414c451325e13017a7e56a2ad9eec0 100644 --- a/src/components/pages/Exams/PastPapers/style.module.scss +++ b/src/components/pages/Exams/PastPapers/style.module.scss @@ -8,8 +8,8 @@ margin-top: 1rem; } -.assessmentResult{ - float: right; +.assessmentResult { + float: right; } .searchBar { @@ -70,7 +70,7 @@ transition: transform 0.2s, box-shadow 0.2s; background-color: $white; height: 96%; - border: 1px solid $gray-200; + border: 0.0625rem solid $gray-200; } .quickViewCard:hover { @@ -114,17 +114,17 @@ font-size: 1.125rem; font-weight: 400; white-space: normal; - margin-bottom: 0px; + margin-bottom: 0rem; width: 90%; - overflow-wrap: break-word; - word-wrap: break-word; - -ms-word-break: break-all; - word-break: break-all; - word-break: break-word; + overflow-wrap: break-word; + word-wrap: break-word; + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; } .quickViewCard :global(.card-img-top) { - border-radius: 0px; + border-radius: 0rem; } $blue-tag-background: transparentize($blue-100, 0.5); @@ -153,7 +153,7 @@ $teal-tag-background: transparentize($teal-100, 0.5); .folderCard { border-radius: 0.5rem; transition: transform 0.2s, box-shadow 0.2s; - border: 1px solid $gray-200; + border: 0.0625rem solid $gray-200; background-color: $white; margin-top: 0.67rem; } diff --git a/src/components/pages/Exams/Rubrics/index.tsx b/src/components/pages/Exams/Rubrics/index.tsx index 4295a60447b84c88ea1122225481ad378c1a2772..f749e27eac53c50e57d6a618ddd609c95354cd96 100644 --- a/src/components/pages/Exams/Rubrics/index.tsx +++ b/src/components/pages/Exams/Rubrics/index.tsx @@ -6,7 +6,7 @@ const ExamRubrics: React.FC = () => { <> <Dandruff heading="Rubrics" /> {/* TODO: Convert below into MarkDown */} - <p>Information about durations, how many questions. </p> + <p>Information about durations, how many questions. </p> <div className="table-responsive"> <table className="table table-striped table-responsive table-bordered"> <tbody> diff --git a/src/components/pages/Exams/index.tsx b/src/components/pages/Exams/index.tsx index 9076514ea94c3e4a30017b205675bd2fdc3da61a..e332b9d0b7604197e2477113fa65ffe806bc30c1 100644 --- a/src/components/pages/Exams/index.tsx +++ b/src/components/pages/Exams/index.tsx @@ -5,14 +5,14 @@ const Exams: React.FC = () => { return ( <> <Dandruff heading="Exams" /> - {/* TODO: Convert below into MarkDown */} + {/* TODO: Convert below into MarkDown */} <div> {/* saved from url=(0027)https://exams.doc.ic.ac.uk/ */} <p> Messages from the Senior Tutor about examination results for Computing and JMC students are now available - please see your grades page using the link below. Also MSc students will find their unofficial - examination results and messages. + examination results and messages. </p> <p> <a href="https://exams.doc.ic.ac.uk/prog/showgrades.cgi"> diff --git a/src/components/pages/ModuleFeedback/index.tsx b/src/components/pages/ModuleFeedback/index.tsx index 058098924fc2330c9221731b6ec0c48b676ab125..43e2d6efeba3f09e811ab80517c8b10a673192ca 100644 --- a/src/components/pages/ModuleFeedback/index.tsx +++ b/src/components/pages/ModuleFeedback/index.tsx @@ -13,7 +13,11 @@ import Card from "react-bootstrap/Card"; import Row from "react-bootstrap/esm/Row"; import Col from "react-bootstrap/esm/Col"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faInfoCircle, faFile, faFolder } from "@fortawesome/free-solid-svg-icons"; +import { + faInfoCircle, + faFile, + faFolder +} from "@fortawesome/free-solid-svg-icons"; const ModuleFeedback: React.FC = () => { return ( @@ -33,14 +37,20 @@ const ModuleFeedback: React.FC = () => { </InputGroup> <h5 - style={{ marginTop: "30px", marginBottom: "10px" }} + style={{ marginTop: "1.875rem", marginBottom: "0.625rem" }} className={classNames(styles.moduleSectionHeader)} > Folders </h5> - <Row style={{marginRight:"-10px", marginLeft:"-10px"}}> + <Row style={{ marginRight: "-0.625rem", marginLeft: "-0.625rem" }}> {[...Array(3)].map((e, i) => ( - <Col xs={6} sm={6} md={3} key={i} style={{paddingLeft: "10px", paddingRight: "10px"}}> + <Col + xs={6} + sm={6} + md={3} + key={i} + style={{ paddingLeft: "0.625rem", paddingRight: "0.625rem" }} + > <Card className={styles.folderCard}> <Card.Body style={{ padding: ".6rem" }}> <Card.Text style={{ marginBottom: 0 }}>Folder {i}</Card.Text> @@ -56,9 +66,17 @@ const ModuleFeedback: React.FC = () => { <h5 className={classNames(styles.moduleSectionHeader)}>Quick Access</h5> - <Row style={{marginRight:"-10px", marginLeft:"-10px"}}> + <Row style={{ marginRight: "-0.625rem", marginLeft: "-0.625rem" }}> {[...Array(4)].map((e, i) => ( - <Col xs={12} sm={6} md={6} lg={4} xl={3} key={i} style={{paddingLeft: "10px", paddingRight: "10px"}}> + <Col + xs={12} + sm={6} + md={6} + lg={4} + xl={3} + key={i} + style={{ paddingLeft: "0.625rem", paddingRight: "0.625rem" }} + > <Card className={styles.quickViewCard}> <Card.Header> <span className={styles.assessmentResult}>40 / 50</span> @@ -89,7 +107,6 @@ const ModuleFeedback: React.FC = () => { </Col> ))} </Row> - </> ); }; diff --git a/src/components/pages/ModuleFeedback/style.module.scss b/src/components/pages/ModuleFeedback/style.module.scss index c8af7cc6743a063c490e7b765e0d811b2b419716..95e9a89715414c451325e13017a7e56a2ad9eec0 100644 --- a/src/components/pages/ModuleFeedback/style.module.scss +++ b/src/components/pages/ModuleFeedback/style.module.scss @@ -8,8 +8,8 @@ margin-top: 1rem; } -.assessmentResult{ - float: right; +.assessmentResult { + float: right; } .searchBar { @@ -70,7 +70,7 @@ transition: transform 0.2s, box-shadow 0.2s; background-color: $white; height: 96%; - border: 1px solid $gray-200; + border: 0.0625rem solid $gray-200; } .quickViewCard:hover { @@ -114,17 +114,17 @@ font-size: 1.125rem; font-weight: 400; white-space: normal; - margin-bottom: 0px; + margin-bottom: 0rem; width: 90%; - overflow-wrap: break-word; - word-wrap: break-word; - -ms-word-break: break-all; - word-break: break-all; - word-break: break-word; + overflow-wrap: break-word; + word-wrap: break-word; + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; } .quickViewCard :global(.card-img-top) { - border-radius: 0px; + border-radius: 0rem; } $blue-tag-background: transparentize($blue-100, 0.5); @@ -153,7 +153,7 @@ $teal-tag-background: transparentize($teal-100, 0.5); .folderCard { border-radius: 0.5rem; transition: transform 0.2s, box-shadow 0.2s; - border: 1px solid $gray-200; + border: 0.0625rem solid $gray-200; background-color: $white; margin-top: 0.67rem; } diff --git a/src/components/pages/ModuleList/index.tsx b/src/components/pages/ModuleList/index.tsx index 58f59c6bd54ccdbe445b74ce4a71ad918f71e452..dcb261a1d37d9c81b198d8eed84df414602d5469 100644 --- a/src/components/pages/ModuleList/index.tsx +++ b/src/components/pages/ModuleList/index.tsx @@ -17,10 +17,12 @@ import ModuleCard, { Term, ProgressStatus } from "components/atoms/ModuleCard"; import Dandruff from "components/molecules/Dandruff"; export interface ModuleListProps { - modulesFilter: String; + modulesFilter: String; } -const ModuleList: React.FC<ModuleListProps> = ({modulesFilter}: ModuleListProps) => { +const ModuleList: React.FC<ModuleListProps> = ({ + modulesFilter +}: ModuleListProps) => { return ( <> <Dandruff heading="Modules" /> @@ -34,10 +36,15 @@ const ModuleList: React.FC<ModuleListProps> = ({modulesFilter}: ModuleListProps) Structures, Graphs and Algorithms, Introduction to Databases. </p> - <Row style={{marginLeft: "-10px", marginRight:"-10px"}}> - {modules.filter(({progressStatus})=> modulesFilter === "" || progressStatus === modulesFilter).map(module => ( - <ModuleCard module={module} key={module.code} /> - ))} + <Row style={{ marginLeft: "-0.625rem", marginRight: "-0.625rem" }}> + {modules + .filter( + ({ progressStatus }) => + modulesFilter === "" || progressStatus === modulesFilter + ) + .map(module => ( + <ModuleCard module={module} key={module.code} /> + ))} </Row> </> ); @@ -46,85 +53,85 @@ const ModuleList: React.FC<ModuleListProps> = ({modulesFilter}: 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: "" - } + { + 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/ModuleList/style.module.scss b/src/components/pages/ModuleList/style.module.scss index 78be428d894a8424ed8121471de5f17a006c6b55..0df877f84d5726f81c8c538576acb7aa5510b5f3 100644 --- a/src/components/pages/ModuleList/style.module.scss +++ b/src/components/pages/ModuleList/style.module.scss @@ -5,7 +5,7 @@ } .moduleParagraph { - margin-top: 1rem; + margin-top: 1rem; } @media (max-width: 62rem) { diff --git a/src/components/pages/ModuleOverview/index.tsx b/src/components/pages/ModuleOverview/index.tsx index 715154611e941b1a5293e42ba79a3a81e9b3d6e0..d7ea141efc59cdaa262faeb8100f90f5f9987513 100644 --- a/src/components/pages/ModuleOverview/index.tsx +++ b/src/components/pages/ModuleOverview/index.tsx @@ -13,57 +13,57 @@ const ModuleOverview: React.FC = () => { { title: "College Website", icon: faGlobe, - url: `https://www.imperial.ac.uk/computing/current-students/courses/${moduleCode}/`, + url: `https://www.imperial.ac.uk/computing/current-students/courses/${moduleCode}/` }, { title: "Materials Link 1", icon: faLink, - url: `https://www.doc.ic.ac.uk/~wl/teachlocal/arch/`, + url: `https://www.doc.ic.ac.uk/~wl/teachlocal/arch/` }, { title: "Materials Link 2", icon: faLink, - url: "http://wp.doc.ic.ac.uk/bkainz/teaching/co112-hardware/", - }, + url: "http://wp.doc.ic.ac.uk/bkainz/teaching/co112-hardware/" + } ]; let modules = [ { title: "Introduction to Logic", - code: "CO140", + code: "CO140" }, { title: "Discrete Mathematics", - code: "CO142", + code: "CO142" }, { title: "Introduction to Computer Systems", - code: "CO112", + code: "CO112" }, { title: "Mathematical Methods", - code: "CO145", + code: "CO145" }, { title: "Java", - code: "CO120.2", + code: "CO120.2" }, { title: "Graphs and Algorithms", - code: "CO150", + code: "CO150" }, { title: "Introduction to Computer Architecture", - code: "CO113", + code: "CO113" }, { title: "Reasoning About Programs", - code: "CO141", + code: "CO141" }, { title: "Introduction to Databases", - code: "CO130", - }, + code: "CO130" + } ]; let heading = id; for (let i in modules) { @@ -88,7 +88,7 @@ const ModuleOverview: React.FC = () => { </p> <h4 className={classNames(styles.moduleSectionHeader)}>Links</h4> - <PageButtonGroup buttons={buttons} style={{ marginTop: "1.25rem" }}/> + <PageButtonGroup buttons={buttons} style={{ marginTop: "1.25rem" }} /> </> ); }; diff --git a/src/components/pages/ModuleOverview/style.module.scss b/src/components/pages/ModuleOverview/style.module.scss index 78be428d894a8424ed8121471de5f17a006c6b55..0df877f84d5726f81c8c538576acb7aa5510b5f3 100644 --- a/src/components/pages/ModuleOverview/style.module.scss +++ b/src/components/pages/ModuleOverview/style.module.scss @@ -5,7 +5,7 @@ } .moduleParagraph { - margin-top: 1rem; + margin-top: 1rem; } @media (max-width: 62rem) { diff --git a/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx b/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx index b8d1c5e02e8e7b387652429f842fc974d46d9418..9f729ee73e8bf52f3fa8fbf3d9a674242320d6d6 100644 --- a/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx +++ b/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Resource } from "../index"; import SelectionView, { - SelectionProps, + SelectionProps } from "components/molecules/SelectionView"; import CurrentDirectoryRow from "components/molecules/CurrentDirectoryRow"; @@ -22,30 +22,30 @@ const CurrentDirectoryView: React.FC<CurrentDirectoryViewProps> = ({ onItemClick, includeInSearchResult }) => { - let filesContent: Resource[] = resources; - if (scope !== "") { - filesContent = filesContent.filter(({ folder }) => folder === scope); - } - if (searchText !== "") { - filesContent = filesContent.filter((item) => - includeInSearchResult(item, searchText.toLowerCase()) - ); - } + let filesContent: Resource[] = resources; + if (scope !== "") { + filesContent = filesContent.filter(({ folder }) => folder === scope); + } + if (searchText !== "") { + filesContent = filesContent.filter(item => + includeInSearchResult(item, searchText.toLowerCase()) + ); + } - if (scope !== "" || searchText !== "") { - return ( - <SelectionView - heading="Files" - onItemClick={onItemClick} - onDownloadClick={onDownloadClick} - selectionItems={filesContent} - render={(select: SelectionProps) => ( - <CurrentDirectoryRow select={select} /> - )} - /> - ); - } + if (scope !== "" || searchText !== "") { + return ( + <SelectionView + heading="Files" + onItemClick={onItemClick} + onDownloadClick={onDownloadClick} + selectionItems={filesContent} + render={(select: SelectionProps) => ( + <CurrentDirectoryRow select={select} /> + )} + /> + ); + } return null; }; -export default CurrentDirectoryView; \ No newline at end of file +export default CurrentDirectoryView; diff --git a/src/components/pages/ModuleResources/components/FoldersView.tsx b/src/components/pages/ModuleResources/components/FoldersView.tsx index 48455eb46769339c5a6f0c334dc2f8c1b21cfd4e..ba7ab331e49fe7c79bd18949a07b756e4cf3e34a 100644 --- a/src/components/pages/ModuleResources/components/FoldersView.tsx +++ b/src/components/pages/ModuleResources/components/FoldersView.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Folder } from "../index"; import SelectionView, { - SelectionProps, + SelectionProps } from "components/molecules/SelectionView"; import FoldersRow from "components/molecules/FoldersRow"; import { useHistory, useLocation } from "react-router-dom"; diff --git a/src/components/pages/ModuleResources/components/ListView.tsx b/src/components/pages/ModuleResources/components/ListView.tsx index f0a98efe89e41b76d481c394873480bee308f2e5..f10ed3ca7294f1135a02bd9e9922d8de2aa8bb53 100644 --- a/src/components/pages/ModuleResources/components/ListView.tsx +++ b/src/components/pages/ModuleResources/components/ListView.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Resource, Folder } from "../index"; import SelectionView, { - SelectionProps, + SelectionProps } from "components/molecules/SelectionView"; import CategoryList from "components/molecules/CategoryList"; import CategoryHeader from "components/molecules/CategoryHeader"; @@ -11,8 +11,8 @@ export interface ListViewProps { folders: Folder[]; resources: Resource[]; searchText: string; - onDownloadClick: (identifiers: number[]) => void; - onSectionDownloadClick: (title: string) => void; + onDownloadClick: (identifiers: number[]) => void; + onSectionDownloadClick: (title: string) => void; onItemClick: (identifier: number) => void; includeInSearchResult: (item: Resource, searchText: string) => boolean; } @@ -25,62 +25,70 @@ const ListView: React.FC<ListViewProps> = ({ onItemClick, includeInSearchResult }) => { - let filesContent: Resource[] = resources; - if (searchText !== "") { - filesContent = filesContent.filter((item) => - includeInSearchResult(item, searchText.toLowerCase()) - ); - } + let filesContent: Resource[] = resources; + if (searchText !== "") { + filesContent = filesContent.filter(item => + includeInSearchResult(item, searchText.toLowerCase()) + ); + } - return ( - <SelectionView + return ( + <SelectionView heading="Resources" - onItemClick={onItemClick} - onDownloadClick={onDownloadClick} - selectionItems={filesContent} - render={(select: SelectionProps) => ( - <> - {folders.map(({ title, id }) => { - let categorySelect : SelectionProps = { - selectionItems: select.selectionItems.filter(res => res.folder === title), - state: select.state, - setIsSelected: select.setIsSelected, - isAnySelected: select.isAnySelected, - handleCardClick: select.handleCardClick, - handleIconClick: select.handleIconClick, - handleMouseOver: select.handleMouseOver, - handleMouseOut: select.handleMouseOut - } + onItemClick={onItemClick} + onDownloadClick={onDownloadClick} + selectionItems={filesContent} + render={(select: SelectionProps) => ( + <> + {folders.map(({ title, id }) => { + let categorySelect: SelectionProps = { + selectionItems: select.selectionItems.filter( + res => res.folder === title + ), + state: select.state, + setIsSelected: select.setIsSelected, + isAnySelected: select.isAnySelected, + handleCardClick: select.handleCardClick, + handleIconClick: select.handleIconClick, + handleMouseOver: select.handleMouseOver, + handleMouseOut: select.handleMouseOut + }; - function isAllSelected() : boolean { - let isSelected = categorySelect.state.isSelected; - return categorySelect.selectionItems.every(item => isSelected[item.id]); - } + function isAllSelected(): boolean { + let isSelected = categorySelect.state.isSelected; + return categorySelect.selectionItems.every( + item => isSelected[item.id] + ); + } - function onSelectAllClick() { - let setValue = !isAllSelected(); - let isSelected = JSON.parse(JSON.stringify(select.state.isSelected)); - let items = categorySelect.selectionItems; - for (let item in items) { - isSelected[items[item].id] = setValue; - } - select.setIsSelected(isSelected); - } + function onSelectAllClick() { + let setValue = !isAllSelected(); + let isSelected = JSON.parse( + JSON.stringify(select.state.isSelected) + ); + let items = categorySelect.selectionItems; + for (let item in items) { + isSelected[items[item].id] = setValue; + } + select.setIsSelected(isSelected); + } - return (<div key={id}> - <CategoryHeader - heading={title} - onSelectAllClick={onSelectAllClick} - selectAllIcon={isAllSelected() ? faCheckSquare : faSquare} - checkBoxColor={select.isAnySelected() ? "#495057" : "#e9ecef"} - /> - <CategoryList select={categorySelect} /> - </div>) - })} - </> - )} - /> - ); + return ( + <div key={id}> + <CategoryHeader + heading={title} + onSelectAllClick={onSelectAllClick} + selectAllIcon={isAllSelected() ? faCheckSquare : faSquare} + checkBoxColor={select.isAnySelected() ? "#495057" : "#e9ecef"} + /> + <CategoryList select={categorySelect} /> + </div> + ); + })} + </> + )} + /> + ); }; export default ListView; diff --git a/src/components/pages/ModuleResources/components/QuickAccessView.tsx b/src/components/pages/ModuleResources/components/QuickAccessView.tsx index 856f3f9a9eb681f455594afaefb00b370d31b203..78f4de9bb7895feddb4dfc363f3179180e8bb988 100644 --- a/src/components/pages/ModuleResources/components/QuickAccessView.tsx +++ b/src/components/pages/ModuleResources/components/QuickAccessView.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Resource } from "../index"; import SelectionView, { - SelectionProps, + SelectionProps } from "components/molecules/SelectionView"; import QuickAccessRow from "components/molecules/QuickAccessRow"; @@ -18,7 +18,7 @@ const QuickAccessView: React.FC<QuickAccessViewProps> = ({ scope, searchText, onDownloadClick, - onItemClick, + onItemClick }) => { let quickAccessItems = resources.filter( ({ tags, folder }) => diff --git a/src/components/pages/ModuleResources/index.tsx b/src/components/pages/ModuleResources/index.tsx index 2dbace979319253cce94e70597c8bfcdfeb29d01..a696bc027139663743cc618b7188da14c76e795c 100644 --- a/src/components/pages/ModuleResources/index.tsx +++ b/src/components/pages/ModuleResources/index.tsx @@ -12,7 +12,7 @@ import { faFilePdf, faFileVideo, faLink, - IconDefinition, + IconDefinition } from "@fortawesome/free-solid-svg-icons"; import MyBreadcrumbs from "components/atoms/MyBreadcrumbs"; @@ -33,8 +33,8 @@ export interface Folder { export interface ResourcesProps { year: string; moduleID: string; - scope?: string; - view: string; + scope?: string; + view: string; } export interface ResourceState { @@ -86,7 +86,7 @@ class ModuleResources extends React.Component<ResourcesProps, ResourceState> { tags: resource.tags, folder: resource.category, id: resource.id, - path: resource.path, + path: resource.path } as Resource); } this.setState({ resources: resourceArr, isLoaded: true }); @@ -106,8 +106,8 @@ class ModuleResources extends React.Component<ResourcesProps, ResourceState> { // Gets the unique categories/folders that have been assigned for the resources folders(): Folder[] { - return Array.from(new Set<string>( - this.state.resources.map((res: Resource) => res.folder)) + return Array.from( + new Set<string>(this.state.resources.map((res: Resource) => res.folder)) ).map((title, id) => ({ title: title, id: id })); } @@ -129,7 +129,8 @@ class ModuleResources extends React.Component<ResourcesProps, ResourceState> { } handleFolderDownload(ids: number[]) { - let categories = this.folders().filter(folder => folder.id in ids) + let categories = this.folders() + .filter(folder => folder.id in ids) .map(folder => folder.title); if (categories.length === 1) { this.handleSectionDownload(categories[0]); @@ -235,57 +236,60 @@ class ModuleResources extends React.Component<ResourcesProps, ResourceState> { return null; } - render() { let scope = this.props.scope || ""; const view = () => { - switch(this.props.view) { - case "card": return ( - <> - <FoldersView - folders={this.folders()} - scope={scope} - searchText={this.state.searchText} - handleFolderDownload={(ids) => this.handleFolderDownload(ids)} - /> + switch (this.props.view) { + case "card": + return ( + <> + <FoldersView + folders={this.folders()} + scope={scope} + searchText={this.state.searchText} + handleFolderDownload={ids => this.handleFolderDownload(ids)} + /> - <CurrentDirectoryView - resources={this.state.resources} - scope={scope} - searchText={this.state.searchText} - onDownloadClick={(ids) => this.handleFileDownload(ids)} - onItemClick={(id) => this.handleResourceClick(id)} - includeInSearchResult={this.includeInSearchResult} - /> + <CurrentDirectoryView + resources={this.state.resources} + scope={scope} + searchText={this.state.searchText} + onDownloadClick={ids => this.handleFileDownload(ids)} + onItemClick={id => this.handleResourceClick(id)} + includeInSearchResult={this.includeInSearchResult} + /> - <QuickAccessView - resources={this.state.resources} - scope={scope} - searchText={this.state.searchText} - onDownloadClick={(ids) => this.handleFileDownload(ids)} - onItemClick={(id) => this.handleResourceClick(id)} - /> - </> - ); - case "list": return ( - <> - <ListView - folders={this.folders()} - resources={this.state.resources} - searchText={this.state.searchText} - onDownloadClick={(ids) => this.handleFileDownload(ids)} - onSectionDownloadClick={(category) => this.handleSectionDownload(category)} - onItemClick={(id) => this.handleResourceClick(id)} - includeInSearchResult={this.includeInSearchResult} - /> - </> - ); + <QuickAccessView + resources={this.state.resources} + scope={scope} + searchText={this.state.searchText} + onDownloadClick={ids => this.handleFileDownload(ids)} + onItemClick={id => this.handleResourceClick(id)} + /> + </> + ); + case "list": + return ( + <> + <ListView + folders={this.folders()} + resources={this.state.resources} + searchText={this.state.searchText} + onDownloadClick={ids => this.handleFileDownload(ids)} + onSectionDownloadClick={category => + this.handleSectionDownload(category) + } + onItemClick={id => this.handleResourceClick(id)} + includeInSearchResult={this.includeInSearchResult} + /> + </> + ); } }; return ( <> - <MyBreadcrumbs /> + <MyBreadcrumbs /> <SearchBox searchText={this.state.searchText} onSearchTextChange={text => this.setState({ searchText: text })} diff --git a/src/components/pages/SettingsModal/index.tsx b/src/components/pages/SettingsModal/index.tsx index 02201b95397f2750df39878fa189ded805c76f22..9123779c8f5548caad71b6d0f7b167dd8f9a45d6 100644 --- a/src/components/pages/SettingsModal/index.tsx +++ b/src/components/pages/SettingsModal/index.tsx @@ -11,7 +11,7 @@ interface Props { show: boolean; onHide: any; fileView: string; - onCardViewClick: (event: React.MouseEvent) => void; + onCardViewClick: (event: React.MouseEvent) => void; onListViewClick: (event: React.MouseEvent) => void; } @@ -19,8 +19,8 @@ const SettingsModal: React.FC<Props> = ({ show, onHide, fileView, - onCardViewClick, - onListViewClick, + onCardViewClick, + onListViewClick }) => { const [interfaceSize, setInterfaceSize] = useLocalStorage( "interfaceSize", @@ -49,7 +49,7 @@ const SettingsModal: React.FC<Props> = ({ <Col xs="3" sm="2"> <Form.Control value={interfaceSize} - onChange={(e) => setInterfaceSize(e.target.value)} + onChange={e => setInterfaceSize(e.target.value)} onBlur={() => (document.documentElement.style.fontSize = `${interfaceSize}%`) } diff --git a/src/components/pages/SettingsModal/style.module.scss b/src/components/pages/SettingsModal/style.module.scss index 89bd0266ca2a0231743e35a1aed0537fcbaec301..4b3d07d807809cd605c5e043cffab29d86908674 100644 --- a/src/components/pages/SettingsModal/style.module.scss +++ b/src/components/pages/SettingsModal/style.module.scss @@ -1,11 +1,10 @@ @import "assets/scss/custom"; @media (min-width: 62rem) { - .modal { - width: 50%; - height: 70%; - max-width: none!important; - max-height: none!important; - - } -} \ No newline at end of file + .modal { + width: 50%; + height: 70%; + max-width: none !important; + max-height: none !important; + } +} diff --git a/src/components/pages/SignIn/index.tsx b/src/components/pages/SignIn/index.tsx index 2820a46a030ed11cbbb2af009bb11823b2131072..5faca5fa8df4609753d020538f0d51b7f234dfd8 100644 --- a/src/components/pages/SignIn/index.tsx +++ b/src/components/pages/SignIn/index.tsx @@ -29,13 +29,25 @@ const SignIn: React.FC = () => { </Navbar> <div className={styles.centered}> - <div style={{ marginRight: "15px", marginLeft: "15px", display: "flex", flexDirection: "column", alignItems: "center" }}> + <div + style={{ + marginRight: "0.9375rem", + marginLeft: "0.9375rem", + display: "flex", + flexDirection: "column", + alignItems: "center" + }} + > <h1>Scientia</h1> - <i style={{ color: "gray"}}> - A Unified DoC EdTech Platform - </i> + <i style={{ color: "gray" }}>A Unified DoC EdTech Platform</i> </div> - <div style={{ marginRight: "15px", marginLeft: "15px", marginTop: "20px" }}> + <div + style={{ + marginRight: "0.9375rem", + marginLeft: "0.9375rem", + marginTop: "1.25rem" + }} + > <p className={styles.inputBarHeading}>Username</p> <InputGroup className="mb-3"> <FormControl @@ -49,8 +61,8 @@ const SignIn: React.FC = () => { <InputGroup className="mb-3"> <FormControl className={styles.inputBar} - placeholder="Enter your password" - type="password" + placeholder="Enter your password" + type="password" aria-label="Password" aria-describedby="basic-addon1" /> diff --git a/src/components/pages/SignIn/style.module.scss b/src/components/pages/SignIn/style.module.scss index f6b1d4522afebfe74d3ba0e5e9441874a83f3da2..985a3dc4d64e7b7c85cc6f6fad8254a6545ced2f 100644 --- a/src/components/pages/SignIn/style.module.scss +++ b/src/components/pages/SignIn/style.module.scss @@ -10,18 +10,17 @@ position: fixed; left: 50%; transform: translate(-50%, 0%); - margin-top: 75px; - max-width: 420px; + margin-top: 4.688rem; + max-width: 26.25rem; width: 90%; } - $button-background: transparentize($gray-200, 0.75); $button-border: transparentize($gray-300, 1); .inputBar { border-radius: 0.5rem; - border-width: 1px; + border-width: 0.0625rem; background-color: $button-background; border-color: $button-background; transition: 0.2s background-color; @@ -42,9 +41,9 @@ $button-border: transparentize($gray-300, 1); .inputBarHeading { color: $black; - font-size: 18px; + font-size: 1.125rem; font-weight: 500; - margin-bottom: 10px; + margin-bottom: 0.625rem; } .inputButton.focus, @@ -70,7 +69,7 @@ $button-border: transparentize($gray-300, 1); -webkit-transition: 0.2s background; -moz-transition: 0.2s background; text-align: center; - margin-top: 30px; + margin-top: 1.875rem; width: 100%; } diff --git a/src/components/pages/StandardView/index.tsx b/src/components/pages/StandardView/index.tsx index d69c8b49e3f6c922d51bad930fcb55ed17c0ab81..dbc6e9c71ca1b8910cc83847f14bae4b30783e25 100644 --- a/src/components/pages/StandardView/index.tsx +++ b/src/components/pages/StandardView/index.tsx @@ -23,18 +23,18 @@ import ExamPastPapers from "../Exams/PastPapers"; interface StandardViewProps { toggledLeft: boolean; - toggledRight: boolean; - fileView: string; - onOverlayClick: (event: React.MouseEvent<HTMLElement>) => void; - onSettingsClick: (event: React.MouseEvent) => void; + toggledRight: boolean; + fileView: string; + onOverlayClick: (event: React.MouseEvent<HTMLElement>) => void; + onSettingsClick: (event: React.MouseEvent) => void; } const StandardView: React.FC<StandardViewProps> = ({ toggledLeft, toggledRight, - onOverlayClick, - onSettingsClick, - fileView, + onOverlayClick, + onSettingsClick, + fileView }: StandardViewProps) => { const [modulesFilter, setModulesFilter] = useState("In Progress"); @@ -43,7 +43,7 @@ const StandardView: React.FC<StandardViewProps> = ({ id="wrapper" className={classNames({ toggledLeft: toggledLeft, - toggledRight: toggledRight, + toggledRight: toggledRight })} > <Switch> @@ -67,7 +67,7 @@ const StandardView: React.FC<StandardViewProps> = ({ </Route> </Switch> - <div id="sidenav-overlay" onClick={(e) => onOverlayClick(e)}></div> + <div id="sidenav-overlay" onClick={e => onOverlayClick(e)}></div> <Container className={classNames("pageContainer")}> <Switch> <Route path="/dashboard"> @@ -84,12 +84,12 @@ const StandardView: React.FC<StandardViewProps> = ({ <Route path="/modules/:id/resources/:scope?" - render={(props) => ( + render={props => ( <ModuleResources year="2021" moduleID={props.match.params.id} - scope={props.match.params.scope} - view={fileView} + scope={props.match.params.scope} + view={fileView} /> )} /> @@ -104,25 +104,25 @@ const StandardView: React.FC<StandardViewProps> = ({ <Exams /> </Route> - <Route path="/exams/timetable"> + <Route path="/exams/timetable"> <ExamTimetable /> </Route> - <Route path="/exams/grading"> + <Route path="/exams/grading"> <ExamGrading /> </Route> - <Route path="/exams/rubrics"> + <Route path="/exams/rubrics"> <ExamRubrics /> </Route> - <Route path="/exams/papers"> + <Route path="/exams/papers"> <ExamPastPapers /> </Route> <Route path="/modules/:id" - render={(props) => ( + render={props => ( <Redirect to={`/modules/${props.match.params.id}/overview`} /> )} /> diff --git a/src/components/pages/StandardView/style.scss b/src/components/pages/StandardView/style.scss index 038f122d7108543f227117e408c6ef725b964590..03b3228dc1cd722ad2f21c609181ff7cb5eee375 100644 --- a/src/components/pages/StandardView/style.scss +++ b/src/components/pages/StandardView/style.scss @@ -44,8 +44,7 @@ #wrapper.toggledLeft #sidenav-overlay { visibility: visible; background-color: rgba(0, 0, 0, 0.3); - } - + } } .pageContainer {