diff options
author | 2019-08-19 12:11:38 +0200 | |
---|---|---|
committer | 2019-08-19 12:11:38 +0200 | |
commit | 478b5fc6574765072eafd4fa074ae832e67627bf (patch) | |
tree | 07dba02a6746685b00106ae2f37b529573876852 /src/components/subscription/SubscriptionForm.js | |
parent | remove monthly & yearly names (diff) | |
download | ferdium-app-478b5fc6574765072eafd4fa074ae832e67627bf.tar.gz ferdium-app-478b5fc6574765072eafd4fa074ae832e67627bf.tar.zst ferdium-app-478b5fc6574765072eafd4fa074ae832e67627bf.zip |
Add trial / subscription handling
Diffstat (limited to 'src/components/subscription/SubscriptionForm.js')
-rw-r--r-- | src/components/subscription/SubscriptionForm.js | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/src/components/subscription/SubscriptionForm.js b/src/components/subscription/SubscriptionForm.js index 0c630f047..641368734 100644 --- a/src/components/subscription/SubscriptionForm.js +++ b/src/components/subscription/SubscriptionForm.js | |||
@@ -1,35 +1,30 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import { defineMessages, intlShape } from 'react-intl'; | 4 | import { defineMessages, intlShape, IntlProvider } from 'react-intl'; |
5 | import injectSheet from 'react-jss'; | 5 | import injectSheet from 'react-jss'; |
6 | 6 | ||
7 | import { H3 } from '@meetfranz/ui'; | 7 | import { H3, H2 } from '@meetfranz/ui'; |
8 | 8 | ||
9 | import { Button } from '@meetfranz/forms'; | 9 | import { Button } from '@meetfranz/forms'; |
10 | import { FeatureList } from '../ui/FeatureList'; | 10 | import { FeatureList } from '../ui/FeatureList'; |
11 | import { FeatureItem } from '../ui/FeatureItem'; | ||
12 | 11 | ||
13 | const messages = defineMessages({ | 12 | const messages = defineMessages({ |
14 | submitButtonLabel: { | 13 | submitButtonLabel: { |
15 | id: 'subscription.cta.activateTrial', | 14 | id: 'subscription.cta.choosePlan', |
16 | defaultMessage: '!!!Yes, upgrade my account to Franz Professional', | 15 | defaultMessage: '!!!Choose your plan', |
17 | }, | 16 | }, |
18 | includedFeatures: { | 17 | teaserHeadline: { |
19 | id: 'subscription.includedProFeatures', | 18 | id: 'settings.account.headlineUpgradeAccount', |
20 | defaultMessage: '!!!The Franz Professional Plan includes:', | 19 | defaultMessage: '!!!Upgrade your account and get the full Franz experience', |
21 | }, | ||
22 | noStringsAttachedHeadline: { | ||
23 | id: 'pricing.trial.terms.headline', | ||
24 | defaultMessage: '!!!No strings attached', | ||
25 | }, | 20 | }, |
26 | noCreditCard: { | 21 | teaserText: { |
27 | id: 'pricing.trial.terms.noCreditCard', | 22 | id: 'subscription.teaser.intro', |
28 | defaultMessage: '!!!No credit card required', | 23 | defaultMessage: '!!!Franz 5 comes with a wide range of new features to boost up your everyday communication - batteries included. Check out our new plans and find out which one suits you most!', |
29 | }, | 24 | }, |
30 | automaticTrialEnd: { | 25 | includedFeatures: { |
31 | id: 'pricing.trial.terms.automaticTrialEnd', | 26 | id: 'subscription.teaser.includedFeatures', |
32 | defaultMessage: '!!!Your free trial ends automatically after 14 days', | 27 | defaultMessage: '!!!Paid Franz Plans include:', |
33 | }, | 28 | }, |
34 | }); | 29 | }); |
35 | 30 | ||
@@ -37,14 +32,11 @@ const styles = () => ({ | |||
37 | activateTrialButton: { | 32 | activateTrialButton: { |
38 | margin: [40, 0, 50], | 33 | margin: [40, 0, 50], |
39 | }, | 34 | }, |
40 | keyTerms: { | ||
41 | marginTop: 20, | ||
42 | }, | ||
43 | }); | 35 | }); |
44 | 36 | ||
45 | export default @observer @injectSheet(styles) class SubscriptionForm extends Component { | 37 | export default @observer @injectSheet(styles) class SubscriptionForm extends Component { |
46 | static propTypes = { | 38 | static propTypes = { |
47 | activateTrial: PropTypes.func.isRequired, | 39 | selectPlan: PropTypes.func.isRequired, |
48 | isActivatingTrial: PropTypes.bool.isRequired, | 40 | isActivatingTrial: PropTypes.bool.isRequired, |
49 | classes: PropTypes.object.isRequired, | 41 | classes: PropTypes.object.isRequired, |
50 | }; | 42 | }; |
@@ -56,28 +48,20 @@ export default @observer @injectSheet(styles) class SubscriptionForm extends Com | |||
56 | render() { | 48 | render() { |
57 | const { | 49 | const { |
58 | isActivatingTrial, | 50 | isActivatingTrial, |
59 | activateTrial, | 51 | selectPlan, |
60 | classes, | 52 | classes, |
61 | } = this.props; | 53 | } = this.props; |
62 | const { intl } = this.context; | 54 | const { intl } = this.context; |
63 | 55 | ||
64 | console.log('isActivatingTrial', isActivatingTrial); | ||
65 | |||
66 | return ( | 56 | return ( |
67 | <> | 57 | <> |
68 | <H3 className={classes.keyTerms}> | 58 | <H2>{intl.formatMessage(messages.teaserHeadline)}</H2> |
69 | {intl.formatMessage(messages.noStringsAttachedHeadline)} | 59 | <p>{intl.formatMessage(messages.teaserText)}</p> |
70 | </H3> | ||
71 | <ul> | ||
72 | <FeatureItem icon="👉" name={intl.formatMessage(messages.noCreditCard)} /> | ||
73 | <FeatureItem icon="👉" name={intl.formatMessage(messages.automaticTrialEnd)} /> | ||
74 | </ul> | ||
75 | |||
76 | <Button | 60 | <Button |
77 | label={intl.formatMessage(messages.submitButtonLabel)} | 61 | label={intl.formatMessage(messages.submitButtonLabel)} |
78 | className={classes.activateTrialButton} | 62 | className={classes.activateTrialButton} |
79 | busy={isActivatingTrial} | 63 | busy={isActivatingTrial} |
80 | onClick={activateTrial} | 64 | onClick={selectPlan} |
81 | stretch | 65 | stretch |
82 | /> | 66 | /> |
83 | <div className="subscription__premium-info"> | 67 | <div className="subscription__premium-info"> |