2016-11-17 23:22:23 +00:00
|
|
|
import React, {Component} from 'react';
|
2017-01-11 03:18:15 +00:00
|
|
|
import PromptButton from '../base/PromptButton';
|
2016-12-21 23:37:48 +00:00
|
|
|
import Link from '../base/Link';
|
2016-11-17 23:22:23 +00:00
|
|
|
import Modal from '../base/Modal';
|
|
|
|
import ModalBody from '../base/ModalBody';
|
|
|
|
import ModalHeader from '../base/ModalHeader';
|
|
|
|
import {trackEvent} from '../../../analytics';
|
2017-01-11 03:18:15 +00:00
|
|
|
import * as session from '../../../sync/session';
|
|
|
|
import * as sync from '../../../sync/index';
|
2016-11-17 23:22:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
let hidePaymentNotificationUntilNextLaunch = false;
|
|
|
|
|
|
|
|
class PaymentNotificationModal extends Component {
|
2017-01-11 03:18:15 +00:00
|
|
|
_handleCancel = async () => {
|
|
|
|
await sync.cancelTrial();
|
2016-11-27 21:42:38 +00:00
|
|
|
this.hide();
|
|
|
|
};
|
|
|
|
|
2016-11-17 23:22:23 +00:00
|
|
|
show () {
|
|
|
|
// Don't trigger automatically if user has dismissed it already
|
|
|
|
if (hidePaymentNotificationUntilNextLaunch) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
hidePaymentNotificationUntilNextLaunch = true;
|
|
|
|
this.modal.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
hide () {
|
|
|
|
trackEvent('Billing', 'Trial Ended', 'Cancel');
|
|
|
|
this.modal.hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<Modal ref={m => this.modal = m}>
|
2017-01-11 03:18:15 +00:00
|
|
|
<ModalHeader>Upgrade Now to Insomnia Plus</ModalHeader>
|
2016-11-17 23:22:23 +00:00
|
|
|
<ModalBody className="pad changelog">
|
|
|
|
<div className="text-center pad">
|
2017-01-11 03:18:15 +00:00
|
|
|
<h1>Hi {session.getFirstName()},</h1>
|
2016-11-17 23:22:23 +00:00
|
|
|
<p style={{maxWidth: '30rem', margin: 'auto'}}>
|
2017-01-11 03:18:15 +00:00
|
|
|
Your Insomnia Plus trial has come to an end. Subscribe to a plan
|
|
|
|
to continue using Plus features like encrypted data synchronization and backup.
|
2016-11-17 23:22:23 +00:00
|
|
|
</p>
|
|
|
|
<br/>
|
|
|
|
<p className="pad-top">
|
2017-01-11 03:18:15 +00:00
|
|
|
<PromptButton onClick={this._handleCancel} className="btn btn--compact faint">
|
|
|
|
End Subscription
|
|
|
|
</PromptButton>
|
|
|
|
{" "}
|
|
|
|
<Link button={true}
|
|
|
|
href="https://insomnia.rest/app/subscribe/"
|
|
|
|
className="btn btn--compact btn--outlined">
|
|
|
|
Subscribe Now
|
2016-12-21 23:37:48 +00:00
|
|
|
</Link>
|
2016-11-17 23:22:23 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</ModalBody>
|
|
|
|
</Modal>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PaymentNotificationModal.propTypes = {};
|
|
|
|
|
|
|
|
export default PaymentNotificationModal;
|