Refactor UI, Add ability to remove suggestions

This commit is contained in:
2017-01-01 08:10:58 -05:00
parent d7adb27c10
commit 0400dd06b6
10 changed files with 222 additions and 55 deletions

View File

@ -4,6 +4,7 @@ var ReactBootstrap = require('react-bootstrap');
var Grid = ReactBootstrap.Grid;
var Row = ReactBootstrap.Row;
var Col = ReactBootstrap.Col;
var FormGroup = ReactBootstrap.FormGroup;
var ControlLabel = ReactBootstrap.ControlLabel;
var Button = ReactBootstrap.Button;
@ -102,31 +103,38 @@ module.exports = React.createClass({
var attendeeList = this.getAttendeeList();
var buttonDisabled = this.state.attendee == null || !this.state.suggestion;
return (
<Grid><Row>
<Col xs={4}>
<Combobox
value={this.state.attendee}
data={attendeeList}
valueField='AttendeeId'
textField='Name'
onChange={this.onChangeAttendee} />
</Col>
<Col xs={1}>
</Col>
<Col xs={4}>
<Combobox
value={this.state.suggestion}
data={this.unusedPopularSuggestions()}
valueField='RestaurantName'
textField='RestaurantName'
onChange={this.onChangeSuggestion} />
</Col>
<Col xs={1}>
</Col>
<Col xs={2}>
<Button bsStyle="success" disabled={buttonDisabled} onClick={this.onAddSuggestion}>Add Suggestion/Veto</Button>
</Col>
</Row></Grid>
<Row>
<Col xs={4}>
<FormGroup controlId="newsuggestionrestaurantname">
<ControlLabel>Add Suggestion/Veto To:</ControlLabel>
<Combobox
value={this.state.suggestion}
data={this.unusedPopularSuggestions()}
valueField='RestaurantName'
textField='RestaurantName'
onChange={this.onChangeSuggestion} />
</FormGroup>
</Col>
<Col xs={1}></Col>
<Col xs={4}>
<FormGroup controlId="newsuggestionby">
<ControlLabel>Suggested By:</ControlLabel>
<Combobox
value={this.state.attendee}
data={attendeeList}
valueField='AttendeeId'
textField='Name'
onChange={this.onChangeAttendee} />
</FormGroup>
</Col>
<Col xs={1}></Col>
<Col xs={2}>
<FormGroup controlId="addnewsuggestionbutton">
<ControlLabel><br /></ControlLabel>
<Button bsStyle="success" disabled={buttonDisabled} onClick={this.onAddSuggestion}>Add</Button>
</FormGroup>
</Col>
</Row>
);
}
});