2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
|
|
|
import { Line } from 'rc-progress';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Button from 'component/button';
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2017-07-02 20:23:38 +02:00
|
|
|
class ModalDownloading extends React.PureComponent {
|
2017-04-07 07:15:22 +02:00
|
|
|
render() {
|
2018-06-19 08:31:47 +02:00
|
|
|
const {
|
|
|
|
downloadProgress,
|
|
|
|
downloadComplete,
|
|
|
|
downloadItem,
|
|
|
|
startUpgrade,
|
|
|
|
cancelUpgrade,
|
|
|
|
} = this.props;
|
2017-04-07 07:15:22 +02:00
|
|
|
|
|
|
|
return (
|
2017-12-21 22:08:54 +01:00
|
|
|
<Modal isOpen contentLabel={__('Downloading Update')} type="custom">
|
|
|
|
{__('Downloading Update')}
|
2017-06-06 23:19:12 +02:00
|
|
|
{downloadProgress ? `: ${downloadProgress}%` : null}
|
2017-12-21 22:08:54 +01:00
|
|
|
<Line percent={downloadProgress || 0} strokeWidth="4" />
|
2017-11-24 15:31:05 +01:00
|
|
|
{downloadComplete ? (
|
|
|
|
<div>
|
|
|
|
<br />
|
|
|
|
<p>{__('Click "Begin Upgrade" to start the upgrade process.')}</p>
|
|
|
|
<p>
|
|
|
|
{__(
|
2017-12-21 22:08:54 +01:00
|
|
|
'The app will close, and you will be prompted to install the latest version of LBRY.'
|
2017-11-24 15:31:05 +01:00
|
|
|
)}
|
|
|
|
</p>
|
2018-06-19 08:31:47 +02:00
|
|
|
<p>
|
|
|
|
{__(
|
|
|
|
'To launch installation manually, close LBRY and run the command below in the terminal.'
|
|
|
|
)}
|
|
|
|
</p>
|
|
|
|
<blockquote>sudo dpkg -i {downloadItem}</blockquote>
|
2017-12-21 22:08:54 +01:00
|
|
|
<p>{__('After the install is complete, please reopen the app.')}</p>
|
2017-11-24 15:31:05 +01:00
|
|
|
</div>
|
|
|
|
) : null}
|
2017-04-07 07:15:22 +02:00
|
|
|
<div className="modal__buttons">
|
2017-11-24 15:31:05 +01:00
|
|
|
{downloadComplete ? (
|
2018-03-26 23:32:43 +02:00
|
|
|
<Button
|
2017-11-24 15:31:05 +01:00
|
|
|
button="primary"
|
2017-12-21 22:08:54 +01:00
|
|
|
label={__('Begin Upgrade')}
|
2017-11-24 15:31:05 +01:00
|
|
|
className="modal__button"
|
|
|
|
onClick={startUpgrade}
|
|
|
|
/>
|
|
|
|
) : null}
|
2018-03-26 23:32:43 +02:00
|
|
|
<Button
|
2018-06-14 20:13:54 +02:00
|
|
|
button="link"
|
2017-12-21 22:08:54 +01:00
|
|
|
label={__('Cancel')}
|
2017-06-06 23:19:12 +02:00
|
|
|
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-07-02 20:23:38 +02:00
|
|
|
export default ModalDownloading;
|