Skip to content

Commit c3501ad

Browse files
authored
Merge pull request #1208 from paypal/develop
2 parents a6ecb2d + 24d097c commit c3501ad

File tree

126 files changed

+217
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+217
-205
lines changed

content/modals/US/v2_long_term_xo.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"meta": {
33
"product": "PAY_LATER_LONG_TERM",
4-
"useV4Design": "true",
4+
"useV5Design": "true",
55
"offerCountry": "US",
66
"variables": {
77
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",
@@ -28,11 +28,14 @@
2828
"genericError": "Something went wrong. Please try again later."
2929
},
3030
"genericDisclaimer": "Terms vary based on purchase amount and your credit.",
31-
"instructions": [
32-
"Explore plan options. No sign-up fees or late fees.",
33-
"Choose a plan and pay nothing today.",
34-
"Use autopay for your payments. It's easy!"
35-
],
31+
"instructions": {
32+
"instructionsHeadline": "How it works",
33+
"instructionsSubHeadline": [
34+
"Explore plan options. No sign-up fees or late fees.",
35+
"Choose a plan and pay nothing today.",
36+
"Use autopay for your payments. It's easy!"
37+
]
38+
},
3639
"cta": {
3740
"buttonTextEligible": "Continue with Pay Monthly",
3841
"buttonTextIneligible": "Back to Checkout",

content/modals/US/v2_short_term_xo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"qualifying": "{qualifying_offer}",
88
"amount": "{transaction_amount}",
99
"apr": "{apr}",
10-
"useV4Design": "true",
10+
"useV5Design": "true",
1111
"preapproved": "false",
1212
"variables": {
1313
"transaction_amount": "${eval(transaction_amount ? transaction_amount : '-')}",

src/components/modal/v2/parts/Calculator.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const Calculator = ({
6969
setExpandedState,
7070
calculator,
7171
aprDisclaimer,
72+
cta,
7273
useV4Design,
7374
useV5Design,
7475
use5Dot1Design,
@@ -194,16 +195,22 @@ const Calculator = ({
194195
<div
195196
className={`calculator ${useNewCheckoutDesign === 'true' ? 'checkout' : ''} ${
196197
useV5Design === 'true' ? 'v5Design' : ''
197-
}`}
198+
} ${cta ? 'border-checkout' : ''}`}
198199
>
199200
<form
200201
className={`form ${useV4Design === 'true' ? 'v4Design' : ''} ${
201202
useV5Design === 'true' ? 'v5Design' : ''
202203
} ${useNewCheckoutDesign === 'true' ? 'checkout' : ''}`}
203204
onSubmit={submit}
204205
>
205-
<h3 className="title">{!hasInitialAmount ? genericTitle || title : title}</h3>
206-
<div className={`input__wrapper transitional ${useV5Design === 'true' ? 'v5Design' : ''}`}>
206+
<h3 className={`title ${cta ? 'checkout-title' : ''}`}>
207+
{!hasInitialAmount ? genericTitle || title : title}
208+
</h3>
209+
<div
210+
className={`input__wrapper transitional ${useV5Design === 'true' ? 'v5Design' : ''} ${
211+
cta ? 'checkout' : ''
212+
}`}
213+
>
207214
<label htmlFor="purchase-amount" className={`input__label ${country}`}>
208215
{renderInputLabelOnEmptyField(country)}
209216
</label>

src/components/modal/v2/parts/CheckoutHeader.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const CheckoutHeader = ({
1010
isQualifying = 'false',
1111
qualifyingSubheadline,
1212
closeButtonLabel = 'Close',
13-
viewName,
1413
preapprovalHeadline,
1514
preapprovalSubHeadline,
1615
preapprovalLabel,
@@ -34,13 +33,6 @@ const CheckoutHeader = ({
3433
// Used to specifically target styles to a specific country
3534
const countryClassName = country?.toLowerCase();
3635

37-
const getCardArt = (view, countryName) => {
38-
if (countryName === 'GB') {
39-
return 'pay-in-3-card';
40-
}
41-
return view === 'PAY_LATER_LONG_TERM' ? 'pay-monthly-card' : 'pay-in-4-card';
42-
};
43-
4436
// IMPORTANT: These elements cannot be nested inside of other elements.
4537
// They are using very precise CSS position sticky rules that require this
4638
// specific adjacent DOM structure
@@ -73,7 +65,7 @@ const CheckoutHeader = ({
7365
</div>
7466
<div className="checkout header__content">
7567
<div className="header__card-container">
76-
<Icon name={getCardArt(viewName, country)} />
68+
<Icon name="logo" />
7769
</div>
7870
<div className="preapproved">
7971
<h2

src/components/modal/v2/parts/Header.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Header = ({
5555
<div className="header__icons">
5656
<div className={`logo__wrapper ${isScrolled ? 'logo__wrapper--scroll' : ''}`}>
5757
<div className="pp-logo">
58-
<Icon name={useV5Design ? 'logo_v5' : 'logo'} />
58+
<Icon name="logo" />
5959
</div>
6060
</div>
6161
{!isLander && (
@@ -69,7 +69,7 @@ const Header = ({
6969
aria-keyshortcuts="escape"
7070
onClick={() => handleClose('Close Button')}
7171
>
72-
<Icon name={useV5Design ? 'close_v5' : 'close'} />
72+
<Icon name="close" />
7373
</button>
7474
)}
7575
<div className="header__fixed-wrapper header__fixed-wrapper--front">

src/components/modal/v2/parts/Icon.jsx

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,14 @@
11
/** @jsx h */
22
import { h } from 'preact';
33

4-
const Icon = ({ name = '', color, content }) => {
4+
const Icon = ({ name = '', content }) => {
55
if (content) {
66
// eslint-disable-next-line react/no-danger
77
return <div aria-hidden="true" className="icon__wrapper" dangerouslySetInnerHTML={{ __html: content }} />;
88
}
99

1010
switch (name) {
1111
case 'logo':
12-
return (
13-
<svg
14-
role="img"
15-
aria-label="PayPal"
16-
width="45"
17-
height="45"
18-
viewBox="0 0 258 258"
19-
fill="none"
20-
xmlns="http://www.w3.org/2000/svg"
21-
>
22-
<title>PayPal</title>
23-
<path
24-
d="M190.709 84.0373C191.182 59.4578 170.902 40.5938 143.016 40.5938H85.3376C83.9939 40.594 82.6944 41.0737 81.6729 41.9467C80.6514 42.8197 79.975 44.0286 79.7654 45.3558L56.6551 189.763C56.5517 190.418 56.5913 191.086 56.7713 191.724C56.9513 192.361 57.2673 192.952 57.6976 193.456C58.1278 193.96 58.6622 194.364 59.2638 194.641C59.8654 194.919 60.5199 195.062 61.1823 195.062H95.353L90.0133 228.507C89.9103 229.161 89.9502 229.83 90.1303 230.467C90.3105 231.104 90.6265 231.695 91.0568 232.198C91.487 232.702 92.0212 233.106 92.6227 233.383C93.2241 233.66 93.8784 233.804 94.5406 233.804H122.377C123.72 233.804 124.918 233.324 125.939 232.451C126.961 231.578 127.127 230.369 127.336 229.042L135.506 180.965C135.715 179.638 136.391 177.918 137.413 177.044C138.434 176.171 139.326 175.691 140.67 175.69H157.705C185.013 175.69 208.185 156.28 212.421 129.283C215.418 110.118 207.202 92.6834 190.709 84.0373Z"
25-
fill="#001C64"
26-
/>
27-
<path
28-
d="M102.745 141.81L94.2348 195.776L88.8951 229.629C88.792 230.283 88.8319 230.952 89.0121 231.589C89.1922 232.227 89.5083 232.817 89.9385 233.321C90.3688 233.824 90.903 234.228 91.5044 234.505C92.1058 234.783 92.7601 234.926 93.4223 234.926H122.881C124.225 234.926 125.524 234.446 126.546 233.573C127.567 232.7 128.244 231.491 128.453 230.164L136.215 180.964C136.424 179.637 137.1 178.427 138.122 177.554C139.143 176.681 140.443 176.2 141.787 176.2H159.129C186.437 176.2 209.608 156.279 213.844 129.282C216.848 110.119 207.202 92.6847 190.709 84.0387C190.669 86.0796 190.49 88.1155 190.174 90.1322C185.94 117.127 162.765 137.05 135.459 137.05H108.318C106.974 137.05 105.674 137.53 104.653 138.403C103.631 139.276 102.955 140.483 102.745 141.81Z"
29-
fill="#0070E0"
30-
/>
31-
<path
32-
d="M94.2305 195.776H59.9576C59.2953 195.776 58.6408 195.633 58.0392 195.356C57.4376 195.079 56.9032 194.675 56.4729 194.171C56.0426 193.668 55.7265 193.077 55.5466 192.44C55.3666 191.802 55.3269 191.133 55.4304 190.479L78.5407 43.927C78.7503 42.5998 79.4267 41.3909 80.4482 40.5179C81.4697 39.645 82.7692 39.1652 84.1129 39.165H143.017C170.903 39.165 191.183 59.4588 190.709 84.0384C183.77 80.4003 175.618 78.3172 166.685 78.3172H117.576C116.231 78.3175 114.932 78.7976 113.91 79.671C112.889 80.5444 112.212 81.7538 112.003 83.0815L102.75 141.81L94.2305 195.776Z"
33-
fill="#003087"
34-
/>
35-
</svg>
36-
);
37-
case 'logo_v5':
3812
return (
3913
<svg
4014
role="img"
@@ -189,32 +163,6 @@ const Icon = ({ name = '', color, content }) => {
189163
</svg>
190164
);
191165
case 'close':
192-
return (
193-
<svg
194-
aria-hidden="true"
195-
width="36"
196-
height="36"
197-
viewBox="0 0 36 36"
198-
fill="none"
199-
xmlns="http://www.w3.org/2000/svg"
200-
>
201-
<path
202-
d="M12 0L0 12"
203-
transform="translate(12 12)"
204-
stroke={color || '#2C2E2F'}
205-
stroke-width="2"
206-
stroke-linecap="round"
207-
/>
208-
<path
209-
d="M0 0L12 12"
210-
transform="translate(12 12)"
211-
stroke={color || '#2C2E2F'}
212-
stroke-width="2"
213-
stroke-linecap="round"
214-
/>
215-
</svg>
216-
);
217-
case 'close_v5':
218166
return (
219167
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
220168
<path
@@ -227,12 +175,11 @@ const Icon = ({ name = '', color, content }) => {
227175
);
228176
case 'chevron-left':
229177
return (
230-
<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg">
178+
<svg width="24" height="24" viewBox="0 0 48 40" fill="none" xmlns="http://www.w3.org/2000/svg">
179+
<rect x="4" width="40" height="40" rx="20" fill="#EDF0F2" />
231180
<path
232-
fill-rule="evenodd"
233-
clip-rule="evenodd"
234-
d="M16.203 4.793a1 1 0 0 1 0 1.414L9.91 12.5l6.293 6.293a1 1 0 0 1-1.414 1.414l-6.993-6.993a1.01 1.01 0 0 1 0-1.428l6.993-6.993a1 1 0 0 1 1.414 0Z"
235-
fill="#545D68"
181+
d="M26.5005 13.1245C26.6662 13.1246 26.8247 13.1909 26.9419 13.3081C27.0591 13.4253 27.1254 13.5838 27.1255 13.7495C27.1255 13.9154 27.0592 14.0746 26.9419 14.1919L21.1333 19.9995L26.9419 25.8081C26.9999 25.8661 27.0462 25.9345 27.0776 26.0103C27.109 26.086 27.1254 26.1675 27.1255 26.2495C27.1255 26.3315 27.109 26.413 27.0776 26.4888C27.0462 26.5646 27 26.6338 26.9419 26.6919C26.8839 26.7498 26.8155 26.7962 26.7397 26.8276C26.664 26.859 26.5825 26.8754 26.5005 26.8755C26.4185 26.8755 26.337 26.859 26.2612 26.8276C26.1854 26.7962 26.1162 26.75 26.0581 26.6919L19.8081 20.4419C19.7501 20.384 19.7038 20.3154 19.6724 20.2397C19.6409 20.1639 19.6245 20.0816 19.6245 19.9995C19.6246 19.9175 19.641 19.836 19.6724 19.7603C19.7038 19.6845 19.7501 19.616 19.8081 19.5581L26.0581 13.3081C26.1754 13.1908 26.3346 13.1245 26.5005 13.1245Z"
182+
fill="black"
236183
/>
237184
</svg>
238185
);

src/components/modal/v2/parts/Instructions.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { currencyFormat } from '../lib';
44

55
const Instructions = ({
66
instructions,
7+
cta,
78
expandedState = false,
89
className = '',
910
useV4Design,
@@ -111,7 +112,7 @@ const Instructions = ({
111112
useNewCheckoutDesign === 'true' ? 'checkout' : ''
112113
}`}
113114
>
114-
{renderInstructionsContent()}
115+
<div className={`${cta ? 'instructions__border-checkout' : ''}`}>{renderInstructionsContent()}</div>
115116
</div>
116117
);
117118
};

src/components/modal/v2/parts/views/LongTerm/Content.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export const LongTerm = ({
162162
<Calculator
163163
setExpandedState={setExpandedState}
164164
calculator={calculator}
165+
cta={cta}
165166
aprDisclaimer={offerAPRDisclaimers}
166167
useV4Design={useV4Design}
167168
useV5Design={useV5Design}
@@ -176,6 +177,7 @@ export const LongTerm = ({
176177
</div>
177178
<Instructions
178179
instructions={instructions}
180+
cta={cta}
179181
useV4Design={useV4Design}
180182
useV5Design={useV5Design}
181183
useNewCheckoutDesign={useNewCheckoutDesign}

src/components/modal/v2/parts/views/LongTerm/styles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@
8282
}
8383

8484
.checkout {
85-
background: $ql-gray;
86-
}
85+
background: $white;
86+
}

src/components/modal/v2/parts/views/ShortTerm/Content.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,11 @@ export const ShortTerm = ({
140140
timeStamp={installment?.payment_date ?? donutTimestamps[index]}
141141
numOfPayments={elements.length}
142142
/>
143-
{useV5Design === 'true' && useNewCheckoutDesign === 'true' && (
144-
<span className={`dashed-line-${index}`} />
145-
)}
143+
{country === 'GB' &&
144+
useV5Design === 'true' &&
145+
useNewCheckoutDesign === 'true' && (
146+
<span className={`dashed-line-${index}`} />
147+
)}
146148
</Fragment>
147149
))}
148150
</div>
@@ -157,6 +159,7 @@ export const ShortTerm = ({
157159
)}
158160
<Instructions
159161
instructions={instructions}
162+
cta={cta}
160163
useV4Design={useV4Design}
161164
useV5Design={useV5Design}
162165
useNewCheckoutDesign={useNewCheckoutDesign}

0 commit comments

Comments
 (0)