[WIP] Adds info button to body as alert for:
* mood, pain, temperature
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
import React from 'react'
|
||||
import {
|
||||
Alert,
|
||||
ScrollView,
|
||||
TextInput,
|
||||
TouchableOpacity,
|
||||
View
|
||||
} from 'react-native'
|
||||
import FeatherIcon from 'react-native-vector-icons/Feather'
|
||||
|
||||
import infoLabels from '../../../i18n/en/symptom-info'
|
||||
import { pain as labels } from '../../../i18n/en/cycle-day'
|
||||
import { shared as sharedLabels } from '../../../i18n/en/labels'
|
||||
import styles, { iconStyles } from '../../../styles'
|
||||
|
||||
import SelectBoxGroup from '../select-box-group'
|
||||
|
||||
import SymptomSection from './symptom-section'
|
||||
import styles from '../../../styles'
|
||||
import SymptomView from './symptom-view'
|
||||
|
||||
export default class Pain extends SymptomView {
|
||||
@@ -26,6 +34,14 @@ export default class Pain extends SymptomView {
|
||||
|
||||
symptomName = 'pain'
|
||||
|
||||
showInfoBox(){
|
||||
const symptomName = 'pain'
|
||||
Alert.alert(
|
||||
infoLabels[symptomName].title,
|
||||
infoLabels[symptomName].text
|
||||
)
|
||||
}
|
||||
|
||||
onBackButtonPress() {
|
||||
const nothingEntered = Object.values(this.state).every(val => !val)
|
||||
if (nothingEntered) {
|
||||
@@ -51,15 +67,25 @@ export default class Pain extends SymptomView {
|
||||
renderContent() {
|
||||
return (
|
||||
<ScrollView style={styles.page}>
|
||||
<SymptomSection
|
||||
explainer={labels.explainer}
|
||||
>
|
||||
<SelectBoxGroup
|
||||
labels={labels.categories}
|
||||
onSelect={this.toggleState}
|
||||
optionsState={this.state}
|
||||
/>
|
||||
{ this.state.other &&
|
||||
<View style={{ flexDirection: 'row' }}>
|
||||
<SymptomSection
|
||||
explainer={labels.explainer}
|
||||
>
|
||||
<TouchableOpacity
|
||||
onPress={this.showInfoBox}
|
||||
style={styles.infoButton}
|
||||
>
|
||||
<FeatherIcon
|
||||
name="info"
|
||||
style={iconStyles.symptomInfo}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
<SelectBoxGroup
|
||||
labels={labels.categories}
|
||||
onSelect={this.toggleState}
|
||||
optionsState={this.state}
|
||||
/>
|
||||
{ this.state.other &&
|
||||
<TextInput
|
||||
autoFocus={this.state.focusTextArea}
|
||||
multiline={true}
|
||||
@@ -69,8 +95,9 @@ export default class Pain extends SymptomView {
|
||||
this.setState({note: val})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</SymptomSection>
|
||||
}
|
||||
</SymptomSection>
|
||||
</View>
|
||||
</ScrollView>)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user