Skip to content
Snippets Groups Projects
Commit 88973290 authored by Birgitta B's avatar Birgitta B Committed by birgitta410
Browse files

Only show the hints if minimum not selected

parent 971c99ad
No related branches found
No related tags found
No related merge requests found
......@@ -22,15 +22,20 @@ export function AppTextLight(props) {
}
export function ActionHint(props) {
return (
<View
style={styles.actionHintWrappingView}>
<AppText
style={[styles.actionHint, props.style]}>
{props.children}
</AppText>
</View>
)
if(props.isVisible) {
return (
<View
style={styles.actionHintWrappingView}
isVisible={false}>
<AppText
style={[styles.actionHint, props.style]}>
{props.children}
</AppText>
</View>
)
} else {
return null
}
}
export function SymptomSectionHeader(props) {
......
......@@ -36,6 +36,7 @@ export default class Cervix extends Component {
{ label: labels.position.categories[1], value: 1 },
{ label: labels.position.categories[2], value: 2 }
]
const mandatoryNotCompletedYet = typeof this.state.opening != 'number' || typeof this.state.firmness != 'number'
return (
<View style={{ flex: 1 }}>
<ScrollView style={styles.page}>
......@@ -82,7 +83,7 @@ export default class Cervix extends Component {
/>
</SymptomSection>
</ScrollView>
<ActionHint>{labels.actionHint}</ActionHint>
<ActionHint isVisible={mandatoryNotCompletedYet}>{labels.actionHint}</ActionHint>
<ActionButtonFooter
symptom='cervix'
date={this.props.date}
......@@ -95,7 +96,7 @@ export default class Cervix extends Component {
exclude: Boolean(this.state.exclude)
})
}}
saveDisabled={typeof this.state.opening != 'number' || typeof this.state.firmness != 'number'}
saveDisabled={mandatoryNotCompletedYet}
navigate={this.props.navigate}
/>
</View>
......
......@@ -34,6 +34,7 @@ export default class Mucus extends Component {
{ label: labels.texture.categories[1], value: 1 },
{ label: labels.texture.categories[2], value: 2 }
]
const mandatoryNotCompletedYet = typeof this.state.feeling != 'number' || typeof this.state.texture != 'number'
return (
<View style={{ flex: 1 }}>
<ScrollView style={styles.page}>
......@@ -70,7 +71,7 @@ export default class Mucus extends Component {
/>
</SymptomSection>
</ScrollView>
<ActionHint>{labels.actionHint}</ActionHint>
<ActionHint isVisible={mandatoryNotCompletedYet}>{labels.actionHint}</ActionHint>
<ActionButtonFooter
symptom='mucus'
date={this.props.date}
......@@ -85,7 +86,7 @@ export default class Mucus extends Component {
exclude: Boolean(this.state.exclude)
})
}}
saveDisabled={typeof this.state.feeling != 'number' || typeof this.state.texture != 'number'}
saveDisabled={mandatoryNotCompletedYet}
navigate={this.props.navigate}
/>
</View>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment