Merge branch '345-move-info-button-out-of-header-to-body' into marie-move-info-button-out-of-header-to-body

This commit is contained in:
Julia Friesel
2019-05-19 17:53:14 +02:00
26 changed files with 481 additions and 397 deletions
+12 -38
View File
@@ -1,16 +1,10 @@
import React from 'react'
import {
Alert,
Switch,
ScrollView,
TouchableOpacity,
View
} from 'react-native'
import FeatherIcon from 'react-native-vector-icons/Feather'
ScrollView} from 'react-native'
import { cervix as labels } from '../../../i18n/en/cycle-day'
import infoLabels from '../../../i18n/en/symptom-info'
import styles, { iconStyles } from '../../../styles'
import styles from '../../../styles'
import SelectTabGroup from '../select-tab-group'
@@ -27,14 +21,6 @@ export default class Cervix extends SymptomView {
symptomName = 'cervix'
showInfoBox(){
const symptomName = 'cervix'
Alert.alert(
infoLabels[symptomName].title,
infoLabels[symptomName].text
)
}
onBackButtonPress() {
const nothingEntered = ['opening', 'firmness', 'position'].every(val => typeof this.state[val] != 'number')
if (nothingEntered) {
@@ -69,28 +55,16 @@ export default class Cervix extends SymptomView {
// const mandatoryNotCompleted = typeof this.state.opening != 'number' || typeof this.state.firmness != 'number'
return (
<ScrollView style={styles.page}>
<View style={{ flexDirection: 'row' }}>
<SymptomSection
header="Opening"
explainer={labels.opening.explainer}
>
<SelectTabGroup
buttons={cervixOpeningRadioProps}
active={this.state.opening}
onSelect={val => this.setState({ opening: val })}
/>
</SymptomSection>
<View style={{ flex: 1 }}></View>
<TouchableOpacity
onPress={this.showInfoBox}
style={styles.infoButton}
>
<FeatherIcon
name="info"
style={iconStyles.symptomInfo}
/>
</TouchableOpacity>
</View>
<SymptomSection
header="Opening"
explainer={labels.opening.explainer}
>
<SelectTabGroup
buttons={cervixOpeningRadioProps}
active={this.state.opening}
onSelect={val => this.setState({ opening: val })}
/>
</SymptomSection>
<SymptomSection
header="Firmness"
explainer={labels.firmness.explainer}