Replace action button footer in remaining symptom views
This commit is contained in:
@@ -7,6 +7,7 @@ import RadioForm from 'react-native-simple-radio-button'
|
||||
import styles from '../../../styles'
|
||||
import { saveSymptom } from '../../../db'
|
||||
import { intensity as labels } from '../labels/labels'
|
||||
import ActionButtonFooter from './action-button-footer'
|
||||
|
||||
export default class Desire extends Component {
|
||||
constructor(props) {
|
||||
@@ -27,32 +28,31 @@ export default class Desire extends Component {
|
||||
{ label: labels[2], value: 2 }
|
||||
]
|
||||
return (
|
||||
<View style={styles.symptomEditView}>
|
||||
<Text style={styles.symptomDayView}>Desire</Text>
|
||||
<View style={styles.radioButtonRow}>
|
||||
<RadioForm
|
||||
radio_props={desireRadioProps}
|
||||
initial={this.state.currentValue}
|
||||
formHorizontal={true}
|
||||
labelHorizontal={false}
|
||||
labelStyle={styles.radioButton}
|
||||
onPress={(itemValue) => {
|
||||
this.setState({ currentValue: itemValue })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.actionButtonRow}>
|
||||
{this.makeActionButtons(
|
||||
{
|
||||
symptom: 'desire',
|
||||
cycleDay: this.cycleDay,
|
||||
saveAction: () => {
|
||||
saveSymptom('desire', this.cycleDay, { value: this.state.currentValue })
|
||||
},
|
||||
saveDisabled: this.state.currentValue === -1
|
||||
}
|
||||
)}
|
||||
<View style={styles.menuOnBottom}>
|
||||
<View>
|
||||
<Text style={styles.symptomDayView}>Desire</Text>
|
||||
<View style={styles.radioButtonRow}>
|
||||
<RadioForm
|
||||
radio_props={desireRadioProps}
|
||||
initial={this.state.currentValue}
|
||||
formHorizontal={true}
|
||||
labelHorizontal={false}
|
||||
labelStyle={styles.radioButton}
|
||||
onPress={(itemValue) => {
|
||||
this.setState({ currentValue: itemValue })
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<ActionButtonFooter
|
||||
symptom='desire'
|
||||
cycleDay={this.cycleDay}
|
||||
saveAction={() => {
|
||||
saveSymptom('desire', this.cycleDay, { value: this.state.currentValue })
|
||||
}}
|
||||
saveDisabled={this.state.currentValue === -1}
|
||||
navigate={this.props.navigate}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user