diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-10-13 12:29:40 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2017-10-13 12:29:40 +0200 |
commit | 58cda9cc7fb79ca9df6746de7f9662bc08dc156a (patch) | |
tree | 1211600c2a5d3b5f81c435c6896618111a611720 /src/containers/auth/PricingScreen.js | |
download | ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.tar.gz ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.tar.zst ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.zip |
initial commit
Diffstat (limited to 'src/containers/auth/PricingScreen.js')
-rw-r--r-- | src/containers/auth/PricingScreen.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/containers/auth/PricingScreen.js b/src/containers/auth/PricingScreen.js new file mode 100644 index 000000000..7e1586535 --- /dev/null +++ b/src/containers/auth/PricingScreen.js | |||
@@ -0,0 +1,53 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | import { RouterStore } from 'mobx-react-router'; | ||
5 | |||
6 | import Pricing from '../../components/auth/Pricing'; | ||
7 | import UserStore from '../../stores/UserStore'; | ||
8 | import PaymentStore from '../../stores/PaymentStore'; | ||
9 | import { gaPage } from '../../lib/analytics'; | ||
10 | |||
11 | import { globalError as globalErrorPropType } from '../../prop-types'; | ||
12 | |||
13 | @inject('stores', 'actions') @observer | ||
14 | export default class PricingScreen extends Component { | ||
15 | static propTypes = { | ||
16 | error: globalErrorPropType.isRequired, | ||
17 | }; | ||
18 | |||
19 | componentDidMount() { | ||
20 | gaPage('Auth/Pricing'); | ||
21 | } | ||
22 | |||
23 | render() { | ||
24 | const { actions, stores, error } = this.props; | ||
25 | |||
26 | const nextStepRoute = stores.user.legacyServices.length ? stores.user.importRoute : stores.user.inviteRoute; | ||
27 | |||
28 | return ( | ||
29 | <Pricing | ||
30 | donor={stores.user.data.donor || {}} | ||
31 | onSubmit={actions.user.signup} | ||
32 | onCloseSubscriptionWindow={() => this.props.stores.router.push(nextStepRoute)} | ||
33 | isLoading={stores.payment.plansRequest.isExecuting} | ||
34 | isLoadingUser={stores.user.getUserInfoRequest.isExecuting} | ||
35 | error={error} | ||
36 | skipAction={() => this.props.stores.router.push(nextStepRoute)} | ||
37 | /> | ||
38 | ); | ||
39 | } | ||
40 | } | ||
41 | |||
42 | PricingScreen.wrappedComponent.propTypes = { | ||
43 | actions: PropTypes.shape({ | ||
44 | user: PropTypes.shape({ | ||
45 | signup: PropTypes.func.isRequired, | ||
46 | }).isRequired, | ||
47 | }).isRequired, | ||
48 | stores: PropTypes.shape({ | ||
49 | user: PropTypes.instanceOf(UserStore).isRequired, | ||
50 | payment: PropTypes.instanceOf(PaymentStore).isRequired, | ||
51 | router: PropTypes.instanceOf(RouterStore).isRequired, | ||
52 | }).isRequired, | ||
53 | }; | ||