From d53b8029dc38379e74ffcc97785d74d6b4a33198 Mon Sep 17 00:00:00 2001 From: Julia Friesel Date: Mon, 20 Aug 2018 16:46:42 +0200 Subject: [PATCH] Make scrolling work again --- app.js | 2 +- components/cycle-day/cycle-day-overview.js | 86 ++++---- components/cycle-day/symptoms/bleeding.js | 51 ++--- components/cycle-day/symptoms/cervix.js | 105 ++++----- components/cycle-day/symptoms/desire.js | 32 +-- components/cycle-day/symptoms/mucus.js | 79 +++---- components/cycle-day/symptoms/note.js | 26 +-- components/cycle-day/symptoms/sex.js | 215 ++++++++++--------- components/cycle-day/symptoms/temperature.js | 89 ++++---- styles/index.js | 6 +- 10 files changed, 354 insertions(+), 337 deletions(-) diff --git a/app.js b/app.js index 5e4b9ba..7c2a14b 100644 --- a/app.js +++ b/app.js @@ -52,7 +52,7 @@ export default class App extends Component { Home, Calendar, CycleDay, Chart, Settings, Stats, ...symptomViews }[this.state.currentPage] return ( - + {this.state.currentPage != 'CycleDay' &&
} diff --git a/components/cycle-day/cycle-day-overview.js b/components/cycle-day/cycle-day-overview.js index 9ab3225..c165633 100644 --- a/components/cycle-day/cycle-day-overview.js +++ b/components/cycle-day/cycle-day-overview.js @@ -36,7 +36,7 @@ export default class CycleDayOverView extends Component { const targetDate = target === 'before' ? localDate.minusDays(1).toString() : localDate.plusDays(1).toString() - this.setState({cycleDay: getOrCreateCycleDay(targetDate)}) + this.setState({ cycleDay: getOrCreateCycleDay(targetDate) }) } navigate(symptom) { @@ -50,53 +50,55 @@ export default class CycleDayOverView extends Component { const getCycleDayNumber = cycleModule().getCycleDayNumber const cycleDayNumber = getCycleDayNumber(cycleDay.date) return ( - +
- - this.navigate('BleedingEditView')} - data={getLabel('bleeding', cycleDay.bleeding)} - /> - this.navigate('TemperatureEditView')} - data={getLabel('temperature', cycleDay.temperature)} - /> - this.navigate('MucusEditView')} - data={getLabel('mucus', cycleDay.mucus)} - /> - this.navigate('CervixEditView')} - data={getLabel('cervix', cycleDay.cervix)} - /> - this.navigate('NoteEditView')} - data={getLabel('note', cycleDay.note)} - /> - this.navigate('DesireEditView')} - data={getLabel('desire', cycleDay.desire)} - /> - this.navigate('SexEditView')} - data={getLabel('sex', cycleDay.sex)} - /> - {/* this is just to make the last row adhere to the grid + + + this.navigate('BleedingEditView')} + data={getLabel('bleeding', cycleDay.bleeding)} + /> + this.navigate('TemperatureEditView')} + data={getLabel('temperature', cycleDay.temperature)} + /> + this.navigate('MucusEditView')} + data={getLabel('mucus', cycleDay.mucus)} + /> + this.navigate('CervixEditView')} + data={getLabel('cervix', cycleDay.cervix)} + /> + this.navigate('NoteEditView')} + data={getLabel('note', cycleDay.note)} + /> + this.navigate('DesireEditView')} + data={getLabel('desire', cycleDay.desire)} + /> + this.navigate('SexEditView')} + data={getLabel('sex', cycleDay.sex)} + /> + {/* this is just to make the last row adhere to the grid (and) because there are no pseudo properties in RN */} - - - + + + + ) } } diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index 277c400..bd24b9e 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -2,7 +2,8 @@ import React, { Component } from 'react' import { View, Text, - Switch + Switch, + ScrollView } from 'react-native' import RadioForm from 'react-native-simple-radio-button' import styles from '../../../styles' @@ -33,30 +34,32 @@ export default class Bleeding extends Component { { label: labels[3], value: 3 }, ] return ( - - - - { - this.setState({ currentValue: itemValue }) - }} - /> + + + + + { + this.setState({ currentValue: itemValue }) + }} + /> + + + Exclude + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} + /> + - - Exclude - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - - + - - Opening - - { - this.setState({ opening: itemValue }) - }} - /> + + + + Opening + + { + this.setState({ opening: itemValue }) + }} + /> + + Firmness + + { + this.setState({ firmness: itemValue }) + }} + /> + + Position + + { + this.setState({ position: itemValue }) + }} + /> + + + Exclude + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} + /> + - Firmness - - { - this.setState({ firmness: itemValue }) - }} - /> - - Position - - { - this.setState({ position: itemValue }) - }} - /> - - - Exclude - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - - + - - - { - this.setState({ currentValue: itemValue }) - }} - /> + + + + + { + this.setState({ currentValue: itemValue }) + }} + /> + - + - - Feeling - - { - this.setState({ feeling: itemValue }) - }} - /> + + + + Feeling + + { + this.setState({ feeling: itemValue }) + }} + /> + + Texture + + { + this.setState({ texture: itemValue }) + }} + /> + + + Exclude + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} + /> + - Texture - - { - this.setState({ texture: itemValue }) - }} - /> - - - Exclude - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - - + - - { - this.setState({ currentValue: val }) - }} - value={this.state.currentValue} - /> - + + + + { + this.setState({ currentValue: val }) + }} + value={this.state.currentValue} + /> + + - - - {activityLabels.solo} - { - this.setState({ solo: val }) - }} - /> - {activityLabels.partner} - { - this.setState({ partner: val }) - }} - /> + + + + + {activityLabels.solo} + { + this.setState({ solo: val }) + }} + /> + {activityLabels.partner} + { + this.setState({ partner: val }) + }} + /> + + CONTRACEPTIVES + + + {contraceptiveLabels.condom} + + { + this.setState({ condom: val }) + }} + /> + + {contraceptiveLabels.pill} + + { + this.setState({ pill: val }) + }} + /> + + + + {contraceptiveLabels.iud} + + { + this.setState({ iud: val }) + }} + /> + + {contraceptiveLabels.patch} + + { + this.setState({ patch: val }) + }} + /> + + + + {contraceptiveLabels.ring} + + { + this.setState({ ring: val }) + }} + /> + + {contraceptiveLabels.implant} + + { + this.setState({ implant: val }) + }} + /> + + + + {contraceptiveLabels.other} + + { + this.setState({ + other: val, + focusTextArea: true + }) + }} + /> + + {this.state.other && + { + this.setState({ note: val }) + }} + /> + } - CONTRACEPTIVES - - - {contraceptiveLabels.condom} - - { - this.setState({ condom: val }) - }} - /> - - {contraceptiveLabels.pill} - - { - this.setState({ pill: val }) - }} - /> - - - - {contraceptiveLabels.iud} - - { - this.setState({ iud: val }) - }} - /> - - {contraceptiveLabels.patch} - - { - this.setState({ patch: val }) - }} - /> - - - - {contraceptiveLabels.ring} - - { - this.setState({ ring: val }) - }} - /> - - {contraceptiveLabels.implant} - - { - this.setState({ implant: val }) - }} - /> - - - - {contraceptiveLabels.other} - - { - this.setState({ - other: val, - focusTextArea: true - }) - }} - /> - - {this.state.other && - { - this.setState({ note: val }) - }} - /> - } - + - - - Temperature (°C) - { - this.setState({ currentValue: val }) + + + + + Temperature (°C) + { + this.setState({ currentValue: val }) + }} + keyboardType='numeric' + value={this.state.currentValue} + /> + + + Time + { + Keyboard.dismiss() + this.setState({ isTimePickerVisible: true }) + }} + value={this.state.time} + /> + + { + this.setState({ + time: `${jsDate.getHours()}:${jsDate.getMinutes()}`, + isTimePickerVisible: false + }) }} - keyboardType='numeric' - value={this.state.currentValue} + onCancel={() => this.setState({ isTimePickerVisible: false })} /> + + Exclude + { + this.setState({ exclude: val }) + }} + value={this.state.exclude} + /> + - - Time - { - Keyboard.dismiss() - this.setState({ isTimePickerVisible: true }) - }} - value={this.state.time} - /> - - { - this.setState({ - time: `${jsDate.getHours()}:${jsDate.getMinutes()}`, - isTimePickerVisible: false - }) - }} - onCancel={() => this.setState({ isTimePickerVisible: false })} - /> - - Exclude - { - this.setState({ exclude: val }) - }} - value={this.state.exclude} - /> - - +