2016-11-17 23:22:23 +00:00
|
|
|
import React, {Component} from 'react';
|
|
|
|
import Modal from '../base/Modal';
|
|
|
|
import ModalBody from '../base/ModalBody';
|
|
|
|
import ModalHeader from '../base/ModalHeader';
|
|
|
|
import ModalFooter from '../base/ModalFooter';
|
|
|
|
import PaymentModal from './PaymentModal';
|
|
|
|
import {showModal} from './index';
|
|
|
|
import * as session from '../../../sync/session';
|
|
|
|
import {trackEvent} from '../../../analytics';
|
|
|
|
|
|
|
|
|
|
|
|
let hidePaymentNotificationUntilNextLaunch = false;
|
|
|
|
|
|
|
|
class PaymentNotificationModal extends Component {
|
2016-11-27 21:42:38 +00:00
|
|
|
_handleHide = () => {
|
|
|
|
this.hide();
|
|
|
|
};
|
|
|
|
|
|
|
|
_handleProceedToPayment = () => {
|
|
|
|
this.hide();
|
|
|
|
showModal(PaymentModal);
|
|
|
|
trackEvent('Billing', 'Trial Ended', 'Proceed')
|
|
|
|
};
|
|
|
|
|
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}>
|
|
|
|
<ModalHeader>Free Trial has Ended</ModalHeader>
|
|
|
|
<ModalBody className="pad changelog">
|
|
|
|
<div className="text-center pad">
|
|
|
|
<h1>
|
|
|
|
Hi {session.getFirstName()},
|
|
|
|
</h1>
|
|
|
|
<p style={{maxWidth: '30rem', margin: 'auto'}}>
|
2016-11-18 00:05:00 +00:00
|
|
|
Your Insomnia Plus trial has ended. please enter your billing information to
|
|
|
|
continue using your account.
|
2016-11-17 23:22:23 +00:00
|
|
|
</p>
|
|
|
|
<br/>
|
|
|
|
<p className="pad-top">
|
2016-11-27 21:42:38 +00:00
|
|
|
<button className="btn btn--compact btn--outlined"
|
|
|
|
onClick={this._handleProceedToPayment}>
|
2016-11-17 23:22:23 +00:00
|
|
|
Proceed to Billing
|
|
|
|
</button>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</ModalBody>
|
|
|
|
<ModalFooter>
|
2016-11-27 21:42:38 +00:00
|
|
|
<button className="btn" onClick={this._handleHide}>
|
|
|
|
Maybe Later
|
2016-11-17 23:22:23 +00:00
|
|
|
</button>
|
|
|
|
<div></div>
|
|
|
|
</ModalFooter>
|
|
|
|
</Modal>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PaymentNotificationModal.propTypes = {};
|
|
|
|
|
|
|
|
export default PaymentNotificationModal;
|