Skip to content
Snippets Groups Projects
Commit 56572eb7 authored by Sreeram, Sudarshan's avatar Sreeram, Sudarshan :carrot:
Browse files

Update styling of the module overview page

parent 180ea162
No related branches found
No related tags found
No related merge requests found
...@@ -5,12 +5,21 @@ import styles from "./style.module.scss"; ...@@ -5,12 +5,21 @@ import styles from "./style.module.scss";
import classNames from "classnames"; import classNames from "classnames";
import { faGlobe, faLink } from "@fortawesome/free-solid-svg-icons"; import { faGlobe, faLink } from "@fortawesome/free-solid-svg-icons";
import PageButtonGroup from "components/molecules/PageButtonGroup"; import PageButtonGroup from "components/molecules/PageButtonGroup";
import { request } from "../../../utils/api"; import { request } from "../../../utils/api";
import { api, methods } from "../../../constants/routes"; import { api, methods } from "../../../constants/routes";
import ProgressBar from "react-bootstrap/ProgressBar"; import ProgressBar from "react-bootstrap/ProgressBar";
import Accordion from "react-bootstrap/Accordion"; import Accordion from "react-bootstrap/Accordion";
import Card from "react-bootstrap/Card"; import Card from "react-bootstrap/Card";
import TutorCard from "components/atoms/TutorCard";
import tutorImage1 from "assets/images/tutor-1.png";
import tutorImage2 from "assets/images/tutor-2.png";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
const ModuleOverview: React.FC = () => { const ModuleOverview: React.FC = () => {
let { id } = useParams(); let { id } = useParams();
let moduleCode = id.startsWith("CO") ? id.slice(2) : id; let moduleCode = id.startsWith("CO") ? id.slice(2) : id;
...@@ -18,8 +27,8 @@ const ModuleOverview: React.FC = () => { ...@@ -18,8 +27,8 @@ const ModuleOverview: React.FC = () => {
{ {
title: "College Website", title: "College Website",
icon: faGlobe, icon: faGlobe,
url: `https://www.imperial.ac.uk/computing/current-students/courses/${moduleCode}/`, url: `https://www.imperial.ac.uk/computing/current-students/courses/${moduleCode}/`
}, }
]; ];
let [buttons, setButtons] = useState(initialButtons); let [buttons, setButtons] = useState(initialButtons);
...@@ -27,7 +36,7 @@ const ModuleOverview: React.FC = () => { ...@@ -27,7 +36,7 @@ const ModuleOverview: React.FC = () => {
const onSuccess = (data: { json: () => Promise<any> }) => { const onSuccess = (data: { json: () => Promise<any> }) => {
let newButtons: any[] = []; let newButtons: any[] = [];
data.json().then((json) => { data.json().then(json => {
for (const key in json) { for (const key in json) {
let resource = json[key]; let resource = json[key];
if (resource.type !== "link") continue; if (resource.type !== "link") continue;
...@@ -35,10 +44,10 @@ const ModuleOverview: React.FC = () => { ...@@ -35,10 +44,10 @@ const ModuleOverview: React.FC = () => {
newButtons.push({ newButtons.push({
title: resource.title, title: resource.title,
icon: faLink, icon: faLink,
url: resource.path, url: resource.path
}); });
} }
setButtons((b) => b.concat(newButtons)); setButtons(b => b.concat(newButtons));
}); });
}; };
request( request(
...@@ -50,53 +59,89 @@ const ModuleOverview: React.FC = () => { ...@@ -50,53 +59,89 @@ const ModuleOverview: React.FC = () => {
}, },
{ {
year: "2021", year: "2021",
course: moduleCode, course: moduleCode
} }
); );
}, [moduleCode]); }, [moduleCode]);
let leaderCards = leaders.map(({ name, email, address, image }) => {
return (
<Col>
<TutorCard
key={email}
name={name}
email={email}
address={address}
image={image}
/>
</Col>
);
});
return ( return (
<> <>
<Dandruff heading={generateHeading(id)} /> <Dandruff heading={generateHeading(id)} />
<h4 className={classNames(styles.moduleSectionHeader)}>Description</h4> <h4 className={classNames(styles.moduleSectionHeader)}>Module Aims</h4>
<p> <p style={{ paddingTop: "0.75rem" }}>
Since students don't need to see the full course information everytime In this module you will have the opportunity to:
they click open a module, instead of making a copy of the college <ul>
website here in Scientia, we could add links to the relavant site below, <li>
and only fetch or generate a short description to place here. The rest Learn about language and semantics of propositional and first-order
of this page could be used for something useful like Sudar's timeline logic
idea and links to lecture's websites (which we could fetch from the </li>
links they provided in materials). <li>
Explore the user of logic for modelling rigorously human reasoning
</li>
<li>
Apply various semantic methods for proving validity of arguments and
logical equivalences
</li>
<li>
Study natural deduction and resolution for constructing correct
proofs
</li>
<li>Investigate soundness and completeness of natural deduction</li>
<li>Apply first-order logic to program specification</li>
</ul>
</p> </p>
<h4 className={classNames(styles.moduleSectionHeader)}>Links</h4> <h4 className={classNames(styles.moduleSectionHeader)}>Links</h4>
<PageButtonGroup buttons={buttons} style={{ marginTop: "1.25rem" }} /> <PageButtonGroup buttons={buttons} style={{ marginTop: "1.25rem" }} />
<h4 className={classNames(styles.moduleSectionHeader)}>Progress</h4> <h4 className={classNames(styles.moduleSectionHeader)}>Module Leaders</h4>
{/* <ProgressBar <Row>
now={60}
{leaderCards}
</Row>
<h4 className={classNames(styles.moduleSectionHeader)}>Progress</h4>
{ <ProgressBar
now={50}
className={styles.progress} className={styles.progress}
/> */} /> }
<Accordion defaultActiveKey="0" style={{ marginTop: "30px", borderRadius: ".5rem"}}> <Accordion
<Card> defaultActiveKey="0"
<Accordion.Toggle as={Card.Header} eventKey="0"> style={{ marginTop: "1.25rem", borderRadius: ".5rem" }}
Week 1 className={styles.progressAccordion}
</Accordion.Toggle> >
<Accordion.Collapse eventKey="0"> {[...Array(9)].map((e, i) => (
<Card.Body>Hello! I'm the body</Card.Body> <Card className={styles.weekCard}>
</Accordion.Collapse> <Accordion.Toggle
</Card> className={styles.weekCardHeader}
<Card> as={Card.Header}
<Accordion.Toggle as={Card.Header} eventKey="1"> eventKey={`${i}`}
Week 2 >
</Accordion.Toggle> Week {i + 1}
<Accordion.Collapse eventKey="1"> </Accordion.Toggle>
<Card.Body>Hello! I'm another body</Card.Body> <Accordion.Collapse eventKey={`${i}`}>
</Accordion.Collapse> <Card.Body className={styles.weekCardBody}>
</Card> Hello! I'm the body of week {i + 1}
</Card.Body>
</Accordion.Collapse>
</Card>
))}
</Accordion> </Accordion>
</> </>
); );
}; };
...@@ -105,40 +150,40 @@ function generateHeading(id: string) { ...@@ -105,40 +150,40 @@ function generateHeading(id: string) {
let modules = [ let modules = [
{ {
title: "Introduction to Logic", title: "Introduction to Logic",
code: "CO140", code: "CO140"
}, },
{ {
title: "Discrete Mathematics", title: "Discrete Mathematics",
code: "CO142", code: "CO142"
}, },
{ {
title: "Introduction to Computer Systems", title: "Introduction to Computer Systems",
code: "CO112", code: "CO112"
}, },
{ {
title: "Mathematical Methods", title: "Mathematical Methods",
code: "CO145", code: "CO145"
}, },
{ {
title: "Java", title: "Java",
code: "CO120.2", code: "CO120.2"
}, },
{ {
title: "Graphs and Algorithms", title: "Graphs and Algorithms",
code: "CO150", code: "CO150"
}, },
{ {
title: "Introduction to Computer Architecture", title: "Introduction to Computer Architecture",
code: "CO113", code: "CO113"
}, },
{ {
title: "Reasoning About Programs", title: "Reasoning About Programs",
code: "CO141", code: "CO141"
}, },
{ {
title: "Introduction to Databases", title: "Introduction to Databases",
code: "CO130", code: "CO130"
}, }
]; ];
let heading = id; let heading = id;
for (let i in modules) { for (let i in modules) {
...@@ -151,3 +196,23 @@ function generateHeading(id: string) { ...@@ -151,3 +196,23 @@ function generateHeading(id: string) {
} }
export default ModuleOverview; export default ModuleOverview;
const leaders: {
name: string;
email: string;
address: string;
image: string;
}[] = [
{
name: "Dr. Zahid Barr",
email: "zahid.barr@imperial.ac.uk",
address: "373, Huxley Building",
image: tutorImage1
},
{
name: "Dr. Rosalind Baker",
email: "rosalind.baker@imperial.ac.uk",
address: "590, Huxley Building",
image: tutorImage2
}
];
...@@ -8,6 +8,49 @@ ...@@ -8,6 +8,49 @@
margin-top: 1rem; margin-top: 1rem;
} }
.progress {
background-color: $gray-100;
margin-top: 1.25rem;
border-radius: 0.5rem;
height: 0.75rem;
}
:global(.progress-bar) {
background-color: $teal-500;
border-radius: 0.5rem;
}
.progressAccordion {
border-radius: 0.5rem;
}
.weekCard {
background: $white;
border-width: 0rem;
margin-bottom: 0.5rem;
transition: 0.2s transform;
border-radius: 0.5rem !important;
}
.weekCardHeader {
background: $gray-100;
transition: 0.2s background;
-webkit-transition: 0.2s background;
-moz-transition: 0.2s background;
border-radius: 0.5rem !important;
font-size: 1.125rem;
margin-bottom: 0px !important;
padding: 0.5rem 0.75rem;
border-width: 0px;
}
.weekCardHeader:hover {
background: $gray-200;
}
.weekCardBody {
border-radius: 0.5rem;
}
@media (max-width: 62rem) { @media (max-width: 62rem) {
} }
......
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