From 4a5afd46620fe7b55276bdd48d421bfa01cd2781 Mon Sep 17 00:00:00 2001 From: tina Date: Fri, 15 Jun 2018 19:31:29 +0200 Subject: [PATCH 1/2] change layouts of cycle-day, edit symptoms screens and home --- bleeding.js | 102 ++++++++++++++++++++++++---------------- cycle-day-overview.js | 46 +++++++++++------- cycle-day.js | 27 +++++++---- home.js | 40 ++++++++++------ styles.js | 31 ++++++++++++- temperature.js | 105 +++++++++++++++++++++++++----------------- 6 files changed, 228 insertions(+), 123 deletions(-) diff --git a/bleeding.js b/bleeding.js index 4019e9c..3eddddf 100644 --- a/bleeding.js +++ b/bleeding.js @@ -33,45 +33,69 @@ export default class Bleeding extends Component { {label: labels[3], value: 3 }, ] return ( - - Bleeding - { - this.setState({currentValue: itemValue}) - }} - /> - Exclude - { - this.setState({exclude: val}) - }} - value={this.state.exclude} /> - - - + + + + + Bleeding + + + { + this.setState({currentValue: itemValue}) + }} + /> + + + + + Exclude + + + { + this.setState({exclude: val}) + }} + value={this.state.exclude} + /> + + + + + + + + + + + + + + ) } diff --git a/cycle-day-overview.js b/cycle-day-overview.js index ed7f164..0155f86 100644 --- a/cycle-day-overview.js +++ b/cycle-day-overview.js @@ -39,32 +39,44 @@ export default class DayView extends Component { const bleedingValue = this.cycleDay.bleeding && this.cycleDay.bleeding.value let bleedingLabel if (typeof bleedingValue === 'number') { - bleedingLabel = `Bleeding: ${labels[bleedingValue]}` - if (this.cycleDay.bleeding.exclude) bleedingLabel += " (Excluded)" + bleedingLabel = `${labels[bleedingValue]}` + if (this.cycleDay.bleeding.exclude) bleedingLabel = "( " + bleedingLabel + " )" } else { - bleedingLabel = null + bleedingLabel = 'edit' } const temperatureValue = this.cycleDay.temperature && this.cycleDay.temperature.value let temperatureLabel if (typeof temperatureValue === 'number') { - temperatureLabel = `Temperature: ${temperatureValue}` - if (this.cycleDay.temperature.exclude) temperatureLabel += " (Excluded)" + temperatureLabel = `${temperatureValue} °C` + if (this.cycleDay.temperature.exclude) temperatureLabel = "( " + temperatureLabel + " )" } else { - temperatureLabel = null + temperatureLabel = 'edit' } return ( - - {bleedingLabel} - {temperatureLabel} - - + + + + Bleeding + + + + + + + + Temperature + + + + + ) } diff --git a/cycle-day.js b/cycle-day.js index 35d8b78..4a88fc2 100644 --- a/cycle-day.js +++ b/cycle-day.js @@ -29,16 +29,23 @@ export default class Day extends Component { render() { const cycleDayNumber = getCycleDayNumber(this.cycleDay.date) return ( - - {formatDateForViewHeader(this.cycleDay.date)} - { cycleDayNumber && Cycle day {cycleDayNumber} } - { - { dayView: , - bleedingEditView: , - temperatureEditView: - }[this.state.visibleComponent] - } - + + + + {formatDateForViewHeader(this.cycleDay.date)} + + + + { cycleDayNumber && Cycle day {cycleDayNumber} } + + + { + { dayView: , + bleedingEditView: , + temperatureEditView: + }[this.state.visibleComponent] + } + ) } diff --git a/home.js b/home.js index 2d8576f..5b62fa4 100644 --- a/home.js +++ b/home.js @@ -46,20 +46,32 @@ export default class Home extends Component { render() { const navigate = this.props.navigation.navigate return ( - - {this.state.welcomeText} - - - + + + + {this.state.welcomeText} + + + + + + + + + + + + + ) } diff --git a/styles.js b/styles.js index dd1e124..1305b42 100644 --- a/styles.js +++ b/styles.js @@ -8,6 +8,33 @@ export default StyleSheet.create({ welcome: { fontSize: 20, margin: 30, - textAlign: 'center' - } + textAlign: 'center', + textAlignVertical: 'center' + }, + dateHeader: { + fontSize: 20, + fontWeight: 'bold', + margin: 30, + color: 'white', + textAlign: 'center', + textAlignVertical: 'center' + }, + cycleDayNumber: { + fontSize: 18, + margin: 20, + textAlign: 'center', + textAlignVertical: 'center' + }, + symptomDayView: { + fontSize: 20, + margin: 30, + textAlign: 'left', + textAlignVertical: 'center' + }, + radioButton: { + fontSize: 18, + margin: 5, + textAlign: 'center', + textAlignVertical: 'center' + }, }) \ No newline at end of file diff --git a/temperature.js b/temperature.js index 786248b..6b16007 100644 --- a/temperature.js +++ b/temperature.js @@ -8,6 +8,7 @@ import { } from 'react-native' import { saveTemperature, getPreviousTemperature } from './db' +import styles from './styles' export default class Temp extends Component { constructor(props) { @@ -32,47 +33,69 @@ export default class Temp extends Component { render() { const cycleDay = this.cycleDay return ( - - Temperature - { - this.setState({currentValue: val}) - }} - keyboardType='numeric' - value = {this.state.currentValue} - /> - Exclude - { - this.setState({ exclude: val }) - }} - value = { this.state.exclude } - /> - - - + + + + + Temperature (°C) + + + { + this.setState({currentValue: val}) + }} + keyboardType='numeric' + value = {this.state.currentValue} + /> + + + + + Exclude + + + { + this.setState({ exclude: val }) + }} + value = { this.state.exclude } + /> + + + + + + + + + + + + + + ) } From feb642aa92d16aecb35c568dd4002a708bd0ba9f Mon Sep 17 00:00:00 2001 From: tina Date: Mon, 18 Jun 2018 14:06:32 +0200 Subject: [PATCH 2/2] put view styles in styles.js --- bleeding.js | 22 +++++++-------- cycle-day-overview.js | 10 +++---- cycle-day.js | 8 +++--- home.js | 4 +-- styles.js | 64 +++++++++++++++++++++++++++++++++++++++++++ temperature.js | 18 ++++++------ 6 files changed, 95 insertions(+), 31 deletions(-) diff --git a/bleeding.js b/bleeding.js index 3eddddf..fcbcb50 100644 --- a/bleeding.js +++ b/bleeding.js @@ -33,9 +33,9 @@ export default class Bleeding extends Component { {label: labels[3], value: 3 }, ] return ( - - - + + + Bleeding @@ -52,11 +52,11 @@ export default class Bleeding extends Component { /> - - - Exclude + + + Exclude - + { this.setState({exclude: val}) @@ -66,14 +66,14 @@ export default class Bleeding extends Component { - - + + - + - + - + Temperature - + - + - +