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

Update dashboard view to behave responsively

Note: The dasboard view now works on mobile devices!
parent 1c25c321
No related branches found
No related tags found
No related merge requests found
...@@ -13,11 +13,17 @@ ...@@ -13,11 +13,17 @@
} }
.noticeHeading { .noticeHeading {
font-size: 18px; font-size: 20px;
color: $black; color: $black;
font-weight: 500; font-weight: 500;
margin-bottom: 2px; margin-bottom: 4px;
line-height: 22px; line-height: 22px;
text-align: left;
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
} }
.noticeUser { .noticeUser {
...@@ -25,6 +31,13 @@ ...@@ -25,6 +31,13 @@
color: $gray-700; color: $gray-700;
line-height: 18px; line-height: 18px;
margin-bottom: 10px; margin-bottom: 10px;
margin-right: 10px;
text-align: left;
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
} }
.noticeTime { .noticeTime {
...@@ -32,10 +45,39 @@ ...@@ -32,10 +45,39 @@
color: $gray-600; color: $gray-600;
line-height: 18px; line-height: 18px;
margin-bottom: 10px; margin-bottom: 10px;
margin-left: 10px;
text-align: right;
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
} }
.noticeBody { .noticeBody {
font-size: 16px; font-size: 16px;
color: $gray-800; color: $gray-800;
margin-bottom: 0px; margin-bottom: 0px;
overflow: hidden;
position: relative;
line-height: 1.2em;
max-height: 3.6em;
padding-right: 1em;
}
.noticeBody:before {
content: '...';
position: absolute;
right: 0;
bottom: 0;
}
.noticeBody:after {
content: '';
position: absolute;
right: 0;
width: 1em;
height: 1em;
margin-top: 0.2em;
background: $gray-100;
} }
...@@ -11,11 +11,9 @@ const PersonCard: React.FC = () => { ...@@ -11,11 +11,9 @@ const PersonCard: React.FC = () => {
return ( return (
<> <>
<Container style={{ display: "flex", padding: 0 }}> <Container className={styles.userCardContainer}>
<span> <Image className={styles.userImage} src={userImage} />
<Image className={styles.userImage} src={userImage} /> <div className={styles.userInfoBlock}>
</span>
<span style={{ height: "180px" }}>
<p className={styles.userName}>{userInfo.name}</p> <p className={styles.userName}>{userInfo.name}</p>
<p className={styles.userEmail}>{userInfo.email}</p> <p className={styles.userEmail}>{userInfo.email}</p>
<p className={styles.userIdentifier}> <p className={styles.userIdentifier}>
...@@ -26,7 +24,7 @@ const PersonCard: React.FC = () => { ...@@ -26,7 +24,7 @@ const PersonCard: React.FC = () => {
<p className={styles.userYear}>{userInfo.year + ','}</p> <p className={styles.userYear}>{userInfo.year + ','}</p>
<p className={styles.userDepartment}>{userInfo.dep}</p> <p className={styles.userDepartment}>{userInfo.dep}</p>
<p className={styles.userCourse}>{userInfo.course}</p> <p className={styles.userCourse}>{userInfo.course}</p>
</span> </div>
</Container> </Container>
</> </>
); );
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
.userName { .userName {
font-weight: 600; font-weight: 600;
font-size: 24px; font-size: 24px;
color: $black; color: $black;
margin-bottom: 0rem; margin-bottom: 0rem;
line-height: 32px; line-height: 32px;
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
margin-top: 14px; margin-top: 14px;
line-height: 24px; line-height: 24px;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
} }
...@@ -61,5 +62,47 @@ ...@@ -61,5 +62,47 @@
display: inline-block; display: inline-block;
margin-right: 8px; margin-right: 8px;
margin-left: 8px; margin-left: 8px;
vertical-align: middle;
text-align: center;
background-color: $gray-500; background-color: $gray-500;
} }
@media (max-width: 62rem) {
.userCardContainer {
padding: 0;
display: flex;
justify-content: center;
flex-direction: column;
align-items: middle;
}
.userInfoBlock {
margin-top: 20px;
margin-right: auto;
margin-left: auto;
}
.userInfoBlock:not(.userIdentifier) * {
text-align: center;
}
.userImage {
margin-right: auto;
margin-left: auto;
}
.userIdentifier {
justify-content: center;
}
}
@media (min-width: 62rem) {
.userCardContainer {
display: flex;
padding: 0;
}
.userInfoBlock {
height: 180px;
}
}
...@@ -24,17 +24,16 @@ const TutorCard: React.FC<TutorCardProp> = ({ ...@@ -24,17 +24,16 @@ const TutorCard: React.FC<TutorCardProp> = ({
display: "flex", display: "flex",
padding: 0, padding: 0,
marginTop: "20px", marginTop: "20px",
alignItems: "center" alignItems: "center",
width: "100%"
}} }}
> >
<span> <Image className={styles.tutorImage} src={image} />
<Image className={styles.tutorImage} src={image} /> <div>
</span>
<span style={{ height: "72px" }}>
<p className={styles.tutorName}>{name}</p> <p className={styles.tutorName}>{name}</p>
<p className={styles.tutorEmail}>{email}</p> <p className={styles.tutorEmail}>{email}</p>
<p className={styles.tutorAddress}>{address}</p> <p className={styles.tutorAddress}>{address}</p>
</span> </div>
</Container> </Container>
</> </>
); );
......
...@@ -11,6 +11,11 @@ ...@@ -11,6 +11,11 @@
font-size: 18px; font-size: 18px;
margin-bottom: 0px; margin-bottom: 0px;
line-height: 24px !important; line-height: 24px !important;
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
} }
.tutorName { .tutorName {
......
...@@ -20,7 +20,7 @@ const DashboardButtonGroup: React.FC = () => { ...@@ -20,7 +20,7 @@ const DashboardButtonGroup: React.FC = () => {
<> <>
<Row style={{ marginTop: "45px" }}> <Row style={{ marginTop: "45px" }}>
{buttons.map(({ title, icon, url }, i) => ( {buttons.map(({ title, icon, url }, i) => (
<Col xs={6} sm={6} md={3} key={i}> <Col xs={6} sm={6} md={4} lg={4} xl={3} key={i} style={{ paddingRight: "10px", paddingLeft:"10px"}}>
<Button <Button
className={styles.dashboardButton} className={styles.dashboardButton}
href={url} href={url}
......
...@@ -6,7 +6,13 @@ const NoticeBoard: React.FC = () => { ...@@ -6,7 +6,13 @@ const NoticeBoard: React.FC = () => {
<> <>
<h4>Notice Board</h4> <h4>Notice Board</h4>
{noticeItems.map(({ heading, user, time, body }) => ( {noticeItems.map(({ heading, user, time, body }) => (
<NoticeItem key={heading} heading={heading} user={user} time={time} body={body} /> <NoticeItem
key={heading}
heading={heading}
user={user}
time={time}
body={body}
/>
))} ))}
</> </>
); );
...@@ -16,24 +22,24 @@ export default NoticeBoard; ...@@ -16,24 +22,24 @@ export default NoticeBoard;
const noticeItems = [ const noticeItems = [
{ {
heading: "Foyer Closure Information", heading: "Lab Closure Information",
user: "Konstantinos Gkotuzis", user: "Mr. Zachery Hroderich",
time: "1 Minute Ago", time: "1 Minute Ago",
body: body:
"The foyer area, along with computing lab rooms 209, 208, and 210 would be closed due to unforeseen circumstances on Friday 20th of April.", "Computing lab rooms 202, 206, and 219 would be closed for the year one haskell exams on Friday 20th of April."
}, },
{ {
heading: "Dead body found in foyer area", heading: "Exam Timetable Released",
user: "Orenthal James Simpson", user: "Prof. Leonardas Quinctius",
time: "1 hour Ago", time: "1 hour Ago",
body: body:
"Whoever left the dead body of Dr Rosalind Baker in the foyer area could you please cleanup after youself, thank you. Nobody needs to see that. ", "The Summer Exams timetable has now been re-released, to reflect the changes for online exams due to the on-going health crisis. Information regarding the schedule and remote assessment policies can be found in the exams page"
}, },
{ {
heading: "Autumn Fee Information", heading: "Pass Requirements For Year Two",
user: "Rosalind Baker", user: "Dr. Rosalind Baker",
time: "5 hours Ago", time: "5 hours Ago",
body: body:
"We understand that a lot of you would not be on campus for the autumn term, however that does not mean that you should stop paying us. Good day. ", "The exams will still be considered as exams, even though they are now online, so all stated pass requirements still apply. To pass a core module, it is 40% overall, i.e. coursework + exams combined at 15% + 85%. To pass 161, it is 50% overall; the percentage breakdown is on the website."
}, }
]; ];
...@@ -13,11 +13,11 @@ const Dashboard: React.FC = () => { ...@@ -13,11 +13,11 @@ const Dashboard: React.FC = () => {
<MyBreadcrumbs /> <MyBreadcrumbs />
<PersonCard /> <PersonCard />
<DashboardButtonGroup /> <DashboardButtonGroup />
<Row style={{ marginTop: "30px" }}> <Row>
<Col> <Col xs={12} sm={12} md={12} lg={6} style={{ marginTop: "30px", paddingRight: "10px", paddingLeft: "10px"}}>
<TutorCardGroup /> <TutorCardGroup />
</Col> </Col>
<Col> <Col xs={12} sm={12} md={12} lg={6} style={{ marginTop: "30px", paddingRight: "10px", paddingLeft: "10px"}}>
<NoticeBoard /> <NoticeBoard />
</Col> </Col>
</Row> </Row>
......
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