mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 03:00:04 -03:30
update App.jsx and improve coverage
abstract LogoutButton to component
This commit is contained in:
26
src/components/LogoutButton.jsx
Normal file
26
src/components/LogoutButton.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
Button,
|
||||
ButtonVariant
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
import { UserIcon } from '@patternfly/react-icons';
|
||||
|
||||
const LogoutButton = ({ onDevLogout }) => (
|
||||
<Button
|
||||
id="button-logout"
|
||||
aria-label="Logout"
|
||||
variant={ButtonVariant.plain}
|
||||
onClick={onDevLogout}
|
||||
onKeyDown={event => {
|
||||
if (event.keyCode === 13) {
|
||||
onDevLogout();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<UserIcon />
|
||||
</Button>
|
||||
);
|
||||
|
||||
export default LogoutButton;
|
||||
Reference in New Issue
Block a user