Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color-coded each schedule #91

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
18 changes: 15 additions & 3 deletions src/components/BellSchedule.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @flow

import React from 'react';

import './BellSchedule.css';
Expand Down Expand Up @@ -49,6 +47,16 @@ const BellSchedule = ({
scheduleName,
date
}: Props) => {
// choosing the background color based on schedule (A, B, C, or irregular)
const backgroundColorBellSchedule =
scheduleName.split(' ')[1] === 'A'
? '#8DE3FF'
: scheduleName.split(' ')[1] === 'B'
? '#E0DBFF'
: scheduleName.split(' ')[1] === 'C' ? '#ffddf4' : '#ff8088';
const bellBackground = {
backgroundColor: backgroundColorBellSchedule
};
return (
<div className="bell-schedule">
<Paper>
Expand All @@ -62,7 +70,11 @@ const BellSchedule = ({
>
<div>
{scheduleName !== 'none' && (
<Typography type="title" className="bell-schedule-name">
<Typography
type="title"
className="bell-schedule-name"
style={bellBackground}
>
<div
style={{
display: 'flex',
Expand Down