2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
2019-10-23 21:39:51 +02:00
|
|
|
import ClaimPreview from 'component/claimPreview';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
closeModal: () => void,
|
|
|
|
clearPublish: () => void,
|
|
|
|
navigate: string => void,
|
|
|
|
uri: string,
|
2019-06-26 03:18:05 +02:00
|
|
|
isEdit: boolean,
|
2018-03-26 23:32:43 +02:00
|
|
|
};
|
|
|
|
|
2019-04-10 23:27:12 +02:00
|
|
|
class ModalPublishSuccess extends React.PureComponent<Props> {
|
2018-03-26 23:32:43 +02:00
|
|
|
render() {
|
2019-06-26 03:18:05 +02:00
|
|
|
const { closeModal, clearPublish, navigate, uri, isEdit } = this.props;
|
|
|
|
const contentLabel = isEdit ? 'Updates published' : 'File published';
|
|
|
|
const publishMessage = isEdit ? 'updates have been' : 'file has been';
|
|
|
|
const publishType = isEdit ? 'updates' : 'file';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
isOpen
|
2018-09-26 19:48:07 +02:00
|
|
|
title={__('Success')}
|
2019-06-26 03:18:05 +02:00
|
|
|
contentLabel={__(contentLabel)}
|
2018-03-26 23:32:43 +02:00
|
|
|
onConfirmed={() => {
|
|
|
|
clearPublish();
|
2019-04-10 23:27:12 +02:00
|
|
|
navigate('/$/published');
|
2018-03-26 23:32:43 +02:00
|
|
|
closeModal();
|
|
|
|
}}
|
2019-10-23 21:39:51 +02:00
|
|
|
confirmButtonLabel={'View My Publishes'}
|
2019-10-11 02:37:18 +02:00
|
|
|
abortButtonLabel={'Thanks!'}
|
|
|
|
onAborted={() => {
|
|
|
|
clearPublish();
|
|
|
|
closeModal();
|
|
|
|
}}
|
2018-03-26 23:32:43 +02:00
|
|
|
>
|
2019-10-23 21:39:51 +02:00
|
|
|
<p className="card__subtitle">{__(`Your %publishMessage% published to LBRY.`, { publishMessage })}</p>
|
|
|
|
<div className="card--inline">
|
|
|
|
<ClaimPreview uri={uri} />
|
|
|
|
</div>
|
|
|
|
<p className="help">
|
2019-07-21 23:31:22 +02:00
|
|
|
{__(
|
|
|
|
`The ${publishType} will take a few minutes to appear for other LBRY users. Until then it will be listed as "pending" under your published files.`
|
|
|
|
)}
|
|
|
|
</p>
|
2018-03-26 23:32:43 +02:00
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-10 23:27:12 +02:00
|
|
|
export default ModalPublishSuccess;
|