Make scrolling work again
This commit is contained in:
@@ -3,7 +3,8 @@ import {
|
||||
CheckBox,
|
||||
Text,
|
||||
TextInput,
|
||||
View
|
||||
View,
|
||||
ScrollView
|
||||
} from 'react-native'
|
||||
import styles from '../../../styles'
|
||||
import { saveSymptom } from '../../../db'
|
||||
@@ -18,7 +19,7 @@ export default class Sex extends Component {
|
||||
super(props)
|
||||
this.cycleDay = props.cycleDay
|
||||
this.state = {}
|
||||
if (this.cycleDay.sex !== null ) {
|
||||
if (this.cycleDay.sex !== null) {
|
||||
Object.assign(this.state, this.cycleDay.sex)
|
||||
// We make sure other is always true when there is a note,
|
||||
// e.g. when import is messed up.
|
||||
@@ -31,111 +32,113 @@ export default class Sex extends Component {
|
||||
render() {
|
||||
|
||||
return (
|
||||
<View style={styles.menuOnBottom}>
|
||||
<View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>{activityLabels.solo}</Text>
|
||||
<CheckBox
|
||||
value={this.state.solo}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ solo: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>{activityLabels.partner}</Text>
|
||||
<CheckBox
|
||||
value={this.state.partner}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ partner: val })
|
||||
}}
|
||||
/>
|
||||
<View style={{ flex: 1 }}>
|
||||
<ScrollView>
|
||||
<View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>{activityLabels.solo}</Text>
|
||||
<CheckBox
|
||||
value={this.state.solo}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ solo: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>{activityLabels.partner}</Text>
|
||||
<CheckBox
|
||||
value={this.state.partner}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ partner: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<Text style={styles.symptomDayView}>CONTRACEPTIVES</Text>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.condom}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.condom}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ condom: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.pill}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.pill}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ pill: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.iud}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.iud}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ iud: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.patch}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.patch}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ patch: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.ring}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.ring}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ ring: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.implant}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.implant}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ implant: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.other}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.other}
|
||||
onValueChange={(val) => {
|
||||
this.setState({
|
||||
other: val,
|
||||
focusTextArea: true
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
{this.state.other &&
|
||||
<TextInput
|
||||
autoFocus={this.state.focusTextArea}
|
||||
multiline={true}
|
||||
placeholder="Enter"
|
||||
value={this.state.note}
|
||||
onChangeText={(val) => {
|
||||
this.setState({ note: val })
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
<Text style={styles.symptomDayView}>CONTRACEPTIVES</Text>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.condom}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.condom}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ condom: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.pill}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.pill}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ pill: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.iud}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.iud}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ iud: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.patch}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.patch}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ patch: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.ring}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.ring}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ ring: val })
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.implant}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.implant}
|
||||
onValueChange={(val) => {
|
||||
this.setState({ implant: val })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{contraceptiveLabels.other}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.other}
|
||||
onValueChange={(val) => {
|
||||
this.setState({
|
||||
other: val,
|
||||
focusTextArea: true
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
{this.state.other &&
|
||||
<TextInput
|
||||
autoFocus={this.state.focusTextArea}
|
||||
multiline={true}
|
||||
placeholder="Enter"
|
||||
value={this.state.note}
|
||||
onChangeText={(val) => {
|
||||
this.setState({ note: val })
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
<ActionButtonFooter
|
||||
symptom='sex'
|
||||
cycleDay={this.cycleDay}
|
||||
|
||||
Reference in New Issue
Block a user