diff --git a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx index 7d8b878f47..6e7c733319 100644 --- a/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx +++ b/awx/ui_next/src/components/LaunchButton/LaunchButton.jsx @@ -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 ( - -
- - - -
-
+ {children(this.handleLaunch)} { can_start_without_user_input: true, }, }); + const children = handleLaunch => ( + )} - + {canLaunch && ( + + {handleLaunch => ( + + )} + + )}