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

49 lines
1.3 KiB
React
Raw Normal View History

2018-04-02 18:03:12 +02:00
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import { FormField } from 'component/common/form';
type Props = {
upload: (string, boolean) => void,
path: string,
nsfw: boolean,
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() {
2018-06-08 06:05:45 +02:00
const { upload, updatePublishForm, closeModal, path, nsfw } = this.props;
2018-04-02 18:03:12 +02:00
upload(path, nsfw);
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() {
const { closeModal, path, updatePublishForm, nsfw } = this.props;
return (
<Modal
isOpen
contentLabel={__('Confirm Thumbnail Upload')}
type="confirm"
confirmButtonLabel={__('Upload')}
onConfirmed={() => this.upload()}
onAborted={closeModal}
>
2018-06-08 06:05:45 +02:00
<p>{__('Are you sure you want to upload this thumbnail to spee.ch')}?</p>
<blockquote>{path}</blockquote>
2018-04-02 18:03:12 +02:00
<FormField
type="checkbox"
name="content_is_mature"
postfix={__('Mature audiences only')}
checked={nsfw}
onChange={event => updatePublishForm({ nsfw: event.target.checked })}
/>
</Modal>
);
}
}
export default ModalConfirmThumbnailUpload;