diff options
-rw-r--r-- | src/components/ui/Modal/index.js | 2 | ||||
-rw-r--r-- | src/containers/subscription/SubscriptionFormScreen.js | 39 |
2 files changed, 23 insertions, 18 deletions
diff --git a/src/components/ui/Modal/index.js b/src/components/ui/Modal/index.js index 8e6ec5a0e..0b7154760 100644 --- a/src/components/ui/Modal/index.js +++ b/src/components/ui/Modal/index.js | |||
@@ -3,9 +3,9 @@ import ReactModal from 'react-modal'; | |||
3 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
4 | import classnames from 'classnames'; | 4 | import classnames from 'classnames'; |
5 | import injectCSS from 'react-jss'; | 5 | import injectCSS from 'react-jss'; |
6 | import { Icon } from '@meetfranz/ui'; | ||
6 | 7 | ||
7 | import styles from './styles'; | 8 | import styles from './styles'; |
8 | import { Icon } from '../../../../packages/ui/lib'; | ||
9 | 9 | ||
10 | // ReactModal.setAppElement('#root'); | 10 | // ReactModal.setAppElement('#root'); |
11 | 11 | ||
diff --git a/src/containers/subscription/SubscriptionFormScreen.js b/src/containers/subscription/SubscriptionFormScreen.js index 3eb7b6255..cb67ee7f2 100644 --- a/src/containers/subscription/SubscriptionFormScreen.js +++ b/src/containers/subscription/SubscriptionFormScreen.js | |||
@@ -43,26 +43,31 @@ export default @inject('stores', 'actions') @observer class SubscriptionFormScre | |||
43 | }); | 43 | }); |
44 | 44 | ||
45 | const hostedPage = await stores.payment.createHostedPageRequest; | 45 | const hostedPage = await stores.payment.createHostedPageRequest; |
46 | const url = `file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`; | ||
47 | 46 | ||
48 | if (hostedPage.url) { | 47 | if (hostedPage.url) { |
49 | const paymentWindow = new BrowserWindow({ | 48 | if (hostedPage.legacyCheckoutFlow) { |
50 | parent: remote.getCurrentWindow(), | 49 | const paymentWindow = new BrowserWindow({ |
51 | modal: true, | 50 | parent: remote.getCurrentWindow(), |
52 | title: '🔒 Franz Supporter License', | 51 | modal: true, |
53 | width: 600, | 52 | title: '🔒 Franz Supporter License', |
54 | height: window.innerHeight - 100, | 53 | width: 600, |
55 | maxWidth: 600, | 54 | height: window.innerHeight - 100, |
56 | minWidth: 600, | 55 | maxWidth: 600, |
57 | webPreferences: { | 56 | minWidth: 600, |
58 | nodeIntegration: true, | 57 | webPreferences: { |
59 | }, | 58 | nodeIntegration: true, |
60 | }); | 59 | }, |
61 | paymentWindow.loadURL(url); | 60 | }); |
61 | paymentWindow.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`); | ||
62 | 62 | ||
63 | paymentWindow.on('closed', () => { | 63 | paymentWindow.on('closed', () => { |
64 | onCloseWindow(); | 64 | onCloseWindow(); |
65 | }); | 65 | }); |
66 | } else { | ||
67 | actions.app.openExternalUrl({ | ||
68 | url: hostedPage.url, | ||
69 | }); | ||
70 | } | ||
66 | } | 71 | } |
67 | } | 72 | } |
68 | 73 | ||