Add mood category to chart

This commit is contained in:
mashazyu
2019-01-16 08:48:36 +01:00
committed by Sofiya Tepikin
parent 56f5c92f87
commit 570d0dc608
5 changed files with 27 additions and 4 deletions
+2
View File
@@ -23,6 +23,7 @@ const symptomIcons = {
desire: <DripIcon size={16} name='drip-icon-desire' color={styles.iconShades.desire[2]}/>,
sex: <DripIcon size={16} name='drip-icon-sex' color={styles.iconShades.sex[2]}/>,
pain: <DripIcon size={16} name='drip-icon-pain' color={styles.iconShades.pain[0]}/>,
mood: <DripHomeIcon size={16} name='circle' color={styles.iconShades.mood[0]}/>,
note: <DripIcon size={16} name='drip-icon-note' color={styles.iconShades.note[0]}/>
}
@@ -62,6 +63,7 @@ export default class CycleChart extends Component {
'sex',
'desire',
'pain',
'mood',
'note'
].filter((symptomName) => {
return this.cycleDaysSortedByDate.some(cycleDay => {
+16
View File
@@ -44,6 +44,10 @@ export default class DayColumn extends Component {
// is any pain documented?
acc.pain = cycleDay.pain &&
Object.values(cycleDay.pain).some(x => x === true)
} else if (symptom === 'mood') {
// is mood documented?
acc.mood = cycleDay.mood &&
Object.values(cycleDay.mood).some(x => x === true)
}
acc[`${symptom}Exclude`] = cycleDay[symptom] && cycleDay[symptom].exclude
return acc
@@ -214,6 +218,18 @@ export default class DayColumn extends Component {
/>
</SymptomIconView>
),
mood: (
<SymptomIconView
value={this.data.mood}
symptomHeight={symptomHeight}
key='mood'
>
<View
{...styles.symptomIcon}
backgroundColor={styles.iconShades.mood}
/>
</SymptomIconView>
),
note: (
<SymptomIconView
value={this.data.note}
+1
View File
@@ -77,6 +77,7 @@ const styles = {
'#9e346c',
],
'pain': ['#bccd67'],
'mood': ['#BC6642'],
'note': ['#6CA299']
},
yAxis: {