-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdefaultChoiceCardSettings.ts
More file actions
109 lines (102 loc) · 3.43 KB
/
defaultChoiceCardSettings.ts
File metadata and controls
109 lines (102 loc) · 3.43 KB
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
import type { CountryGroupId } from '../../../shared/lib';
import type { ChoiceCard, ChoiceCardsSettings } from '../../../shared/types/props/choiceCards';
const currencySymbolTemplate = '%%CURRENCY_SYMBOL%%';
const oneOffCard = (countryGroupId: CountryGroupId): ChoiceCard => ({
product: {
supportTier: 'OneOff',
},
label:
countryGroupId === 'UnitedStates'
? `Support once from just ${currencySymbolTemplate}1`
: `Support with another amount`,
isDefault: false,
benefits: [
{
copy:
countryGroupId === 'UnitedStates'
? `We welcome support of any size, any time - whether you choose to give ${currencySymbolTemplate}1 or more`
: 'We welcome support of any size, any time',
},
],
destination: 'LandingPage',
});
const fullChoiceCards = (countryGroupId: CountryGroupId): ChoiceCard[] => [
{
product: {
supportTier: 'Contribution',
ratePlan: 'Monthly',
},
label: '', // label is generated for recurring products
isDefault: false,
benefits: [
{
copy: 'Give to the Guardian every month with Support',
},
],
destination: 'LandingPage',
},
{
product: {
supportTier: 'SupporterPlus',
ratePlan: 'Monthly',
},
label: '', // label is generated for recurring products
isDefault: true,
benefitsLabel: 'Unlock <strong>All-access digital</strong> benefits:',
benefits: [
{ copy: 'Far fewer asks for support' },
{ copy: 'Ad-free reading on all your devices' },
{ copy: 'Unlimited access to the premium Guardian app' },
{
copy: 'Exclusive newsletter for supporters, sent every week from the Guardian newsroom',
},
{ copy: 'Unlimited access to our new Guardian Feast App' },
],
pill: {
copy: 'Recommended',
},
destination: 'LandingPage',
},
oneOffCard(countryGroupId),
];
const shorterChoiceCards = (countryGroupId: CountryGroupId): ChoiceCard[] => [
{
product: {
supportTier: 'Contribution',
ratePlan: 'Monthly',
},
label: '', // label is generated for recurring products
isDefault: false,
benefits: [
{
copy: 'Give to the Guardian every month with Support',
},
],
},
{
product: {
supportTier: 'SupporterPlus',
ratePlan: 'Monthly',
},
label: '', // label is generated for recurring products
isDefault: true,
benefits: [
{ copy: 'Far fewer asks for support' },
{ copy: 'Ad-free reading on all your devices' },
],
pill: {
copy: 'Recommended',
},
destination: 'LandingPage',
},
oneOffCard(countryGroupId),
];
const defaultEpicChoiceCardsSettings = (countryGroupId: CountryGroupId): ChoiceCardsSettings => ({
choiceCards: fullChoiceCards(countryGroupId),
// same on mobile
});
const defaultBannerChoiceCardsSettings = (countryGroupId: CountryGroupId): ChoiceCardsSettings => ({
choiceCards: shorterChoiceCards(countryGroupId),
// same on mobile
});
export { currencySymbolTemplate, defaultEpicChoiceCardsSettings, defaultBannerChoiceCardsSettings };