lbry-desktop/ui/js/component/downloadingModal/view.jsx

63 lines
1.6 KiB
React
Raw Normal View History

2017-06-06 23:19:12 +02:00
import React from "react";
import { Modal } from "component/modal";
import { Line } from "rc-progress";
import Link from "component/link";
2017-04-07 07:15:22 +02:00
2017-06-08 06:42:19 +02:00
class DownloadingModal extends React.PureComponent {
2017-04-07 07:15:22 +02:00
render() {
const {
downloadProgress,
downloadComplete,
startUpgrade,
cancelUpgrade,
2017-06-06 23:19:12 +02:00
} = this.props;
2017-04-07 07:15:22 +02:00
return (
2017-06-06 23:19:12 +02:00
<Modal
isOpen={true}
contentLabel={__("Downloading Update")}
type="custom"
>
{__("Downloading Update")}
{downloadProgress ? `: ${downloadProgress}%` : null}
<Line
percent={downloadProgress ? downloadProgress : 0}
strokeWidth="4"
/>
{downloadComplete
? <div>
<br />
<p>{__('Click "Begin Upgrade" to start the upgrade process.')}</p>
<p>
{__(
"The app will close, and you will be prompted to install the latest version of LBRY."
)}
</p>
<p>
{__("After the install is complete, please reopen the app.")}
</p>
</div>
: null}
2017-04-07 07:15:22 +02:00
<div className="modal__buttons">
{downloadComplete
2017-06-06 23:19:12 +02:00
? <Link
button="primary"
label={__("Begin Upgrade")}
className="modal__button"
onClick={startUpgrade}
/>
2017-04-07 07:15:22 +02:00
: null}
2017-06-06 23:19:12 +02:00
<Link
button="alt"
label={__("Cancel")}
className="modal__button"
onClick={cancelUpgrade}
/>
2017-04-07 07:15:22 +02:00
</div>
</Modal>
2017-06-06 23:19:12 +02:00
);
2017-04-07 07:15:22 +02:00
}
}
2017-06-06 06:21:55 +02:00
export default DownloadingModal;