2018-04-02 18:03:12 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
2019-01-11 17:34:36 +01:00
|
|
|
import { FormField, FormRow } from 'component/common/form';
|
2018-04-02 18:03:12 +02:00
|
|
|
|
|
|
|
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}
|
|
|
|
>
|
2019-01-11 17:34:36 +01:00
|
|
|
<header className="card__header">
|
|
|
|
<h2 className="card__title">{__('More Ways To Get LBRY Credits')}</h2>
|
|
|
|
<p className="card__subtitle">
|
|
|
|
{__('Are you sure you want to upload this thumbnail to spee.ch')}?
|
|
|
|
</p>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<blockquote>{path}</blockquote>
|
|
|
|
<FormRow>
|
2018-09-26 19:48:07 +02:00
|
|
|
<FormField
|
|
|
|
type="checkbox"
|
|
|
|
name="content_is_mature"
|
|
|
|
postfix={__('Mature audiences only')}
|
|
|
|
checked={nsfw}
|
|
|
|
onChange={event => updatePublishForm({ nsfw: event.target.checked })}
|
|
|
|
/>
|
2019-01-11 17:34:36 +01:00
|
|
|
</FormRow>
|
2018-04-02 18:03:12 +02:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ModalConfirmThumbnailUpload;
|