-
Notifications
You must be signed in to change notification settings - Fork 2k
/
plans-comparison-features.tsx
284 lines (262 loc) · 8.41 KB
/
plans-comparison-features.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
import {
FEATURE_10K_VISITS,
FEATURE_100K_VISITS,
FEATURE_500MB_STORAGE,
FEATURE_50GB_STORAGE,
FEATURE_UNLIMITED_POSTS_PAGES,
FEATURE_UNLIMITED_ADMINS,
FEATURE_INSTALL_PLUGINS,
FEATURE_EMAIL_LIVE_CHAT_SUPPORT_ALL_DAYS,
FEATURE_PAYMENT_BLOCKS,
FEATURE_WOOCOMMERCE,
FEATURE_JETPACK_ADVANCED,
FEATURE_NO_ADS,
FEATURE_SFTP_DATABASE,
FEATURE_SITE_BACKUPS_AND_RESTORE,
FEATURE_CUSTOM_DOMAIN,
FEATURE_PREMIUM_THEMES,
} from '@automattic/calypso-products';
import { Gridicon } from '@automattic/components';
import { translate, numberFormat } from 'i18n-calypso';
import type { TranslateResult, TranslateOptionsPlural } from 'i18n-calypso';
export interface PlanComparisonFeature {
/**
* Row header
*/
title: TranslateResult;
/**
* Additional text displayed below the row header
*/
subtitle?: TranslateResult;
/**
* Popup text describing what the feature is.
*/
description?: TranslateResult;
/**
* Features that belong to this row.
*/
features: string[];
/**
* Returns cell text based on the feature key.
*
* @param {string} feature The feature constant. e.g. FEATURE_UNLIMITED_ADMINS
* @param {boolean} isMobile Whether the text is displayed on mobile.
* @returns {TranslateResult|TranslateResult[]} Array of text if there is an additional description.
*/
getCellText: (
feature: string | undefined,
isMobile: boolean,
extraArgs?: unknown
) => TranslateResult | [ TranslateResult, TranslateResult ];
}
function defaultGetCellText(
featureTitle: TranslateResult
): PlanComparisonFeature[ 'getCellText' ] {
return ( feature, isMobile = false ) => {
if ( ! isMobile ) {
if ( feature ) {
return (
<>
<Gridicon icon="checkmark" />
{ translate( 'Included' ) }
</>
);
}
return (
<>
<Gridicon icon="cross" />
{ translate( 'Not included' ) }
</>
);
}
return feature
? translate( '%(featureTitle)s included', { args: { featureTitle } } )
: translate( '%(featureTitle)s {{strong}}not{{/strong}} included', {
args: { featureTitle },
components: { strong: <strong /> },
} );
};
}
export const planComparisonFeatures: PlanComparisonFeature[] = [
{
title: translate( 'Custom Domain Name' ),
description: translate(
'Get a personalized online address that’s easy to remember and easy to share.'
),
features: [ FEATURE_CUSTOM_DOMAIN ],
getCellText: ( feature, isMobile = false ) => {
if ( ! isMobile ) {
if ( feature ) {
return (
<>
<Gridicon icon="checkmark" />
{ translate( 'Free for one year!' ) }
</>
);
}
return (
<>
<Gridicon icon="cross" />
{ translate( 'Not included' ) }
</>
);
}
return feature
? translate( 'Custom Domain Name is free for one year!' )
: translate( 'Custom Domain Name is not included' );
},
},
{
title: translate( 'Premium themes' ),
description: translate(
'Gain access to advanced, professional & beautiful premium design templates including themes specifically tailored for businesses.'
),
features: [ FEATURE_PREMIUM_THEMES ],
getCellText: defaultGetCellText( translate( 'Premium themes' ) ),
},
{
title: translate( 'Unlimited Email and Live Chat Support' ),
description: translate(
'Customer service isn’t just something we offer. It’s who we are. Over 30% of WordPress.com is dedicated to service. We call it Happiness—real support delivered by real human beings who specialize in launching and fine-tuning WordPress sites. '
),
features: [ FEATURE_EMAIL_LIVE_CHAT_SUPPORT_ALL_DAYS ],
getCellText: defaultGetCellText( translate( 'Unlimited Email and Live Chat Support' ) ),
},
{
title: translate( 'WordPress Plugins' ),
subtitle: translate( 'Use any WordPress plugins on your site' ),
description: translate(
'Install WordPress plugins and extend functionality for your site with access to more than 50,000 WordPress plugins'
),
features: [ FEATURE_INSTALL_PLUGINS ],
getCellText: ( feature, isMobile = false ) => {
const pluginCount = 0;
if ( ! isMobile ) {
return feature ? translate( 'Unlimited' ) : String( pluginCount );
}
return feature
? translate( 'Unlimited WordPress Plugins' )
: translate( '%(pluginCount)s WordPress Plugin', '%(pluginCount)s WordPress Plugins', {
count: pluginCount,
args: { pluginCount: numberFormat( pluginCount, 0 ) },
} );
},
},
{
title: translate( 'Storage space' ),
description: translate(
'The free plan allows a maximum storage of 500MB, which equals to approximately 100 high quality images, whilst with Managed WordPress you may go all the way up to 50GB, enough space for 10,000 high quality images of the same size.'
),
features: [ FEATURE_500MB_STORAGE, FEATURE_50GB_STORAGE ],
getCellText: ( feature, isMobile = false ) => {
let storageSize = '0.5';
if ( feature === FEATURE_50GB_STORAGE ) {
storageSize = '50';
}
if ( isMobile ) {
return translate( '%sGB of storage', {
args: [ storageSize ],
} );
}
return translate( '%sGB', {
args: [ storageSize ],
comment: '%s is a number of gigabytes.',
} );
},
},
{
title: translate( 'Sell products with WooCommerce' ),
description: translate(
'Includes one-click payments, premium store designs and personalized expert support.'
),
features: [ FEATURE_WOOCOMMERCE ],
getCellText: defaultGetCellText( translate( 'Sell products with WooCommerce' ) ),
},
{
title: translate( 'Visits per month' ),
description: translate(
"WordPress Managed bundles up to 100,000 visits a month to help you rest assured traffic won't be a concern."
),
features: [ FEATURE_10K_VISITS, FEATURE_100K_VISITS ],
getCellText: ( feature, isMobile = false ) => {
let visitCount = 0;
if ( feature === FEATURE_10K_VISITS ) {
visitCount = 10_000;
} else if ( feature === FEATURE_100K_VISITS ) {
visitCount = 100_000;
}
const opts: TranslateOptionsPlural = {
count: visitCount,
args: { visitCount: numberFormat( visitCount, 0 ) },
};
return isMobile
? translate( '%(visitCount)s visit per month', '%(visitCount)s visits per month', opts )
: translate( '%(visitCount)s visit', '%(visitCount)s visits', opts );
},
},
{
title: translate( 'Blog posts and pages' ),
description: translate( 'Popup text placeholder' ),
features: [ FEATURE_UNLIMITED_POSTS_PAGES ],
getCellText: ( _, isMobile = false ) => {
if ( ! isMobile ) {
return translate( 'Unlimited' );
}
return translate( 'Unlimited blog posts and pages' );
},
},
{
title: translate( 'Admin users' ),
description: translate( 'Popup text placeholder' ),
features: [ FEATURE_UNLIMITED_ADMINS ],
getCellText: ( feature, isMobile ) => {
const adminCount = 1;
if ( ! isMobile ) {
return feature ? translate( 'Unlimited' ) : String( adminCount );
}
return feature
? translate( 'Unlimited admin users' )
: translate( '%(adminCount)s admin user', '%(adminCount)s admin users', {
count: adminCount,
args: { adminCount: numberFormat( adminCount, 0 ) },
} );
},
},
{
title: translate( 'Payment blocks' ),
description: translate( 'Popup text placeholder' ),
features: [ FEATURE_PAYMENT_BLOCKS ],
getCellText: defaultGetCellText( translate( 'Payment blocks' ) ),
},
{
title: translate( 'Jetpack' ),
description: translate(
'Speed up your site’s performance and protect it from spammers. ' +
'Access detailed records of all activity on your site and restore your site ' +
'to a previous point in time with just a click! While you’re at it, ' +
'improve your SEO with our Advanced SEO tools and automate social media sharing.'
),
features: [ FEATURE_JETPACK_ADVANCED ],
getCellText: defaultGetCellText( translate( 'Jetpack' ) ),
},
{
title: translate( 'Remove ads' ),
description: translate(
'Allow your visitors to visit and read your website without seeing any WordPress.com advertising.'
),
features: [ FEATURE_NO_ADS ],
getCellText: defaultGetCellText( translate( 'Remove ads' ) ),
},
{
title: translate( 'SFTP, Database access' ),
description: translate( 'Popup text placeholder' ),
features: [ FEATURE_SFTP_DATABASE ],
getCellText: defaultGetCellText( translate( 'SFTP, Database access' ) ),
},
{
title: translate( 'Automated backups' ),
description: translate( 'Automated site backups and one-click restore' ),
features: [ FEATURE_SITE_BACKUPS_AND_RESTORE ],
getCellText: defaultGetCellText( translate( 'Automated backups' ) ),
},
];