Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2016 01:51
Show Gist options
  • Save anonymous/1820f97b5c6e272eec1728b4cf7c15a7 to your computer and use it in GitHub Desktop.
Save anonymous/1820f97b5c6e272eec1728b4cf7c15a7 to your computer and use it in GitHub Desktop.
class SecondarySelections extends React.Component {
constructor(props) {
super(props);
this.state = {
message: null
};
}
updateMessage() {
if (this.props.auxiliaryVerbs['passiveVoiceRequestedAndUnavailable'] == true) {
this.setState({
message: "Passive voice is not available in this verb tense"
});
} else if ((this.props.subjectiveOrAuxiliarySelected == true) && (this.props.objectiveSelected == false)) {
this.setState({
message: "Subjective or auxiliary is selected"
});
} else if ((this.props.objectiveSelected == true) && (this.props.objectiveSelected == false)) {
this.setState({
message: "Objective is selected"
});
} else if ((this.props.subjectiveOrAuxiliarySelected == false) && (this.props.objectiveSelected == false)) {
this.setState({
message: "Neither is selected"
});
}
}
render() {
return (
<div>
{this.props.voiceSelected != null &&
<div>
{this.state.message}
</div>
}
</div>
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment