1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/component/user/user-component.jsx

49 lines
1.3 KiB
React
Raw Normal View History

import React, { PropTypes } from 'react';
import Dialog from 'react-toolbox/lib/dialog';
import Input from 'react-toolbox/lib/input';
class ErrorComponent extends React.Component {
static propTypes () {
return {
user: PropTypes.object.isRequired,
updateUserName: PropTypes.func.isRequired,
};
}
handleSubmit = (evt) => {
evt.preventDefault();
this.props.save();
}
render () {
const actions = [
{ label: 'Save', onClick: this.props.save },
];
return (
<Dialog
active={this.props.user.showDialog}
title="Action required"
actions={actions}
>
<p>
You hav to specify a username to use Unleash. This will allow us to track changes.
</p>
<form onSubmit={this.handleSubmit}>
<Input
type="text"
label="USERNAME"
name="username"
required
value={this.props.user.userName}
onChange={(v) => this.props.updateUserName(v)}
/>
</form>
</Dialog>
);
}
}
export default ErrorComponent;