2016-06-18 21:53:18 +02:00
|
|
|
'use strict';
|
|
|
|
const React = require('react');
|
|
|
|
const UserStore = require('../stores/UserStore');
|
2015-02-05 13:39:00 +01:00
|
|
|
|
2016-06-18 21:53:18 +02:00
|
|
|
const User = React.createClass({
|
2015-02-05 13:39:00 +01:00
|
|
|
|
2016-07-02 11:54:50 +02:00
|
|
|
onSave () {
|
2016-06-18 21:55:46 +02:00
|
|
|
const value = this.refs.username.getDOMNode().value.trim();
|
|
|
|
UserStore.set(value);
|
|
|
|
},
|
2015-02-05 13:39:00 +01:00
|
|
|
|
2016-07-02 11:54:50 +02:00
|
|
|
render () {
|
2016-06-18 21:55:46 +02:00
|
|
|
return (
|
2015-02-05 16:22:12 +01:00
|
|
|
<div className="r-pvm">
|
2015-02-05 13:39:00 +01:00
|
|
|
<input type="text" placeholder="username"
|
|
|
|
ref="username"
|
|
|
|
defaultValue={UserStore.get()}
|
|
|
|
onBlur={this.onSave} />
|
|
|
|
</div>
|
|
|
|
);
|
2016-06-18 21:55:46 +02:00
|
|
|
},
|
2015-02-05 13:39:00 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = User;
|