Adds info button to the body as alert

This commit is contained in:
emelko
2019-05-19 12:56:08 +02:00
parent 6811b5a692
commit ff1afcb8dc
7 changed files with 249 additions and 77 deletions
+40 -12
View File
@@ -1,10 +1,18 @@
import React from 'react'
import {
ScrollView
Alert,
ScrollView,
TouchableOpacity,
View
} from 'react-native'
import styles from '../../../styles'
import FeatherIcon from 'react-native-vector-icons/Feather'
import infoLabels from '../../../i18n/en/symptom-info'
import { intensity, desire } from '../../../i18n/en/cycle-day'
import styles, { iconStyles } from '../../../styles'
import SelectTabGroup from '../select-tab-group'
import SymptomSection from './symptom-section'
import SymptomView from './symptom-view'
@@ -19,6 +27,14 @@ export default class Desire extends SymptomView {
symptomName = 'desire'
showInfoBox(){
const symptomName = 'desire'
Alert.alert(
infoLabels[symptomName].title,
infoLabels[symptomName].text
)
}
onBackButtonPress() {
if (typeof this.state.currentValue != 'number') {
this.deleteSymptomEntry()
@@ -35,16 +51,28 @@ export default class Desire extends SymptomView {
]
return (
<ScrollView style={styles.page}>
<SymptomSection
header={desire.header}
explainer={desire.explainer}
>
<SelectTabGroup
buttons={desireRadioProps}
active={this.state.currentValue}
onSelect={val => this.setState({ currentValue: val })}
/>
</SymptomSection>
<View style={{ flexDirection: 'row' }}>
<SymptomSection
header={desire.header}
explainer={desire.explainer}
>
<SelectTabGroup
buttons={desireRadioProps}
active={this.state.currentValue}
onSelect={val => this.setState({ currentValue: val })}
/>
</SymptomSection>
<View style={{ flex: 1 }}></View>
<TouchableOpacity
onPress={this.showInfoBox}
style={styles.infoButton}
>
<FeatherIcon
name="info"
style={iconStyles.symptomInfo}
/>
</TouchableOpacity>
</View>
</ScrollView>
)
}