// @flow import React from 'react'; import { Modal } from 'modal/modal'; import { DOMAIN } from 'config'; type Props = { upload: WebFile => void, file: WebFile, closeModal: () => void, updatePublishForm: ({}) => void, }; class ModalConfirmThumbnailUpload extends React.PureComponent { upload() { const { upload, updatePublishForm, closeModal, file } = this.props; if (file) { upload(file); updatePublishForm({ thumbnailPath: file.path }); closeModal(); } } render() { const { closeModal, file } = this.props; const filePath = file && (file.path || file.name); return ( this.upload()} onAborted={closeModal} >
{filePath}
); } } export default ModalConfirmThumbnailUpload;