aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui/FeatureList.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ui/FeatureList.js')
-rw-r--r--src/components/ui/FeatureList.js74
1 files changed, 64 insertions, 10 deletions
diff --git a/src/components/ui/FeatureList.js b/src/components/ui/FeatureList.js
index 62944ad75..7ba8b54d7 100644
--- a/src/components/ui/FeatureList.js
+++ b/src/components/ui/FeatureList.js
@@ -3,12 +3,33 @@ import PropTypes from 'prop-types';
3import { defineMessages, intlShape } from 'react-intl'; 3import { defineMessages, intlShape } from 'react-intl';
4 4
5import { FeatureItem } from './FeatureItem'; 5import { FeatureItem } from './FeatureItem';
6import { PLANS } from '../../config';
6 7
7const messages = defineMessages({ 8const messages = defineMessages({
9 availableRecipes: {
10 id: 'pricing.features.recipes',
11 defaultMessage: '!!!Choose from more than 70 Services',
12 },
13 accountSync: {
14 id: 'pricing.features.accountSync',
15 defaultMessage: '!!!Account Synchronisation',
16 },
17 desktopNotifications: {
18 id: 'pricing.features.desktopNotifications',
19 defaultMessage: '!!!Desktop Notifications',
20 },
8 unlimitedServices: { 21 unlimitedServices: {
9 id: 'pricing.features.unlimitedServices', 22 id: 'pricing.features.unlimitedServices',
10 defaultMessage: '!!!Add unlimited services', 23 defaultMessage: '!!!Add unlimited services',
11 }, 24 },
25 upToThreeServices: {
26 id: 'pricing.features.upToThreeServices',
27 defaultMessage: '!!!Add up to 3 services',
28 },
29 upToSixServices: {
30 id: 'pricing.features.upToSixServices',
31 defaultMessage: '!!!Add up to 6 services',
32 },
12 spellchecker: { 33 spellchecker: {
13 id: 'pricing.features.spellchecker', 34 id: 'pricing.features.spellchecker',
14 defaultMessage: '!!!Spellchecker support', 35 defaultMessage: '!!!Spellchecker support',
@@ -51,11 +72,13 @@ export class FeatureList extends Component {
51 static propTypes = { 72 static propTypes = {
52 className: PropTypes.string, 73 className: PropTypes.string,
53 featureClassName: PropTypes.string, 74 featureClassName: PropTypes.string,
75 plan: PropTypes.oneOf(PLANS),
54 }; 76 };
55 77
56 static defaultProps = { 78 static defaultProps = {
57 className: '', 79 className: '',
58 featureClassName: '', 80 featureClassName: '',
81 plan: false,
59 } 82 }
60 83
61 static contextTypes = { 84 static contextTypes = {
@@ -66,21 +89,52 @@ export class FeatureList extends Component {
66 const { 89 const {
67 className, 90 className,
68 featureClassName, 91 featureClassName,
92 plan,
69 } = this.props; 93 } = this.props;
70 const { intl } = this.context; 94 const { intl } = this.context;
71 95
96 const features = [];
97 if (plan === PLANS.FREE) {
98 features.push(
99 messages.upToThreeServices,
100 messages.availableRecipes,
101 messages.accountSync,
102 messages.desktopNotifications,
103 );
104 } else if (plan === PLANS.PERSONAL) {
105 features.push(
106 messages.upToSixServices,
107 messages.spellchecker,
108 messages.appDelays,
109 messages.adFree,
110 );
111 } else if (plan === PLANS.PRO) {
112 features.push(
113 messages.unlimitedServices,
114 messages.workspaces,
115 messages.customWebsites,
116 // messages.onPremise,
117 messages.thirdPartyServices,
118 // messages.serviceProxies,
119 );
120 } else {
121 features.push(
122 messages.unlimitedServices,
123 messages.spellchecker,
124 messages.workspaces,
125 messages.customWebsites,
126 messages.onPremise,
127 messages.thirdPartyServices,
128 messages.serviceProxies,
129 messages.teamManagement,
130 messages.appDelays,
131 messages.adFree,
132 );
133 }
134
72 return ( 135 return (
73 <ul className={className}> 136 <ul className={className}>
74 <FeatureItem name={intl.formatMessage(messages.unlimitedServices)} className={featureClassName} /> 137 {features.map(feature => <FeatureItem name={intl.formatMessage(feature)} className={featureClassName} />)}
75 <FeatureItem name={intl.formatMessage(messages.spellchecker)} className={featureClassName} />
76 <FeatureItem name={intl.formatMessage(messages.workspaces)} className={featureClassName} />
77 <FeatureItem name={intl.formatMessage(messages.customWebsites)} className={featureClassName} />
78 <FeatureItem name={intl.formatMessage(messages.onPremise)} className={featureClassName} />
79 <FeatureItem name={intl.formatMessage(messages.thirdPartyServices)} className={featureClassName} />
80 <FeatureItem name={intl.formatMessage(messages.serviceProxies)} className={featureClassName} />
81 <FeatureItem name={intl.formatMessage(messages.teamManagement)} className={featureClassName} />
82 <FeatureItem name={intl.formatMessage(messages.appDelays)} className={featureClassName} />
83 <FeatureItem name={intl.formatMessage(messages.adFree)} className={featureClassName} />
84 </ul> 138 </ul>
85 ); 139 );
86 } 140 }