lbry-desktop/ui/modal/modalPublish/view.jsx
infiinte-persistence 140364cb67 Fix translation issues in the Publish modal dialog.
Two issues:
1. Values not marked with __()
2. Split sentence.

For #2, it seems like there are translations that don't make sense when combined, because the values are being translated independently from full sentence in Transifex. Decided to just make it full sentences.
2020-06-15 10:51:26 -04:00

73 lines
2.3 KiB
JavaScript

// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import ClaimPreview from 'component/claimPreview';
import Button from 'component/button';
import Card from 'component/common/card';
type Props = {
closeModal: () => void,
clearPublish: () => void,
navigate: string => void,
uri: string,
isEdit: boolean,
filePath: ?string,
};
class ModalPublishSuccess extends React.PureComponent<Props> {
render() {
const { closeModal, clearPublish, navigate, uri, isEdit, filePath } = this.props;
const contentLabel = isEdit ? __('Update published') : __('File published');
const publishMessage = isEdit
? __('Your update is now pending on LBRY. It will take a few minutes to appear for other users.')
: __('Your file is now pending on LBRY. It will take a few minutes to appear for other users.');
function handleClose() {
clearPublish();
closeModal();
}
return (
<Modal isOpen type="card" contentLabel={__(contentLabel)} onAborted={handleClose}>
<Card
title={__('Success')}
subtitle={publishMessage}
body={
<React.Fragment>
<div className="card--inline">
<ClaimPreview type="small" uri={uri} />
</div>
{filePath && !IS_WEB && (
<p className="help">
<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>
</p>
)}
</React.Fragment>
}
actions={
<div className="section__actions">
<Button
button="primary"
label={__('View My Publishes')}
onClick={() => {
clearPublish();
navigate('/$/published');
closeModal();
}}
/>
<Button button="link" label={__('Close')} onClick={handleClose} />
</div>
}
/>
</Modal>
);
}
}
export default ModalPublishSuccess;