Display differing shades of red depending on bleeding value

This commit is contained in:
Julia Friesel
2018-06-08 19:05:03 +02:00
parent 891b1d517d
commit 80bf63adc2
+2 -1
View File
@@ -37,9 +37,10 @@ export default class DatePickView extends Component {
}
function getBleedingDaysInCalFormat(bleedingDaysSortedByDate) {
const shadesOfRed = ['#ffbaba', '#ff7b7b', '#ff5252', '#ff0000']
return bleedingDaysSortedByDate.reduce((acc, day) => {
const dateString = day.date.toISOString().slice(0, 10)
acc[dateString] = { startingDay: true, endingDay: true, color: 'red' }
acc[dateString] = { startingDay: true, endingDay: true, color: shadesOfRed[day.bleeding.value] }
return acc
}, {})
}