applies little improvements suggested in review

This commit is contained in:
tina
2018-09-14 13:22:24 +02:00
parent cc4c1e8ed6
commit 5218e72daf
5 changed files with 42 additions and 206 deletions
-2
View File
@@ -54,7 +54,6 @@ export default class CalendarView extends Component {
}
function toCalFormat(bleedingDaysSortedByDate) {
//const shadesOfRed = ['#ffbaba', '#ff7b7b', '#ff5252', '#ff0000']
return bleedingDaysSortedByDate.reduce((acc, day) => {
acc[day.date] = {
startingDay: true,
@@ -67,7 +66,6 @@ function toCalFormat(bleedingDaysSortedByDate) {
function predictionToCalFormat(predictedDays) {
if (!predictedDays.length) return {}
//const shadesOfGrey = ['#e5e5e5', '#cccccc'] // [lighter, darker]
const middleIndex = (predictedDays[0].length - 1) / 2
return predictedDays.reduce((acc, setOfDays) => {
setOfDays.reduce((accSet, day, i) => {
+2 -2
View File
@@ -71,7 +71,7 @@ export default class DayColumn extends Component {
const cycleDayNumber = getCycleDayNumber(dateString)
const shortDate = dateString.split('-').slice(1).join('-')
const cycleDayLabel = (
<Text style={label.number}>
<Text style = {label.number}>
{cycleDayNumber ? cycleDayNumber : ' '}
</Text>)
const dateLabel = (
@@ -140,7 +140,7 @@ export default class DayColumn extends Component {
{typeof symptoms.sex === 'number' &&
<View
{...styles.mucusIcon}
backgroundColor={styles.mucusIconShades[symptoms.mucus]}
backgroundColor='orange'
key='sex'
/>
}
+9 -9
View File
@@ -1,8 +1,8 @@
import config from '../../config'
import {primaryColor, shadesOfRed} from '../../styles/index'
const colorTemperatur = '#765285'
const colorTemperaturLight = '#a67fb5'
const colorTemperature = '#765285'
const colorTemperatureLight = '#a67fb5'
const dotWidth = 10
const lineWidth = 2
const colorLtl = '#feb47b'
@@ -10,22 +10,22 @@ const colorLtl = '#feb47b'
const styles = {
curve: {
borderStyle: 'solid',
borderColor: colorTemperatur,
borderColor: colorTemperature,
borderWidth: lineWidth,
},
curveExcluded: {
borderColor: colorTemperaturLight,
borderColor: colorTemperatureLight,
borderWidth: lineWidth,
borderStyle: 'dotted'
},
curveDots: {
backgroundColor: colorTemperatur,
backgroundColor: colorTemperature,
width: dotWidth,
height: dotWidth,
borderRadius: 50
},
curveDotsExcluded: {
backgroundColor: colorTemperaturLight,
backgroundColor: colorTemperatureLight,
width: dotWidth,
height: dotWidth,
borderRadius: 50
@@ -35,12 +35,12 @@ const styles = {
date: {
color: 'grey',
fontSize: 9,
fontWeight: '100'
fontWeight: '100',
},
number: {
color: primaryColor,
fontSize: 13,
textAlign: 'center'
textAlign: 'center',
}
},
rect: {
@@ -69,7 +69,7 @@ const styles = {
'#feb47b'
],
yAxis: {
width: 27,//config.columnWidth,
width: 27,
borderRightWidth: 0.5,
borderColor: 'lightgrey',
borderStyle: 'solid'
+3 -3
View File
@@ -10,9 +10,6 @@ export function makeYAxisLabels(columnHeight) {
const style = styles.yAxisLabel
return getTickPositions(columnHeight).map((y, i) => {
// this eyeballing is sadly necessary because RN does not
// support percentage values for transforms, which we'd need
// to reliably place the label vertically centered to the grid
const tick = scaleMax - i * units
const tickLabel = tick * 10 % 10 ? tick.toString() : tick.toString() + '.0'
let showTick
@@ -24,6 +21,9 @@ export function makeYAxisLabels(columnHeight) {
showTick = (tick * 10 % 5) ? false : true
tickBold = tick * 10 % 10 ? {} : {fontWeight: 'bold'}
}
// this eyeballing is sadly necessary because RN does not
// support percentage values for transforms, which we'd need
// to reliably place the label vertically centered to the grid
return (
<Text
style={[style, {top: y - 8}, tickBold]}