change layouts of cycle-day, edit symptoms screens and home

This commit is contained in:
tina
2018-06-15 19:31:29 +02:00
parent a46eb4421b
commit 4a5afd4662
6 changed files with 228 additions and 123 deletions
+63 -39
View File
@@ -33,45 +33,69 @@ export default class Bleeding extends Component {
{label: labels[3], value: 3 },
]
return (
<View style={styles.container}>
<Text>Bleeding</Text>
<RadioForm
radio_props={bleedingRadioProps}
initial={this.state.currentValue}
formHorizontal={true}
labelHorizontal={false}
onPress={(itemValue) => {
this.setState({currentValue: itemValue})
}}
/>
<Text>Exclude</Text>
<Switch
onValueChange={(val) => {
this.setState({exclude: val})
}}
value={this.state.exclude} />
<Button
onPress={() => this.showView('dayView')}
title="Cancel">
</Button>
<Button
onPress={() => {
saveBleeding(this.cycleDay)
this.showView('dayView')
}}
title="Delete entry">
</Button>
<Button
onPress={() => {
saveBleeding(this.cycleDay, {
value: this.state.currentValue,
exclude: this.state.exclude
})
this.showView('dayView')
}}
disabled={ this.state.currentValue === -1 }
title="Save">
</Button>
<View style={{flex: 1, flexDirection: 'column', justifyContent: 'space-between', alignItems: 'flex-start'}}>
<View style={{flex: 4, flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start'}}>
<View style={{flex: 1, flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'flex-start'}}>
<View style={{flex: 1}}>
<Text style={styles.symptomDayView}>Bleeding</Text>
</View>
<View style={{flex: 1}}>
<RadioForm
radio_props={bleedingRadioProps}
initial={this.state.currentValue}
formHorizontal={true}
labelHorizontal={false}
labelStyle={styles.radioButton}
onPress={(itemValue) => {
this.setState({currentValue: itemValue})
}}
/>
</View>
</View>
<View style={{flex: 1, flexDirection: 'row', justifyContent: 'space-evenly', alignItems: 'center'}}>
<View style={{flex: 1, margin: 5}}>
<Text style={styles.symptomDayView}>Exclude</Text>
</View>
<View style={{flex: 1, margin: 5}}>
<Switch
onValueChange={(val) => {
this.setState({exclude: val})
}}
value={this.state.exclude}
/>
</View>
</View>
</View>
<View style={{flex: 1, flexDirection: 'row', justifyContent: 'space-evenly', alignItems: 'center'}}>
<View style={{flex: 1, margin: 5}}>
<Button
onPress={() => this.showView('dayView')}
title="Cancel">
</Button>
</View>
<View style={{flex: 1, margin: 5}}>
<Button
onPress={() => {
saveBleeding(this.cycleDay)
this.showView('dayView')
}}
title="Delete">
</Button>
</View>
<View style={{flex: 1, margin: 5}}>
<Button
onPress={() => {
saveBleeding(this.cycleDay, {
value: this.state.currentValue,
exclude: this.state.exclude
})
this.showView('dayView')
}}
disabled={ this.state.currentValue === -1 }
title="Save">
</Button>
</View>
</View>
</View>
)
}