addresses PR Issues

This commit is contained in:
Alex Corey
2019-07-01 09:29:04 -04:00
parent c65ae87d69
commit b5b38c1b79
4 changed files with 75 additions and 47 deletions
@@ -1,9 +1,6 @@
import React, { Fragment } from 'react';
import { withRouter } from 'react-router-dom';
import { number } from 'prop-types';
import { Button, Tooltip } from '@patternfly/react-core';
import { RocketIcon } from '@patternfly/react-icons';
import styled from 'styled-components';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
@@ -11,15 +8,6 @@ import AlertModal from '@components/AlertModal';
import ErrorDetail from '@components/ErrorDetail';
import { JobTemplatesAPI } from '@api';
const StyledLaunchButton = styled(Button)`
padding: 5px 8px;
&:hover {
background-color: #0066cc;
color: white;
}
`;
class LaunchButton extends React.Component {
static propTypes = {
templateId: number.isRequired,
@@ -65,20 +53,10 @@ class LaunchButton extends React.Component {
render() {
const { launchError, promptError } = this.state;
const { i18n } = this.props;
const { i18n, children } = this.props;
return (
<Fragment>
<Tooltip content={i18n._(t`Launch Job`)} position="top">
<div>
<StyledLaunchButton
variant="plain"
aria-label={i18n._(t`Launch`)}
onClick={this.handleLaunch}
>
<RocketIcon />
</StyledLaunchButton>
</div>
</Tooltip>
{children(this.handleLaunch)}
<AlertModal
isOpen={launchError}
variant="danger"