Created
December 14, 2016 01:51
-
-
Save anonymous/1820f97b5c6e272eec1728b4cf7c15a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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