Skip to content
Snippets Groups Projects
Commit 73ba0b15 authored by danieldeng2's avatar danieldeng2
Browse files

Add corner rounding and stips based on location

parent 43a63959
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,10 @@ code { ...@@ -18,7 +18,10 @@ code {
:root { :root {
--background-color: #{$white}; --background-color: #{$white};
--secondary-background-color: #{$gray-100}; --secondary-background-color: #{$gray-100};
--checker-even-color: #{$gray-100};
--checker-odd-color: #{$gray-200};
--primary-text-color: #{$black}; --primary-text-color: #{$black};
--secondary-text-color: #{$gray-700}; --secondary-text-color: #{$gray-700};
...@@ -74,7 +77,10 @@ code { ...@@ -74,7 +77,10 @@ code {
[data-theme="dark"] { [data-theme="dark"] {
--background-color: #{$gray-900}; --background-color: #{$gray-900};
--secondary-background-color: #{$gray-800}; --secondary-background-color: #{$gray-800};
--checker-even-color: #{$gray-800};
--checker-odd-color: #{$gray-700};
--primary-text-color: #{$white}; --primary-text-color: #{$white};
--secondary-text-color: #{$gray-300}; --secondary-text-color: #{$gray-300};
......
...@@ -5,6 +5,7 @@ import TermSwitcher from "./components/TermSwitcher"; ...@@ -5,6 +5,7 @@ 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 { modulesList } from "../ModuleList/list"; import { modulesList } from "../ModuleList/list";
import classNames from "classnames";
interface TimelineProps { interface TimelineProps {
initSideBar: () => void; initSideBar: () => void;
...@@ -61,26 +62,31 @@ class Timeline extends React.Component<TimelineProps, TimelineState> { ...@@ -61,26 +62,31 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
const tracks = this.state.moduleTracks[code]; const tracks = this.state.moduleTracks[code];
if (tracks) { if (tracks) {
const height = tracks.length * trackHeight; const height = tracks.length * trackHeight;
for (let j = 0; j < numWeeks; j++) { const timelineBackgroundsClass = classNames(
timelineBackgrounds.push( i % 2 === 0
<div ? styles.timelineBackgroundEven
key={code + j} : styles.timelineBackgroundOdd,
style={{ height: `${height}rem` }} i === 0 ? styles.timelineBackgroundFirst : "",
className={styles.timelineBackground} i === modulesList.length - 1 ? styles.timelineBackgroundLast : ""
> );
&nbsp;
</div>
);
}
moduleHeadings.push( moduleHeadings.push(
<div <div
key={code} key={code}
className={styles.moduleHeading} className={styles.moduleHeading}
style={{ height: `${height}rem` }} style={{ height: `${height}rem` }}
> >
<ModuleHeading moduleCode={code} title={modulesList[i].title} /> <ModuleHeading moduleCode={code} title={modulesList[i].title} />
</div> </div>
); );
for (let j = 0; j < numWeeks; j++) {
timelineBackgrounds.push(
<div
key={code + j}
style={{ height: `${height}rem` }}
className={timelineBackgroundsClass}
></div>
);
}
} }
} }
return ( return (
......
...@@ -102,7 +102,20 @@ ...@@ -102,7 +102,20 @@
padding-bottom: 0.625rem; padding-bottom: 0.625rem;
} }
.timelineBackground { .timelineBackgroundEven {
background-color: var(--primary-button); background-color: var(--checker-even-color);
border-radius: 0.5rem; }
.timelineBackgroundOdd {
background-color: var(--checker-odd-color);
}
.timelineBackgroundFirst {
border-top-left-radius: 0.5rem;
border-top-right-radius: 0.5rem;
}
.timelineBackgroundLast {
border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem;
} }
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