Add close button to job detail and test

This commit is contained in:
Marliana Lara
2019-06-13 13:47:48 -04:00
parent cda5cc25b8
commit 416d30a189
3 changed files with 35 additions and 6 deletions

View File

@@ -1,7 +1,14 @@
import React, { Component } from 'react';
import { CardBody } from '@patternfly/react-core';
import { Link, withRouter } from 'react-router-dom';
import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import { CardBody, Button } from '@patternfly/react-core';
import styled from 'styled-components';
const ActionButtonWrapper = styled.div`
display: flex;
justify-content: flex-end;
`;
class JobDetail extends Component {
constructor (props) {
super(props);
@@ -9,15 +16,28 @@ class JobDetail extends Component {
render () {
const {
job
job,
i18n
} = this.props;
return (
<CardBody>
<b>{job.name}</b>
<ActionButtonWrapper>
<Button
variant='secondary'
aria-label="close"
component={Link}
to={`/jobs`}
>
{i18n._(t`Close`)}
</Button>
</ActionButtonWrapper>
</CardBody>
);
}
}
export default JobDetail;
export default withI18n()(withRouter(JobDetail));