mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
573097c2a3
The final PR for the UI Refresh #38. - Complete UI issues caught during the Dec. 09 QA pass. - Update button and color styles, including hover and active states, to align with the mockups. - Update status labels in the hosts list and users list. The status label now includes a colored circle along with a text description. - Fixes #138.
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
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 { user } = this.props;
|
|
const { gravatarURL } = user;
|
|
const { onFormSubmit } = this;
|
|
|
|
return (
|
|
<form onSubmit={onFormSubmit} className={baseClass}>
|
|
<div className={`${baseClass}__container`}>
|
|
<img alt="Avatar" src={gravatarURL} className={`${baseClass}__avatar`} />
|
|
<p className={`${baseClass}__username`}>{user.username}</p>
|
|
<p className={`${baseClass}__subtext`}>Are you sure you want to log out?</p>
|
|
</div>
|
|
<Button
|
|
className={`${baseClass}__submit-btn`}
|
|
onClick={onFormSubmit}
|
|
type="submit"
|
|
variant="brand"
|
|
>
|
|
Logout
|
|
</Button>
|
|
</form>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default LogoutForm;
|