From 03022ffa88aefa36b079599e70d7f73426531969 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 17 Sep 2018 20:24:28 +0200 Subject: [PATCH] Pass in symptoms as flat properties, not object --- components/chart/chart.js | 3 ++- components/chart/day-column.js | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/chart/chart.js b/components/chart/chart.js index 5fb03da..4ee6dd6 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -62,6 +62,7 @@ export default class CycleChart extends Component { jsDate.getDate() ).toString() }) + const chartSymptoms = [ 'bleeding', 'temperature', @@ -103,7 +104,7 @@ export default class CycleChart extends Component { return { dateString, y: temp ? normalizeToScale(temp, columnHeight) : null, - symptoms, + ...symptoms, ...getFhmAndLtlInfo(dateString, temp, columnHeight) } }) diff --git a/components/chart/day-column.js b/components/chart/day-column.js index 47c4126..0e64d88 100644 --- a/components/chart/day-column.js +++ b/components/chart/day-column.js @@ -31,7 +31,6 @@ export default class DayColumn extends Component { dateString, y, temperatureExclude, - symptoms, drawFhmLine, drawLtlAt, rightY, @@ -116,36 +115,36 @@ export default class DayColumn extends Component { > - {typeof symptoms.bleeding === 'number' && + {typeof this.props.bleeding === 'number' && } - {typeof symptoms.mucus === 'number' && + {typeof this.props.mucus === 'number' && } - {typeof symptoms.cervix === 'number' && + {typeof this.props.cervix === 'number' && 0 ? 'blue' : 'green'} + backgroundColor={this.props.cervix > 0 ? 'blue' : 'green'} key='cervix' /> } - {typeof symptoms.sex === 'number' && + {typeof this.props.sex === 'number' && - {typeof symptoms.desire === 'number' && + {typeof this.props.desire === 'number' && - {symptoms.pain && + {this.props.pain && - {symptoms.note && + {this.props.note &&