2017-04-07 07:15:22 +02:00
|
|
|
import React from 'react'
|
|
|
|
import {
|
|
|
|
Modal
|
|
|
|
} from 'component/modal'
|
|
|
|
import {Line} from 'rc-progress';
|
|
|
|
import Link from 'component/link'
|
|
|
|
|
|
|
|
class DownloadingModal extends React.Component {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
downloadProgress,
|
|
|
|
downloadComplete,
|
|
|
|
startUpgrade,
|
|
|
|
cancelUpgrade,
|
|
|
|
} = this.props
|
|
|
|
|
|
|
|
return (
|
2017-05-26 02:16:25 +02:00
|
|
|
<Modal isOpen={true} contentLabel={__("Downloading Update")} type="custom">
|
|
|
|
{__("Downloading Update")}{downloadProgress ? `: ${downloadProgress}%` : null}
|
2017-05-25 22:07:32 +02:00
|
|
|
<Line percent={downloadProgress ? downloadProgress : 0} strokeWidth="4"/>
|
2017-04-07 07:15:22 +02:00
|
|
|
{downloadComplete ? (
|
|
|
|
<div>
|
|
|
|
<br />
|
2017-05-26 02:16:25 +02:00
|
|
|
<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>
|
2017-04-07 07:15:22 +02:00
|
|
|
</div>
|
|
|
|
) : null }
|
|
|
|
<div className="modal__buttons">
|
|
|
|
{downloadComplete
|
2017-05-26 02:16:25 +02:00
|
|
|
? <Link button="primary" label={__("Begin Upgrade")} className="modal__button" onClick={startUpgrade} />
|
2017-04-07 07:15:22 +02:00
|
|
|
: null}
|
2017-05-26 02:16:25 +02:00
|
|
|
<Link button="alt" label={__("Cancel")} className="modal__button" onClick={cancelUpgrade} />
|
2017-04-07 07:15:22 +02:00
|
|
|
</div>
|
|
|
|
</Modal>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DownloadingModal
|