lbry-desktop/src/ui/modal/modalConfirmThumbnailUpload/view.jsx

42 lines
976 B
React
Raw Normal View History

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
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-07-21 23:31:22 +02:00
<blockquote>{path}</blockquote>
2018-04-02 18:03:12 +02:00
</Modal>
);
}
}
export default ModalConfirmThumbnailUpload;