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

42 lines
1,001 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 = {
upload: WebFile => void,
file: WebFile,
2018-04-02 18:03:12 +02:00
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() {
const { upload, updatePublishForm, closeModal, file } = this.props;
upload(file);
updatePublishForm({ thumbnailPath: file.path });
2018-04-02 18:03:12 +02:00
closeModal();
2018-04-02 18:03:12 +02:00
}
render() {
const { closeModal, file } = 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>
<blockquote>{file.path || file.name}</blockquote>
2018-04-02 18:03:12 +02:00
</Modal>
);
}
}
export default ModalConfirmThumbnailUpload;