2018-04-02 18:03:12 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
|
|
|
|
|
|
|
type Props = {
|
2019-04-24 16:02:08 +02:00
|
|
|
upload: string => void,
|
2018-04-02 18:03:12 +02:00
|
|
|
path: string,
|
|
|
|
closeModal: () => void,
|
2018-04-02 22:27:44 +02:00
|
|
|
updatePublishForm: ({}) => void,
|
2018-04-02 18:03:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class ModalConfirmThumbnailUpload extends React.PureComponent<Props> {
|
|
|
|
upload() {
|
2019-04-24 16:02:08 +02:00
|
|
|
const { upload, updatePublishForm, closeModal, path } = this.props;
|
|
|
|
upload(path);
|
2018-06-08 06:05:45 +02:00
|
|
|
updatePublishForm({ thumbnailPath: path });
|
2018-04-02 18:03:12 +02:00
|
|
|
closeModal();
|
2018-04-02 18:03:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2019-07-21 23:31:22 +02:00
|
|
|
const { closeModal, path } = this.props;
|
2018-04-02 18:03:12 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
isOpen
|
2019-01-14 19:40:06 +01:00
|
|
|
title={__('Upload Thumbnail')}
|
2018-04-02 18:03:12 +02:00
|
|
|
contentLabel={__('Confirm Thumbnail Upload')}
|
|
|
|
type="confirm"
|
|
|
|
confirmButtonLabel={__('Upload')}
|
|
|
|
onConfirmed={() => this.upload()}
|
|
|
|
onAborted={closeModal}
|
|
|
|
>
|
2019-07-21 23:31:22 +02:00
|
|
|
<p>{__('Are you sure you want to upload this thumbnail to spee.ch')}?</p>
|
2019-01-11 17:34:36 +01:00
|
|
|
|
2019-07-21 23:31:22 +02:00
|
|
|
<blockquote>{path}</blockquote>
|
2018-04-02 18:03:12 +02:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ModalConfirmThumbnailUpload;
|