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

Setup table for timeline view

parent 3f271a02
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
transition: transform 0.2s, box-shadow 0.2s; transition: transform 0.2s, box-shadow 0.2s;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
} }
.moduleCard:hover { .moduleCard:hover {
transform: scale(1.03); transform: scale(1.03);
text-decoration: none; text-decoration: none;
...@@ -20,18 +21,22 @@ ...@@ -20,18 +21,22 @@
border-width: 0rem; border-width: 0rem;
color: var(--primary-text-color); color: var(--primary-text-color);
font-weight: 500; font-weight: 500;
font-size: 1.125rem;
text-transform: uppercase; text-transform: uppercase;
text-align: right; text-align: right;
padding: 0.5rem; padding: 0.5rem;
padding-bottom: 0rem;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.moduleCard :global(.card-body) { .moduleCard :global(.card-body) {
padding: 0.5rem; padding: 0.5rem;
padding-top: 0rem;
font-size: 1rem;
color: var(--primary-text-color); color: var(--primary-text-color);
} }
.moduleCard :global(.card-title) { .moduleCard :global(.card-title) {
margin-bottom: 0; margin-bottom: 0;
} }
\ No newline at end of file
...@@ -14,21 +14,21 @@ const TermSwitcher: React.FC = () => { ...@@ -14,21 +14,21 @@ const TermSwitcher: React.FC = () => {
active={true} active={true}
variant="secondary" variant="secondary"
> >
<FontAwesomeIcon icon={faLeaf}/> <FontAwesomeIcon icon={faLeaf} fixedWidth/>
</Button> </Button>
<Button <Button
className={styles.termSwitch} className={styles.termSwitch}
active={false} active={false}
variant="secondary" variant="secondary"
> >
<FontAwesomeIcon icon={faSeedling}/> <FontAwesomeIcon icon={faSeedling} fixedWidth/>
</Button> </Button>
<Button <Button
className={styles.termSwitch} className={styles.termSwitch}
active={false} active={false}
variant="secondary" variant="secondary"
> >
<FontAwesomeIcon icon={faSun}/> <FontAwesomeIcon icon={faSun} fixedWidth/>
</Button> </Button>
</ButtonGroup> </ButtonGroup>
</> </>
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
border-width: 0px; border-width: 0px;
border-radius: 8px; border-radius: 8px;
margin-left: 20px;
justify-content: space-between; justify-content: space-between;
height: 2.25rem; height: 2.25rem;
font-size: 1.05rem; font-size: 1.05rem;
...@@ -13,6 +12,8 @@ ...@@ -13,6 +12,8 @@
transition: 0.2s background-color; transition: 0.2s background-color;
-webkit-transition: 0.2s background-color; -webkit-transition: 0.2s background-color;
-moz-transition: 0.2s background-color; -moz-transition: 0.2s background-color;
margin-bottom: 2.5rem;
} }
.termSwitch:active, .termSwitch:active,
...@@ -20,7 +21,6 @@ ...@@ -20,7 +21,6 @@
background: var(--primary-button-active) !important; background: var(--primary-button-active) !important;
color: var(--primary-button-text-active) !important; color: var(--primary-button-text-active) !important;
font-weight: 500; font-weight: 500;
text-align: left;
border-width: 0rem; border-width: 0rem;
height: 2.25rem; height: 2.25rem;
line-height: 1.375rem; line-height: 1.375rem;
......
...@@ -4,6 +4,7 @@ import styles from "./style.module.scss"; ...@@ -4,6 +4,7 @@ import styles from "./style.module.scss";
import TermSwitcher from "./components/TermSwitcher"; import TermSwitcher from "./components/TermSwitcher";
import ModuleHeading from "./components/ModuleHeading"; import ModuleHeading from "./components/ModuleHeading";
import WeekHeading from "./components/WeekHeading"; import WeekHeading from "./components/WeekHeading";
import Table from "react-bootstrap/table";
interface TimelineProps { interface TimelineProps {
initSideBar: () => void; initSideBar: () => void;
...@@ -21,15 +22,84 @@ class Timeline extends React.Component<TimelineProps, {}> { ...@@ -21,15 +22,84 @@ class Timeline extends React.Component<TimelineProps, {}> {
render() { render() {
return ( return (
<div className={styles.timelineContainer}> <>
<MyBreadcrumbs /> <div className={styles.timelineContainer}>
{/* <TermSwitcher/> */} <MyBreadcrumbs />
<ModuleHeading <div className={styles.timeline}>
moduleCode="CO112" <Table className={styles.timelineTable} bordered striped hover>
title="Introduction to Computer Systems" <thead>
/> <tr className={styles.tableRow}>
<WeekHeading /> <th className={styles.tableHeading}>
</div> <TermSwitcher />
</th>
<th className={styles.tableWeekRow}>
{[...Array(12)].map((e, i) => {
return (
<div className={styles.weekHeading}>
<WeekHeading />
</div>
);
})}
</th>
</tr>
</thead>
<tbody>
<tr>
<th className={styles.moduleHeading}>
<ModuleHeading
moduleCode="CO112"
title="Introduction to Computer Systems"
/>
</th>
<td className={styles.rowContent}>
{[...Array(12)].map((e, i) => {
return (
<div className={styles.dummy}>
some text
</div>
);
})}
</td>
</tr>
<tr>
<th className={styles.moduleHeading}>
<ModuleHeading
moduleCode="CO120.1"
title="Programming I (Haskell)"
/>
</th>
<td className={styles.rowContent}>
{[...Array(12)].map((e, i) => {
return (
<div className={styles.dummy}>
some text
</div>
);
})}
</td>
</tr>
<tr>
<th className={styles.moduleHeading}>
<ModuleHeading
moduleCode="CO120.2"
title="Programming II (Java)"
/>
</th>
<td className={styles.rowContent}>
{[...Array(12)].map((e, i) => {
return (
<div className={styles.dummy}>
some text
</div>
);
})}
</td>
</tr>
</tbody>
</Table>
</div>
</div>
</>
); );
} }
} }
......
.timelineContainer { .timelineContainer {
margin-top: 1.875rem; margin-top: 1.875rem;
margin-left: 1.875rem; margin-left: 1.875rem;
} margin-right: 1.875rem;
\ No newline at end of file }
.tableHeading {
left: 0;
top: 0;
z-index: 1;
position: -webkit-sticky; /* for Safari */
position: sticky;
background-color: var(--background-color);
}
.weekHeading:not(:last-child) {
margin-right: 0.625rem;
}
.moduleHeading {
position: -webkit-sticky; /* for Safari */
position: sticky;
left: 0;
background-color: var(--background-color);
}
.timeline {
overflow: scroll;
height: 400px;
}
.dummy {
color: var(--primary-text-color);
}
.tableWeekRow {
display: flex;
top: 0;
position: -webkit-sticky; /* for Safari */
position: sticky;
background-color: var(--background-color);
align-items: stretch;
}
.rowContent {
display: flex;
}
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