Adjust labels depending on first/other suggestions/vetoes

This commit is contained in:
Aaron Lindsay 2017-01-01 08:17:02 -05:00
parent 0400dd06b6
commit d24c324398
2 changed files with 9 additions and 3 deletions

View File

@ -102,11 +102,17 @@ module.exports = React.createClass({
render: function() { render: function() {
var attendeeList = this.getAttendeeList(); var attendeeList = this.getAttendeeList();
var buttonDisabled = this.state.attendee == null || !this.state.suggestion; var buttonDisabled = this.state.attendee == null || !this.state.suggestion;
var suggestionLabel = "Add Suggestion To:";
var byLabel = "Suggested By:"
if (Object.keys(this.props.suggestions).length > 0) {
suggestionLabel = "Veto With:";
byLabel = "Vetoed By:"
}
return ( return (
<Row> <Row>
<Col xs={4}> <Col xs={4}>
<FormGroup controlId="newsuggestionrestaurantname"> <FormGroup controlId="newsuggestionrestaurantname">
<ControlLabel>Add Suggestion/Veto To:</ControlLabel> <ControlLabel>{suggestionLabel}</ControlLabel>
<Combobox <Combobox
value={this.state.suggestion} value={this.state.suggestion}
data={this.unusedPopularSuggestions()} data={this.unusedPopularSuggestions()}
@ -118,7 +124,7 @@ module.exports = React.createClass({
<Col xs={1}></Col> <Col xs={1}></Col>
<Col xs={4}> <Col xs={4}>
<FormGroup controlId="newsuggestionby"> <FormGroup controlId="newsuggestionby">
<ControlLabel>Suggested By:</ControlLabel> <ControlLabel>{byLabel}</ControlLabel>
<Combobox <Combobox
value={this.state.attendee} value={this.state.attendee}
data={attendeeList} data={attendeeList}

View File

@ -43,7 +43,7 @@ const LoginBar = React.createClass({
<Col xs={4}></Col> <Col xs={4}></Col>
<Col xs={2}> <Col xs={2}>
<Button bsStyle="link" <Button bsStyle="link"
onClick={this.handleNewUserSubmit}>Create New User</Button> onClick={this.handleNewUserSubmit}>New User</Button>
</Col> </Col>
<Col xs={2}> <Col xs={2}>
<FormControl type="text" <FormControl type="text"