Highlight weekend dates in chart

This commit is contained in:
livi
2023-10-25 21:27:14 +02:00
committed by bl00dymarie
parent 54b08c15bb
commit f304fee293
4 changed files with 49 additions and 14 deletions
+21 -3
View File
@@ -15,14 +15,31 @@ const SymptomCell = ({
symptom,
symptomValue,
isSymptomDataComplete,
isWeekend,
}) => {
const shouldDrawDot = symptomValue !== false
// Determine the background color based on isWeekend prop
const weekendBackgroundColor = isWeekend ? Colors.greyVeryLight : 'white'
const styleCell =
index !== 0
? [styles.cell, { height, width: CHART_COLUMN_WIDTH }]
: [styles.cell, { height, width: CHART_COLUMN_WIDTH }, styles.topBorder]
? [
styles.cell,
{
height,
width: CHART_COLUMN_WIDTH,
backgroundColor: weekendBackgroundColor,
},
]
: [
styles.cell,
{
height,
width: CHART_COLUMN_WIDTH,
backgroundColor: weekendBackgroundColor,
},
styles.topBorder,
]
let styleDot
if (shouldDrawDot) {
const styleSymptom = Colors.iconColors[symptom]
const symptomColor = styleSymptom.shades[symptomValue]
@@ -47,6 +64,7 @@ SymptomCell.propTypes = {
symptom: PropTypes.string,
symptomValue: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
isSymptomDataComplete: PropTypes.bool,
isWeekend: PropTypes.bool,
}
const styles = StyleSheet.create({