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

63 lines
1.8 KiB
React
Raw Normal View History

2018-03-26 14:32:43 -07:00
// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import ClaimPreview from 'component/claimPreview';
2019-11-01 13:27:01 -04:00
import Button from 'component/button';
2018-03-26 14:32:43 -07:00
type Props = {
closeModal: () => void,
clearPublish: () => void,
navigate: string => void,
uri: string,
isEdit: boolean,
2019-11-01 13:27:01 -04:00
filePath: ?string,
2018-03-26 14:32:43 -07:00
};
2019-04-10 17:27:12 -04:00
class ModalPublishSuccess extends React.PureComponent<Props> {
2018-03-26 14:32:43 -07:00
render() {
2019-11-01 13:27:01 -04:00
const { closeModal, clearPublish, navigate, uri, isEdit, filePath } = this.props;
const contentLabel = isEdit ? 'Update published' : 'File published';
const publishMessage = isEdit ? 'update is now' : 'file is now';
2018-03-26 14:32:43 -07:00
return (
<Modal
isOpen
2018-09-26 13:48:07 -04:00
title={__('Success')}
contentLabel={__(contentLabel)}
2018-03-26 14:32:43 -07:00
onConfirmed={() => {
clearPublish();
2019-04-10 17:27:12 -04:00
navigate('/$/published');
2018-03-26 14:32:43 -07:00
closeModal();
}}
2019-10-24 16:59:05 -04:00
confirmButtonLabel={__('View My Publishes')}
abortButtonLabel={__('Close')}
onAborted={() => {
clearPublish();
closeModal();
}}
2018-03-26 14:32:43 -07:00
>
2019-11-25 11:54:28 -05:00
<p className="section__subtitle">
2019-11-01 13:27:01 -04:00
{__(`Your %publishMessage% pending on LBRY. It will take a few minutes to appear for other users.`, {
publishMessage,
})}
</p>
<div className="card--inline">
2019-11-15 10:13:19 -05:00
<ClaimPreview type="small" uri={uri} />
</div>
<p className="help">
2019-11-01 13:27:01 -04:00
{filePath && !IS_WEB && (
<React.Fragment>
{__(
`Upload will continue in the background, please do not shut down immediately. Leaving the app running helps the network, thank you!`
)}{' '}
<Button button="link" href="https://lbry.com/faq/host-content" label={__('Learn More')} />
</React.Fragment>
2019-07-21 17:31:22 -04:00
)}
</p>
2018-03-26 14:32:43 -07:00
</Modal>
);
}
}
2019-04-10 17:27:12 -04:00
export default ModalPublishSuccess;