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