aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/auth/PricingScreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/auth/PricingScreen.js')
-rw-r--r--src/containers/auth/PricingScreen.js53
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 @@
1import React, { Component } from 'react';
2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react';
4import { RouterStore } from 'mobx-react-router';
5
6import Pricing from '../../components/auth/Pricing';
7import UserStore from '../../stores/UserStore';
8import PaymentStore from '../../stores/PaymentStore';
9import { gaPage } from '../../lib/analytics';
10
11import { globalError as globalErrorPropType } from '../../prop-types';
12
13@inject('stores', 'actions') @observer
14export 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
42PricingScreen.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};