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/containers/auth/PricingScreen.js | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/containers/auth/PricingScreen.js (limited to 'src/containers/auth/PricingScreen.js') 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 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import { inject, observer } from 'mobx-react'; +import { RouterStore } from 'mobx-react-router'; + +import Pricing from '../../components/auth/Pricing'; +import UserStore from '../../stores/UserStore'; +import PaymentStore from '../../stores/PaymentStore'; +import { gaPage } from '../../lib/analytics'; + +import { globalError as globalErrorPropType } from '../../prop-types'; + +@inject('stores', 'actions') @observer +export default class PricingScreen extends Component { + static propTypes = { + error: globalErrorPropType.isRequired, + }; + + componentDidMount() { + gaPage('Auth/Pricing'); + } + + render() { + const { actions, stores, error } = this.props; + + const nextStepRoute = stores.user.legacyServices.length ? stores.user.importRoute : stores.user.inviteRoute; + + return ( + this.props.stores.router.push(nextStepRoute)} + isLoading={stores.payment.plansRequest.isExecuting} + isLoadingUser={stores.user.getUserInfoRequest.isExecuting} + error={error} + skipAction={() => this.props.stores.router.push(nextStepRoute)} + /> + ); + } +} + +PricingScreen.wrappedComponent.propTypes = { + actions: PropTypes.shape({ + user: PropTypes.shape({ + signup: PropTypes.func.isRequired, + }).isRequired, + }).isRequired, + stores: PropTypes.shape({ + user: PropTypes.instanceOf(UserStore).isRequired, + payment: PropTypes.instanceOf(PaymentStore).isRequired, + router: PropTypes.instanceOf(RouterStore).isRequired, + }).isRequired, +}; -- cgit v1.2.3-70-g09d2