From 58cda9cc7fb79ca9df6746de7f9662bc08dc156a Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 13 Oct 2017 12:29:40 +0200 Subject: initial commit --- src/components/ui/SubscriptionPopup.js | 84 ++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/components/ui/SubscriptionPopup.js (limited to 'src/components/ui/SubscriptionPopup.js') diff --git a/src/components/ui/SubscriptionPopup.js b/src/components/ui/SubscriptionPopup.js new file mode 100644 index 000000000..72b6ccd98 --- /dev/null +++ b/src/components/ui/SubscriptionPopup.js @@ -0,0 +1,84 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { observer } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; +import Webview from 'react-electron-web-view'; + +import Button from '../ui/Button'; + +const messages = defineMessages({ + buttonCancel: { + id: 'subscriptionPopup.buttonCancel', + defaultMessage: '!!!Cancel', + }, + buttonDone: { + id: 'subscriptionPopup.buttonDone', + defaultMessage: '!!!Done', + }, +}); + +@observer +export default class SubscriptionPopup extends Component { + static propTypes = { + url: PropTypes.string.isRequired, + closeWindow: PropTypes.func.isRequired, + completeCheck: PropTypes.func.isRequired, + isCompleted: PropTypes.bool.isRequired, + }; + + static contextTypes = { + intl: intlShape, + }; + + state = { + isFakeLoading: false, + }; + + // We delay the window closing a bit in order to give + // the Recurly webhook a few seconds to do it's magic + delayedCloseWindow() { + this.setState({ + isFakeLoading: true, + }); + + setTimeout(() => { + this.props.closeWindow(); + }, 4000); + } + + render() { + const { url, closeWindow, completeCheck, isCompleted } = this.props; + const { intl } = this.context; + + return ( +
+
+ + // openWindow({ event, url, frameName, options })} + /> +
+
+
+
+ ); + } +} -- cgit v1.2.3-70-g09d2