lbry-desktop/src/ui/modal/modalAutoUpdateDownloaded/view.jsx

62 lines
1.5 KiB
React
Raw Normal View History

// @flow
2018-02-24 01:24:00 +01:00
import React from 'react';
2019-03-05 05:46:57 +01:00
// @if TARGET='app'
2018-04-17 00:51:35 +02:00
import { ipcRenderer } from 'electron';
2019-03-05 05:46:57 +01:00
// @endif
2018-02-24 01:24:00 +01:00
import { Modal } from 'modal/modal';
2018-03-26 23:32:43 +02:00
import Button from 'component/button';
2017-12-08 11:08:50 +01:00
type Props = {
closeModal: any => any,
declineAutoUpdate: () => any,
};
2019-01-08 03:46:33 +01:00
type State = {
disabled: boolean,
};
class ModalAutoUpdateDownloaded extends React.PureComponent<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
disabled: false,
};
}
2017-12-08 11:08:50 +01:00
render() {
const { closeModal, declineAutoUpdate } = this.props;
2017-12-22 07:42:04 +01:00
2017-12-08 11:08:50 +01:00
return (
<Modal
2018-03-26 23:32:43 +02:00
isOpen
2017-12-22 07:42:04 +01:00
type="confirm"
2019-07-11 03:42:25 +02:00
contentLabel={__('Upgrade Downloaded')}
2018-09-26 19:48:07 +02:00
title={__('LBRY Leveled Up')}
2019-01-14 22:34:47 +01:00
confirmButtonLabel={__('Use Now')}
2018-02-24 01:24:00 +01:00
abortButtonLabel={__('Upgrade on Close')}
confirmButtonDisabled={this.state.disabled}
2017-12-10 09:06:30 +01:00
onConfirmed={() => {
this.setState({ disabled: true });
2018-02-24 01:24:00 +01:00
ipcRenderer.send('autoUpdateAccepted');
2017-12-10 09:06:30 +01:00
}}
onAborted={() => {
declineAutoUpdate();
2018-02-24 01:24:00 +01:00
ipcRenderer.send('autoUpdateDeclined');
closeModal();
}}
2017-12-08 11:08:50 +01:00
>
2018-09-26 19:48:07 +02:00
<section className="card__content">
2019-03-05 05:46:57 +01:00
<p>{__('A new version of LBRY is ready for you.')}</p>
2019-01-08 07:45:20 +01:00
<p className="help">
2018-04-17 00:51:35 +02:00
{__('Want to know what has changed?')} See the{' '}
2019-05-07 23:38:29 +02:00
<Button button="link" label={__('release notes')} href="https://github.com/lbryio/lbry-desktop/releases" />.
2018-04-17 00:51:35 +02:00
</p>
2017-12-08 11:08:50 +01:00
</section>
</Modal>
);
}
}
export default ModalAutoUpdateDownloaded;