diff --git a/components/chart/chart.js b/components/chart/chart.js index 8f8a3f5..61c5d91 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -32,7 +32,6 @@ export default class CycleChart extends Component { navigate={this.props.navigate} symptomHeight={this.symptomHeight} columnHeight={this.columnHeight} - chartHeight={this.state.chartHeight} symptomRowSymptoms={this.symptomRowSymptoms} chartSymptoms={this.chartSymptoms} getFhmAndLtlInfo={this.getFhmAndLtlInfo} diff --git a/components/chart/day-column.js b/components/chart/day-column.js index e814b04..00fb6cf 100644 --- a/components/chart/day-column.js +++ b/components/chart/day-column.js @@ -2,10 +2,7 @@ import React, { Component } from 'react' import { Text, View, TouchableOpacity } from 'react-native' -import { - Surface, - Path -} from 'react-native/Libraries/ART/ReactNativeART' +import { Surface } from 'react-native/Libraries/ART/ReactNativeART' import { connect } from 'react-redux' import { setDate } from '../../slices/date' @@ -17,9 +14,8 @@ import config from '../../config' import cycleModule from '../../lib/cycle' import { getCycleDay } from '../../db' -import DotAndLine from './dot-and-line' import SymptomCell from './symptom-cell' -import ChartLine from './chart-line' +import TemperatureColumn from './temperature-column' import { normalizeToScale } from '../helpers/chart' @@ -142,57 +138,11 @@ class DayColumn extends Component { } render() { - const columnElements = [] const { dateString, symptomRowSymptoms, - chartHeight, columnHeight, xAxisHeight } = this.props - if(this.fhmAndLtl.drawLtlAt) { - const ltlLine = () - columnElements.push(ltlLine) - } - - if (this.fhmAndLtl.drawFhmLine) { - const x = styles.nfpLine.strokeWidth / 2 - const fhmLine = () - columnElements.push(fhmLine) - } - - if (this.data && this.data.temperature && this.data.temperature.y) { - const { temperatureExclude, - y, - rightY, - leftY, - rightTemperatureExclude, - leftTemperatureExclude - } = this.data.temperature - - columnElements.push( - - ) - } - const cycleDayNumber = cycleModule().getCycleDayNumber(dateString) const dayDate = LocalDate.parse(dateString) const shortDate = dayDate.dayOfMonth() === 1 ? @@ -233,10 +183,12 @@ class DayColumn extends Component { )} - - { columnElements } diff --git a/components/chart/temperature-column.js b/components/chart/temperature-column.js new file mode 100644 index 0000000..5bf3f49 --- /dev/null +++ b/components/chart/temperature-column.js @@ -0,0 +1,63 @@ +import React from 'react' +import PropTypes from 'prop-types' + +import { Group, Path } from 'react-native/Libraries/ART/ReactNativeART' + +import ChartLine from './chart-line' +import DotAndLine from './dot-and-line' + +import styles from './styles' +import config from '../../config' + +const TemperatureColumn = ({ + horizontalLinePosition, + isVerticalLine, + data, + columnHeight +}) => { + + const x = styles.nfpLine.strokeWidth / 2 + + return ( + + + + + {horizontalLinePosition && } + + {isVerticalLine && } + + {data && data.y && } + + ) +} + +TemperatureColumn.propTypes = { + horizontalLinePosition: PropTypes.number, + isVerticalLine: PropTypes.bool, + data: PropTypes.object, + columnHeight: PropTypes.number, +} + +export default TemperatureColumn