fleet/frontend/components/forms/LogoutForm/LogoutForm.jsx
Mike Stone e2a5502e21 Select targets (#340)
* Api client get targets

* Allow entities to parse full api response

* responsive nav style fixes

* Add disabled prop to button

* Add targets from API to target select input

* customize target rendering in input field

* call API on select target input change

* display # hosts selected

* Adds new icons to icon font

* Customize select targets input options

* Update directory structure

* restructure select targets input

* Adds hosts to labels

* Host modal styles

* ShadowBoxInput component

* TargetInfoModal for labels

* consistent entity response in api client stubs

* Fix bug removing multiple hosts in target select input

* change Button component to use css classes
2016-10-27 12:14:30 -04:00

55 lines
1.3 KiB
JavaScript

import React, { Component, PropTypes } from 'react';
import componentStyles from './styles';
import Button from '../../buttons/Button';
import userInterface from '../../../interfaces/user';
const baseClass = 'logout-form';
class LogoutForm extends Component {
static propTypes = {
onSubmit: PropTypes.func,
user: userInterface,
};
onFormSubmit = (evt) => {
evt.preventDefault();
const { onSubmit } = this.props;
return onSubmit();
}
render () {
const {
avatarStyles,
containerStyles,
formStyles,
subtextStyles,
usernameStyles,
} = componentStyles;
const { user } = this.props;
const { gravatarURL } = user;
const { onFormSubmit } = this;
return (
<form onSubmit={onFormSubmit} style={formStyles}>
<div style={containerStyles}>
<img alt="Avatar" src={gravatarURL} style={avatarStyles} />
<p style={usernameStyles}>{user.username}</p>
<p style={subtextStyles}>Are you sure you want to log out?</p>
</div>
<Button
className={`${baseClass}__submit-btn`}
onClick={onFormSubmit}
text="Logout"
type="submit"
variant="gradient"
/>
</form>
);
}
}
export default LogoutForm;