File size: 819 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import React from 'react';
import { ModalBody, Header, ModalContent, Title, CloseButton } from './styles';
/*
ModalContainer is included around all modal components in order to have a
consistent wrapper and consistent close-button behavior. Otherwise it will
accept any arbitrary content via `props.children`
*/
const ModalContainer = ({
closeModal,
children,
title,
noHeader,
dataCy,
}: {
closeModal: Function,
children?: Object,
title: string,
dataCy?: string,
}): React$Element<any> => {
return (
<ModalBody data-cy={dataCy}>
<Header noHeader={noHeader}>
<Title>{title}</Title>
<CloseButton onClick={() => closeModal()} glyph="view-close" />
</Header>
<ModalContent>{children}</ModalContent>
</ModalBody>
);
};
export default ModalContainer;
|