Skip to content
Snippets Groups Projects
y-axis.js 928 B
Newer Older
import React from 'react'
mashazyu's avatar
mashazyu committed
import PropTypes from 'prop-types'
import { View } from 'react-native'
import SymptomIcon from './symptom-icon'
import TickList from './tick-list'
import ChartLegend from './chart-legend'
mashazyu's avatar
mashazyu committed

import styles from './styles'

const YAxis = ({ height, symptomsToDisplay, symptomsSectionHeight }) => {
  const symptomIconHeight = symptomsSectionHeight / symptomsToDisplay.length
mashazyu's avatar
mashazyu committed
  return (
    <View>
      <View style={[styles.yAxis, {height: symptomsSectionHeight}]}>
mashazyu's avatar
mashazyu committed
        {symptomsToDisplay.map(symptom => (
          <SymptomIcon
            key={symptom}
            symptom={symptom}
            height={symptomIconHeight}
          />
        )
        )}
mashazyu's avatar
mashazyu committed
      </View>
      <TickList height={height} />
      <ChartLegend />
mashazyu's avatar
mashazyu committed
    </View>
  )
}

YAxis.propTypes = {
  height: PropTypes.number,
  symptomsToDisplay: PropTypes.array,
  symptomsSectionHeight: PropTypes.number,
}

export default YAxis