1
0
mirror of synced 2024-12-13 23:11:06 +01:00
bemaniutils/bemani/frontend/static/components/selectuser.react.js
2019-12-08 21:43:49 +00:00

28 lines
967 B
JavaScript

/** @jsx React.DOM */
var SelectUser = React.createClass({
render: function() {
return (
<select
name={this.props.name}
disabled={this.props.disabled}
value={this.props.value ? this.props.value : "__NOBODY_VALUE__"}
onChange={function(event) {
var owner = event.target.value;
if (owner == "__NOBODY_VALUE__") {
owner = null;
}
if (this.props.onChange) {
this.props.onChange(owner);
}
}.bind(this)}
>
<option className="placeholder" value="__NOBODY_VALUE__">nobody</option>
{this.props.usernames.map(function(username) {
return <option value={username}>{ username }</option>;
}.bind(this))}
</select>
);
},
});