1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/packages/unleash-frontend/public/js/components/User.jsx

25 lines
521 B
React
Raw Normal View History

2016-06-18 21:53:18 +02:00
'use strict';
const React = require('react');
const UserStore = require('../stores/UserStore');
2016-06-18 21:53:18 +02:00
const User = React.createClass({
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);
},
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">
<input type="text" placeholder="username"
ref="username"
defaultValue={UserStore.get()}
onBlur={this.onSave} />
</div>
);
2016-06-18 21:55:46 +02:00
},
});
module.exports = User;