adjust spacing of org add/edit form, add CardCloseButton

This commit is contained in:
Keith Grant
2019-05-02 08:34:09 -04:00
parent 1be496cfc1
commit 1490235752
7 changed files with 84 additions and 46 deletions

View File

@@ -0,0 +1,49 @@
import React from 'react';
import { string } from 'prop-types';
import { Link } from 'react-router-dom';
import { Button } from '@patternfly/react-core';
import { TimesIcon } from '@patternfly/react-icons';
import { I18n } from '@lingui/react';
import { t } from '@lingui/macro';
function CardCloseButton ({ linkTo, ...props }) {
if (linkTo) {
return (
<I18n>
{({ i18n }) => (
<Link
className="pf-c-button pf-c-card__close"
aria-label={i18n._(t`Close`)}
title={i18n._(t`Close`)}
to={linkTo}
{...props}
>
<TimesIcon />
</Link>
)}
</I18n>
);
}
return (
<I18n>
{({ i18n }) => (
<Button
variant="plain"
className="pf-c-card__close"
aria-label={i18n._(t`Close`)}
{...props}
>
<TimesIcon />
</Button>
)}
</I18n>
);
}
CardCloseButton.propTypes = {
linkTo: string,
};
CardCloseButton.defaultProps = {
linkTo: null,
};
export default CardCloseButton;

View File

@@ -1,21 +1,19 @@
import React from 'react';
import PropTypes from 'prop-types';
import { I18n } from '@lingui/react';
import { t } from '@lingui/macro';
import {
ActionGroup,
Toolbar,
ToolbarGroup,
Button
} from '@patternfly/react-core';
import './styles.scss';
const formActionGroupStyle = {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-end',
marginTop: '10px'
};
const buttonGroupStyle = {

View File

@@ -0,0 +1,3 @@
import FormActionGroup from './FormActionGroup';
export default FormActionGroup;

View File

@@ -0,0 +1,3 @@
.pf-c-form__group.pf-m-action {
--pf-c-form__group--m-action--MarginTop: 0;
}