diff --git a/components/app-text.js b/components/app-text.js index aaf7098539e5a71478a01a273768f70df53b9ee4..a7892b932f62590051e6d7d1bae6a2b6ec5e077c 100644 --- a/components/app-text.js +++ b/components/app-text.js @@ -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) { diff --git a/components/cycle-day/symptoms/cervix.js b/components/cycle-day/symptoms/cervix.js index dacf31f5392739f4e43b1fdd168f7afba0e0f2cf..d0e3e07ca37c8ebbe3181bd800d3d2e811a50a94 100644 --- a/components/cycle-day/symptoms/cervix.js +++ b/components/cycle-day/symptoms/cervix.js @@ -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> diff --git a/components/cycle-day/symptoms/mucus.js b/components/cycle-day/symptoms/mucus.js index 7a6f5de011de4942b197d8cca6e58c878e82f3b6..6e2d2ce061faa9a9980467f7e6769aaecb691160 100644 --- a/components/cycle-day/symptoms/mucus.js +++ b/components/cycle-day/symptoms/mucus.js @@ -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>