From 738a00c15b992fa7d705efd4f42dfe378cd98a83 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 17 Sep 2018 19:02:17 +0200 Subject: [PATCH] Draw NFP lines with svg --- components/chart/day-column.js | 52 +++++++++++++--------------------- components/chart/styles.js | 15 +++++----- 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/components/chart/day-column.js b/components/chart/day-column.js index 2f419a0..7f3fe5f 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 Svg,{ - G, - Rect -} from 'react-native-svg' +import Svg,{ G, Rect, Line } from 'react-native-svg' import Icon from 'react-native-vector-icons/Entypo' import styles from './styles' import config from '../../config' @@ -51,16 +48,31 @@ export default class DayColumn extends Component { const columnElements = [] if(drawLtlAt) { - const ltlLine = () columnElements.push(ltlLine) } + if (drawFhmLine) { + const x = styles.nfpLine.strokeWidth / 2 + const fhmLine = () + columnElements.push(fhmLine) + } + + if (y) { columnElements.push( ) - // we merge the colors here instead of from the stylesheet because of a RN - // bug that doesn't apply borderLeftColor otherwise - const potentialCustomStyle = { - height: columnHeight, - borderLeftColor: 'grey', - } - - if (drawFhmLine) { - potentialCustomStyle.borderLeftColor = styles.nfpLine.borderColor - potentialCustomStyle.borderLeftWidth = 3 - } - // const column = React.createElement( - // TouchableOpacity, - // { - // style: [styles.column.rect, potentialCustomStyle], - // key: this.props.index.toString(), - // onPress: () => { - // this.passDateToDayView(dateString) - // }, - // activeOpacity: 1 - // }, - // columnElements - // ) - const column = (