Merge branch '156-make-components-like-prettier-radio-buttons' into 'master'

Resolve "make components like prettier radio buttons"

Closes #156

See merge request bloodyhealth/drip!68
This commit is contained in:
Julia Friesel
2018-09-03 16:45:51 +00:00
21 changed files with 2108 additions and 1983 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { View, FlatList, Text } from 'react-native'
import { View, FlatList } from 'react-native'
import range from 'date-range'
import { LocalDate } from 'js-joda'
import { makeYAxisLabels, normalizeToScale, makeHorizontalGrid } from './y-axis'
@@ -9,6 +9,7 @@ import { getCycleDay, cycleDaysSortedByDate, getAmountOfCycleDays } from '../../
import styles from './styles'
import { scaleObservable } from '../../local-storage'
import config from '../../config'
import { AppText } from '../app-text'
export default class CycleChart extends Component {
constructor(props) {
@@ -100,7 +101,7 @@ export default class CycleChart extends Component {
>
{!this.state.chartLoaded &&
<View style={{width: '100%', justifyContent: 'center', alignItems: 'center'}}>
<Text>Loading...</Text>
<AppText>Loading...</AppText>
</View>
}
+4 -3
View File
@@ -1,8 +1,9 @@
import React from 'react'
import { Text, View } from 'react-native'
import { View } from 'react-native'
import config from '../../config'
import styles from './styles'
import { scaleObservable } from '../../local-storage'
import { AppText } from '../app-text'
export function makeYAxisLabels(columnHeight) {
const units = config.temperatureScale.units
@@ -15,11 +16,11 @@ export function makeYAxisLabels(columnHeight) {
// to reliably place the label vertically centered to the grid
if (scaleMax - i * units === 37) console.log(y)
return (
<Text
<AppText
style={[style, {top: y - 8}]}
key={i}>
{scaleMax - i * units}
</Text>
</AppText>
)
})
}