// @flow // These should probably just be combined into one modal component import * as ICONS from 'constants/icons'; import * as React from 'react'; import ReactModal from 'react-modal'; import Button from 'component/button'; import classnames from 'classnames'; type ModalProps = { type: string, overlay: boolean, confirmButtonLabel: string, abortButtonLabel: string, confirmButtonDisabled: boolean, abortButtonDisabled: boolean, onConfirmed?: any => any, onAborted?: any => any, className?: string, children?: React.Node, extraContent?: React.Node, expandButtonLabel?: string, hideButtonLabel?: string, title?: string | React.Node, }; export class Modal extends React.PureComponent { static defaultProps = { type: 'alert', overlay: true, confirmButtonLabel: __('OK'), abortButtonLabel: __('Cancel'), confirmButtonDisabled: false, abortButtonDisabled: false, }; render() { const { children, type, confirmButtonLabel, confirmButtonDisabled, onConfirmed, abortButtonLabel, abortButtonDisabled, onAborted, className, title, ...modalProps } = this.props; return ( {title &&

{title}

} {type === 'card' &&