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

46 lines
1.5 KiB
React
Raw Normal View History

import React, { PropTypes } from 'react';
2016-12-04 11:56:41 +01:00
import { Textfield, Dialog, DialogTitle, DialogContent, DialogActions, Button } from 'react-mdl';
2016-11-25 15:37:06 +01:00
class EditUserComponent extends React.Component {
static propTypes () {
return {
user: PropTypes.object.isRequired,
updateUserName: PropTypes.func.isRequired,
};
}
handleSubmit = (evt) => {
evt.preventDefault();
this.props.save();
}
render () {
return (
2016-12-04 11:56:41 +01:00
<div>
<Dialog open={this.props.user.showDialog}>
<DialogTitle>Action required</DialogTitle>
<DialogContent>
<p>
You are logged in as:You hav to specify a username to use Unleash. This will allow us to track changes.
</p>
<form onSubmit={this.handleSubmit}>
<Textfield
label="USERNAME"
name="username"
required
value={this.props.user.userName}
onChange={(e) => this.props.updateUserName(e.target.value)}
/>
</form>
</DialogContent>
<DialogActions>
<Button onClick={this.props.save}>Save</Button>
</DialogActions>
</Dialog>
</div>
);
}
}
2016-11-25 15:37:06 +01:00
export default EditUserComponent;