2018-09-26 19:48:07 +02:00
|
|
|
// @flow
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
2021-02-01 23:59:34 +01:00
|
|
|
import LastReleaseChanges from 'component/lastReleaseChanges';
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2021-09-13 17:35:26 +02:00
|
|
|
const IS_MAC = navigator.userAgent.indexOf('Mac OS X') !== -1;
|
|
|
|
|
2018-09-26 19:48:07 +02:00
|
|
|
type Props = {
|
|
|
|
downloadUpgrade: () => void,
|
|
|
|
skipUpgrade: () => void,
|
2022-03-01 14:53:00 +01:00
|
|
|
releaseVersion: string,
|
2018-09-26 19:48:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class ModalUpgrade extends React.PureComponent<Props> {
|
2017-04-07 07:15:22 +02:00
|
|
|
render() {
|
2022-03-01 14:53:00 +01:00
|
|
|
const { downloadUpgrade, skipUpgrade, releaseVersion } = this.props;
|
2017-04-07 07:15:22 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Modal
|
2021-09-13 17:35:26 +02:00
|
|
|
className={IS_MAC ? '' : 'main-wrapper--scrollbar'}
|
2017-12-21 22:08:54 +01:00
|
|
|
isOpen
|
|
|
|
contentLabel={__('Upgrade available')}
|
2020-08-26 22:28:33 +02:00
|
|
|
title={__('LBRY leveled up')}
|
2017-04-07 07:15:22 +02:00
|
|
|
type="confirm"
|
2017-12-21 22:08:54 +01:00
|
|
|
confirmButtonLabel={__('Upgrade')}
|
|
|
|
abortButtonLabel={__('Skip')}
|
2017-04-07 07:15:22 +02:00
|
|
|
onConfirmed={downloadUpgrade}
|
2017-06-06 23:19:12 +02:00
|
|
|
onAborted={skipUpgrade}
|
|
|
|
>
|
2022-03-01 14:53:00 +01:00
|
|
|
{__('A new version %release_tag% of LBRY is ready for you.', { release_tag: releaseVersion })}
|
2021-02-01 23:59:34 +01:00
|
|
|
<LastReleaseChanges hideReleaseVersion />
|
2017-04-07 07:15:22 +02:00
|
|
|
</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 ModalUpgrade;
|