-
-
Save travisdmathis/39b5925d4187a43184722128e048d73f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ? | |
<div> | |
{this.state.message} | |
</div> | |
: | |
null | |
} | |
</div> | |
); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment