Resolve "don't show temperature chart part of chart when temp not tracked"

This commit is contained in:
Maria Zadnepryanets
2020-03-28 13:03:51 +00:00
committed by Sofiya Tepikin
parent 620f5e77da
commit ee0b83d1ca
10 changed files with 187 additions and 94 deletions
+12 -3
View File
@@ -8,8 +8,15 @@ import ChartLegend from './chart-legend'
import styles from './styles'
const YAxis = ({ height, symptomsToDisplay, symptomsSectionHeight }) => {
const YAxis = ({
height,
symptomsToDisplay,
symptomsSectionHeight,
shouldShowTemperatureColumn,
xAxisHeight
}) => {
const symptomIconHeight = symptomsSectionHeight / symptomsToDisplay.length
return (
<View>
<View style={[styles.yAxis, {height: symptomsSectionHeight}]}>
@@ -22,8 +29,8 @@ const YAxis = ({ height, symptomsToDisplay, symptomsSectionHeight }) => {
)
)}
</View>
<TickList height={height} />
<ChartLegend />
{shouldShowTemperatureColumn && <TickList height={height} />}
<ChartLegend xAxisHeight={xAxisHeight} />
</View>
)
}
@@ -32,6 +39,8 @@ YAxis.propTypes = {
height: PropTypes.number,
symptomsToDisplay: PropTypes.array,
symptomsSectionHeight: PropTypes.number,
shouldShowTemperatureColumn: PropTypes.bool,
xAxisHeight: PropTypes.number.isRequired
}
export default YAxis