Use less confusing values on radio buttons

This commit is contained in:
Luke Barnard 2018-03-29 17:25:06 +01:00
parent f42cdf6a4c
commit 2bc8d6d3a4

View file

@ -399,6 +399,9 @@ FeaturedRoom.contextTypes = GroupContext;
RoleUserList.contextTypes = GroupContext; RoleUserList.contextTypes = GroupContext;
FeaturedUser.contextTypes = GroupContext; FeaturedUser.contextTypes = GroupContext;
const GROUP_JOINABLE = "GROUP_JOINABLE";
const GROUP_NOT_JOINABLE = "GROUP_NOT_JOINABLE";
export default React.createClass({ export default React.createClass({
displayName: 'GroupView', displayName: 'GroupView',
@ -612,7 +615,7 @@ export default React.createClass({
_onJoinableChange: function(ev) { _onJoinableChange: function(ev) {
this.setState({ this.setState({
joinableForm: { isJoinable: ev.target.value === "true" }, joinableForm: { isJoinable: ev.target.value === GROUP_JOINABLE },
}); });
}, },
@ -949,7 +952,7 @@ export default React.createClass({
<div> <div>
<label> <label>
<input type="radio" <input type="radio"
value="false" value={GROUP_NOT_JOINABLE}
checked={!this.state.joinableForm.isJoinable} checked={!this.state.joinableForm.isJoinable}
onClick={this._onJoinableChange} onClick={this._onJoinableChange}
/> />
@ -961,7 +964,7 @@ export default React.createClass({
<div> <div>
<label> <label>
<input type="radio" <input type="radio"
value="true" value={GROUP_JOINABLE}
checked={this.state.joinableForm.isJoinable} checked={this.state.joinableForm.isJoinable}
onClick={this._onJoinableChange} onClick={this._onJoinableChange}
/> />