Skip to content

Commit 77badd3

Browse files
committed
♻️ Move all learn-more links into the new prop
1 parent c79ed52 commit 77badd3

File tree

4 files changed

+159
-185
lines changed

4 files changed

+159
-185
lines changed

modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Components/AcdcFlow.js

Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { __, sprintf } from '@wordpress/i18n';
1+
import { __ } from '@wordpress/i18n';
22

33
import BadgeBox from '../../../ReusableComponents/BadgeBox';
44
import { Separator } from '../../../ReusableComponents/Elements';
@@ -33,14 +33,13 @@ const AcdcFlow = ( { isFastlane, isPayLater, storeCountry } ) => {
3333
'woocommerce-paypal-payments'
3434
) }
3535
imageBadge={ [ 'icon-button-paypal.svg' ] }
36-
description={ sprintf(
37-
// translators: %s: Link to PayPal business fees guide
38-
__(
39-
'Our brand recognition helps give customers the confidence to buy. <a target="_blank" href="%s">Learn more</a>',
36+
description={ __(
37+
'Our brand recognition helps give customers the confidence to buy.',
4038
'woocommerce-paypal-payments'
41-
),
42-
'https://www.paypal.com/us/business/paypal-business-fees'
4339
) }
40+
learnMoreLink={
41+
'https://www.paypal.com/us/business/paypal-business-fees'
42+
}
4443
/>
4544
<Separator className="ppcp-r-page-welcome-mode-separator" />
4645
<BadgeBox
@@ -52,40 +51,37 @@ const AcdcFlow = ( { isFastlane, isPayLater, storeCountry } ) => {
5251
'icon-payment-method-paypal-small.svg',
5352
] }
5453
textBadge={ <PricingTitleBadge item="plater" /> }
55-
description={ sprintf(
56-
// translators: %s: Link to PayPal business fees guide
57-
__(
58-
'Offer installment payment options and get paid upfront. <a target="_blank" href="%s">Learn more</a>',
59-
'woocommerce-paypal-payments'
60-
),
61-
'https://www.paypal.com/us/business/paypal-business-fees'
54+
description={ __(
55+
'Offer installment payment options and get paid upfront.',
56+
'woocommerce-paypal-payments'
6257
) }
58+
learnMoreLink={
59+
'https://www.paypal.com/us/business/paypal-business-fees'
60+
}
6361
/>
6462
<Separator className="ppcp-r-page-welcome-mode-separator" />
6563
<BadgeBox
6664
title={ __( 'Venmo', 'woocommerce-paypal-payments' ) }
6765
imageBadge={ [ 'icon-button-venmo.svg' ] }
68-
description={ sprintf(
69-
// translators: %s: Link to PayPal business fees guide
70-
__(
71-
'Automatically offer Venmo checkout to millions of active users. <a target="_blank" href="%s">Learn more</a>',
72-
'woocommerce-paypal-payments'
73-
),
74-
'https://www.paypal.com/us/business/paypal-business-fees'
66+
description={ __(
67+
'Automatically offer Venmo checkout to millions of active users.',
68+
'woocommerce-paypal-payments'
7569
) }
70+
learnMoreLink={
71+
'https://www.paypal.com/us/business/paypal-business-fees'
72+
}
7673
/>
7774
<Separator className="ppcp-r-page-welcome-mode-separator" />
7875
<BadgeBox
7976
title={ __( 'Crypto', 'woocommerce-paypal-payments' ) }
8077
imageBadge={ [ 'icon-payment-method-crypto.svg' ] }
81-
description={ sprintf(
82-
// translators: %s: Link to PayPal business fees guide
83-
__(
84-
'Let customers checkout with Crypto while you get paid in cash. <a target="_blank" href="%s">Learn more</a>',
85-
'woocommerce-paypal-payments'
86-
),
87-
'https://www.paypal.com/us/business/paypal-business-fees'
78+
description={ __(
79+
'Let customers checkout with Crypto while you get paid in cash.',
80+
'woocommerce-paypal-payments'
8881
) }
82+
learnMoreLink={
83+
'https://www.paypal.com/us/business/paypal-business-fees'
84+
}
8985
/>
9086
</div>
9187
<div className="ppcp-r-welcome-docs__col">
@@ -137,14 +133,13 @@ const AcdcFlow = ( { isFastlane, isPayLater, storeCountry } ) => {
137133
'woocommerce-paypal-payments'
138134
) }
139135
imageBadge={ [ 'icon-button-paypal.svg' ] }
140-
description={ sprintf(
141-
// translators: %s: Link to PayPal REST application guide
142-
__(
143-
'Our brand recognition helps give customers the confidence to buy. <a target="_blank" href="%s">Learn more</a>',
144-
'woocommerce-paypal-payments'
145-
),
146-
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
136+
description={ __(
137+
'Our brand recognition helps give customers the confidence to buy.',
138+
'woocommerce-paypal-payments'
147139
) }
140+
learnMoreLink={
141+
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
142+
}
148143
/>
149144
<Separator className="ppcp-r-page-welcome-mode-separator" />
150145
<BadgeBox
@@ -155,14 +150,13 @@ const AcdcFlow = ( { isFastlane, isPayLater, storeCountry } ) => {
155150
imageBadge={ [
156151
'icon-payment-method-paypal-small.svg',
157152
] }
158-
description={ sprintf(
159-
// translators: %s: Link to PayPal REST application guide
160-
__(
161-
'Offer installment payment options and get paid upfront - at no extra cost to you. <a target="_blank" href="%s">Learn more</a>',
162-
'woocommerce-paypal-payments'
163-
),
164-
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
153+
description={ __(
154+
'Offer installment payment options and get paid upfront - at no extra cost to you.',
155+
'woocommerce-paypal-payments'
165156
) }
157+
learnMoreLink={
158+
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
159+
}
166160
/>
167161
</div>
168162
<div className="ppcp-r-welcome-docs__col">
@@ -213,27 +207,25 @@ const AcdcFlow = ( { isFastlane, isPayLater, storeCountry } ) => {
213207
'woocommerce-paypal-payments'
214208
) }
215209
imageBadge={ [ 'icon-button-paypal.svg' ] }
216-
description={ sprintf(
217-
// translators: %s: Link to PayPal REST application guide
218-
__(
219-
'Our brand recognition helps give customers the confidence to buy. <a target="_blank" href="%s">Learn more</a>',
220-
'woocommerce-paypal-payments'
221-
),
222-
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
210+
description={ __(
211+
'Our brand recognition helps give customers the confidence to buy.',
212+
'woocommerce-paypal-payments'
223213
) }
214+
learnMoreLink={
215+
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
216+
}
224217
/>
225218
<Separator className="ppcp-r-page-welcome-mode-separator" />
226219
<BadgeBox
227220
title={ __( 'Pay Later', 'woocommerce-paypal-payments' ) }
228221
imageBadge={ [ 'icon-payment-method-paypal-small.svg' ] }
229-
description={ sprintf(
230-
// translators: %s: Link to PayPal REST application guide
231-
__(
232-
'Offer installment payment options and get paid upfront. <a target="_blank" href="%s">Learn more</a>',
233-
'woocommerce-paypal-payments'
234-
),
235-
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
222+
description={ __(
223+
'Offer installment payment options and get paid upfront.',
224+
'woocommerce-paypal-payments'
236225
) }
226+
learnMoreLink={
227+
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input'
228+
}
237229
/>
238230
</div>
239231
<div className="ppcp-r-welcome-docs__col">

modules/ppcp-settings/resources/js/Components/Screens/Onboarding/Components/AcdcOptionalPaymentMethods.js

Lines changed: 61 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { __, sprintf } from '@wordpress/i18n';
1+
import { __ } from '@wordpress/i18n';
22

33
import BadgeBox from '../../../ReusableComponents/BadgeBox';
44
import { Separator } from '../../../ReusableComponents/Elements';
@@ -24,14 +24,13 @@ const AcdcOptionalPaymentMethods = ( {
2424
'icon-button-discover.svg',
2525
] }
2626
textBadge={ <PricingTitleBadge item="ccf" /> }
27-
description={ sprintf(
28-
// translators: %s: Link to PayPal business fees guide
29-
__(
30-
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. <a target="_blank" href="%s">Learn more</a>',
31-
'woocommerce-paypal-payments'
32-
),
33-
'https://www.paypal.com/us/business/paypal-business-fees'
27+
description={ __(
28+
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection.',
29+
'woocommerce-paypal-payments'
3430
) }
31+
learnMoreLink={
32+
'https://www.paypal.com/us/business/paypal-business-fees'
33+
}
3534
/>
3635
<Separator className="ppcp-r-optional-payment-methods__separator" />
3736
<BadgeBox
@@ -44,14 +43,13 @@ const AcdcOptionalPaymentMethods = ( {
4443
'icon-button-google-pay.svg',
4544
] }
4645
textBadge={ <PricingTitleBadge item="dw" /> }
47-
description={ sprintf(
48-
// translators: %s: Link to PayPal business fees guide
49-
__(
50-
'Accept Apple Pay on eligible devices and Google Pay through mobile and web. <a target="_blank" href="%s">Learn more</a>',
51-
'woocommerce-paypal-payments'
52-
),
53-
'https://www.paypal.com/us/business/paypal-business-fees'
46+
description={ __(
47+
'Accept Apple Pay on eligible devices and Google Pay through mobile and web.',
48+
'woocommerce-paypal-payments'
5449
) }
50+
learnMoreLink={
51+
'https://www.paypal.com/us/business/paypal-business-fees'
52+
}
5553
/>
5654
<Separator className="ppcp-r-optional-payment-methods__separator" />
5755
<BadgeBox
@@ -65,14 +63,13 @@ const AcdcOptionalPaymentMethods = ( {
6563
'icon-button-bancontact.svg',
6664
] }
6765
textBadge={ <PricingTitleBadge item="apm" /> }
68-
description={ sprintf(
69-
// translators: %s: Link to PayPal business fees guide
70-
__(
71-
'Seamless payments for customers across the globe using their preferred payment methods. <a target="_blank" href="%s">Learn more</a>',
72-
'woocommerce-paypal-payments'
73-
),
74-
'https://www.paypal.com/us/business/paypal-business-fees'
66+
description={ __(
67+
'Seamless payments for customers across the globe using their preferred payment methods.',
68+
'woocommerce-paypal-payments'
7569
) }
70+
learnMoreLink={
71+
'https://www.paypal.com/us/business/paypal-business-fees'
72+
}
7673
/>
7774
<Separator className="ppcp-r-optional-payment-methods__separator" />
7875
<BadgeBox
@@ -81,14 +78,13 @@ const AcdcOptionalPaymentMethods = ( {
8178
textBadge={
8279
<PricingTitleBadge item="fast country currency=storeCurrency=storeCountrylane" />
8380
}
84-
description={ sprintf(
85-
// translators: %s: Link to PayPal business fees guide
86-
__(
87-
'Speed up guest checkout with Fatslane. Link a customer\'s email address to their payment details. <a target="_blank" href="%s">Learn more</a>',
88-
'woocommerce-paypal-payments'
89-
),
90-
'https://www.paypal.com/us/business/paypal-business-fees'
81+
description={ __(
82+
"Speed up guest checkout with Fatslane. Link a customer's email address to their payment details.",
83+
'woocommerce-paypal-payments'
9184
) }
85+
learnMoreLink={
86+
'https://www.paypal.com/us/business/paypal-business-fees'
87+
}
9288
/>
9389
</div>
9490
);
@@ -109,14 +105,13 @@ const AcdcOptionalPaymentMethods = ( {
109105
'icon-button-discover.svg',
110106
] }
111107
textBadge={ <PricingTitleBadge item="ccf" /> }
112-
description={ sprintf(
113-
// translators: %s: Link to PayPal business fees guide
114-
__(
115-
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. <a target="_blank" href="%s">Learn more</a>',
116-
'woocommerce-paypal-payments'
117-
),
118-
'https://www.paypal.com/us/business/paypal-business-fees'
108+
description={ __(
109+
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection.',
110+
'woocommerce-paypal-payments'
119111
) }
112+
learnMoreLink={
113+
'https://www.paypal.com/us/business/paypal-business-fees'
114+
}
120115
/>
121116
<Separator className="ppcp-r-optional-payment-methods__separator" />
122117
<BadgeBox
@@ -129,14 +124,13 @@ const AcdcOptionalPaymentMethods = ( {
129124
'icon-button-google-pay.svg',
130125
] }
131126
textBadge={ <PricingTitleBadge item="dw" /> }
132-
description={ sprintf(
133-
// translators: %s: Link to PayPal business fees guide
134-
__(
135-
'Accept Apple Pay on eligible devices and Google Pay through mobile and web. <a target="_blank" href="%s">Learn more</a>',
136-
'woocommerce-paypal-payments'
137-
),
138-
'https://www.paypal.com/us/business/paypal-business-fees'
127+
description={ __(
128+
'Accept Apple Pay on eligible devices and Google Pay through mobile and web.',
129+
'woocommerce-paypal-payments'
139130
) }
131+
learnMoreLink={
132+
'https://www.paypal.com/us/business/paypal-business-fees'
133+
}
140134
/>
141135
<Separator className="ppcp-r-optional-payment-methods__separator" />
142136
<BadgeBox
@@ -151,14 +145,13 @@ const AcdcOptionalPaymentMethods = ( {
151145
'icon-button-bancontact.svg',
152146
] }
153147
textBadge={ <PricingTitleBadge item="apm" /> }
154-
description={ sprintf(
155-
// translators: %s: Link to PayPal business fees guide
156-
__(
157-
'Seamless payments for customers across the globe using their preferred payment methods. <a target="_blank" href="%s">Learn more</a>',
158-
'woocommerce-paypal-payments'
159-
),
160-
'https://www.paypal.com/us/business/paypal-business-fees'
148+
description={ __(
149+
'Seamless payments for customers across the globe using their preferred payment methods.',
150+
'woocommerce-paypal-payments'
161151
) }
152+
learnMoreLink={
153+
'https://www.paypal.com/us/business/paypal-business-fees'
154+
}
162155
/>
163156
</div>
164157
);
@@ -178,14 +171,13 @@ const AcdcOptionalPaymentMethods = ( {
178171
'icon-button-discover.svg',
179172
] }
180173
textBadge={ <PricingTitleBadge item="ccf" /> }
181-
description={ sprintf(
182-
// translators: %s: Link to PayPal business fees guide
183-
__(
184-
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. <a target="_blank" href="%s">Learn more</a>',
185-
'woocommerce-paypal-payments'
186-
),
187-
'https://www.paypal.com/us/business/paypal-business-fees'
174+
description={ __(
175+
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection.',
176+
'woocommerce-paypal-payments'
188177
) }
178+
learnMoreLink={
179+
'https://www.paypal.com/us/business/paypal-business-fees'
180+
}
189181
/>
190182
<Separator className="ppcp-r-optional-payment-methods__separator" />
191183
<BadgeBox
@@ -195,14 +187,13 @@ const AcdcOptionalPaymentMethods = ( {
195187
'icon-button-google-pay.svg',
196188
] }
197189
textBadge={ <PricingTitleBadge item="dw" /> }
198-
description={ sprintf(
199-
// translators: %s: Link to PayPal business fees guide
200-
__(
201-
'Accept Apple Pay on eligible devices and Google Pay through mobile and web. <a target="_blank" href="%s">Learn more</a>',
202-
'woocommerce-paypal-payments'
203-
),
204-
'https://www.paypal.com/us/business/paypal-business-fees'
190+
description={ __(
191+
'Accept Apple Pay on eligible devices and Google Pay through mobile and web.',
192+
'woocommerce-paypal-payments'
205193
) }
194+
learnMoreLink={
195+
'https://www.paypal.com/us/business/paypal-business-fees'
196+
}
206197
/>
207198
<Separator className="ppcp-r-optional-payment-methods__separator" />
208199
<BadgeBox
@@ -217,14 +208,13 @@ const AcdcOptionalPaymentMethods = ( {
217208
'icon-button-bancontact.svg',
218209
] }
219210
textBadge={ <PricingTitleBadge item="apm" /> }
220-
description={ sprintf(
221-
// translators: %s: Link to PayPal business fees guide
222-
__(
223-
'Seamless payments for customers across the globe using their preferred payment methods. <a target="_blank" href="%s">Learn more</a>',
224-
'woocommerce-paypal-payments'
225-
),
226-
'https://www.paypal.com/us/business/paypal-business-fees'
211+
description={ __(
212+
'Seamless payments for customers across the globe using their preferred payment methods.',
213+
'woocommerce-paypal-payments'
227214
) }
215+
learnMoreLink={
216+
'https://www.paypal.com/us/business/paypal-business-fees'
217+
}
228218
/>
229219
</div>
230220
);

0 commit comments

Comments
 (0)