Skip to content

Commit d8b3f81

Browse files
authored
Merge branch 'develop' into update/remove-payout-status-icon
2 parents 967ff6d + 1b5a4f7 commit d8b3f81

24 files changed

+907
-29
lines changed

.stylelintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
"media-feature-parentheses-space-inside": "always",
1616
"no-descending-specificity": null,
1717
"no-duplicate-selectors": null,
18+
"property-no-unknown": [
19+
true,
20+
{
21+
"ignoreProperties": [
22+
"container-type",
23+
"container-name"
24+
]
25+
}
26+
],
1827
"rule-empty-line-before": null,
1928
"selector-class-pattern": null,
2029
"selector-pseudo-class-parentheses-space-inside": "always",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Significance: patch
2+
Type: dev
3+
Comment: Dev only changes to run E2E tests with QIT.

changelog/dev-qit-e2e-foundation

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: dev
3+
Comment: Add foundation to run E2E tests with QIT and basic tests.
4+
5+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Fix WooPay express button text clipping
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: update
3+
4+
Change payout texts for New Account Waiting Period to be consistent with new Account Details

client/checkout/woopay/express-button/style.scss

Lines changed: 113 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#wcpay-woopay-button {
2+
// Enable container queries on the button wrapper
3+
container-type: inline-size;
4+
container-name: woopay-button;
5+
26
.woopay-express-button {
37
font-size: 18px;
48
font-weight: 500;
@@ -18,13 +22,15 @@
1822
text-transform: none;
1923
list-style-type: none;
2024
min-height: auto;
25+
overflow: hidden;
2126
position: relative;
2227

2328
.button-content {
2429
display: flex;
25-
align-content: center;
30+
align-items: center;
2631
justify-content: center;
2732
transform: scale( 0.9 );
33+
max-width: 100%;
2834
}
2935

3036
&:not( :disabled ) {
@@ -57,11 +63,42 @@
5763
&[data-type='buy'],
5864
&[data-type='book'],
5965
&[data-type='donate'] {
60-
min-width: 200px;
66+
min-width: 150px;
6167

6268
svg {
6369
margin-left: 5px;
6470
}
71+
72+
// Container queries for small buttons (40px height)
73+
@container woopay-button (max-width: 280px) {
74+
font-size: 14px;
75+
letter-spacing: 0.5px;
76+
77+
svg {
78+
width: 88px;
79+
margin-left: 4px;
80+
}
81+
}
82+
83+
@container woopay-button (max-width: 240px) {
84+
font-size: 12px;
85+
letter-spacing: 0.3px;
86+
87+
svg {
88+
width: 84px;
89+
margin-left: 3px;
90+
}
91+
}
92+
93+
@container woopay-button (max-width: 200px) {
94+
font-size: 10px;
95+
letter-spacing: 0.2px;
96+
97+
svg {
98+
width: 80px;
99+
margin-left: 2px;
100+
}
101+
}
65102
}
66103

67104
&[data-theme='dark'] {
@@ -91,7 +128,46 @@
91128
&[data-type='buy'],
92129
&[data-type='book'],
93130
&[data-type='donate'] {
94-
min-width: 229px;
131+
min-width: 150px;
132+
133+
// Container queries: respond to actual button container width
134+
// These trigger based on the button's actual width in the layout
135+
136+
// Default state for wide containers (> 280px)
137+
// Uses default 18px font, 99px logo from parent
138+
139+
// When container is moderately constrained
140+
@container woopay-button (max-width: 280px) {
141+
font-size: 15px;
142+
letter-spacing: 0.5px;
143+
144+
svg {
145+
width: 90px;
146+
margin-left: 4px;
147+
}
148+
}
149+
150+
// When container is squeezed (common in 3-button horizontal layouts)
151+
@container woopay-button (max-width: 240px) {
152+
font-size: 13px;
153+
letter-spacing: 0.3px;
154+
155+
svg {
156+
width: 86px;
157+
margin-left: 3px;
158+
}
159+
}
160+
161+
// When container is very tight
162+
@container woopay-button (max-width: 200px) {
163+
font-size: 11px;
164+
letter-spacing: 0.2px;
165+
166+
svg {
167+
width: 82px;
168+
margin-left: 2px;
169+
}
170+
}
95171
}
96172

97173
.button-content {
@@ -105,7 +181,40 @@
105181
&[data-type='buy'],
106182
&[data-type='book'],
107183
&[data-type='donate'] {
108-
min-width: 229px;
184+
min-width: 150px;
185+
186+
// Container queries for large buttons
187+
// Slightly larger than medium buttons at each breakpoint
188+
189+
@container woopay-button (max-width: 280px) {
190+
font-size: 16px;
191+
letter-spacing: 0.6px;
192+
193+
svg {
194+
width: 93px;
195+
margin-left: 4px;
196+
}
197+
}
198+
199+
@container woopay-button (max-width: 240px) {
200+
font-size: 14px;
201+
letter-spacing: 0.4px;
202+
203+
svg {
204+
width: 89px;
205+
margin-left: 3px;
206+
}
207+
}
208+
209+
@container woopay-button (max-width: 200px) {
210+
font-size: 12px;
211+
letter-spacing: 0.3px;
212+
213+
svg {
214+
width: 85px;
215+
margin-left: 2px;
216+
}
217+
}
109218
}
110219

111220
.button-content {

client/components/deposits-overview/__tests__/index.test.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,12 @@ describe( 'Deposits Overview information', () => {
306306
setSelectedCurrency: mockSetSelectedCurrency,
307307
} );
308308
const { getByText, queryByText } = render( <DepositsOverview /> );
309-
getByText( /Your first payout is held for/, {
310-
ignore: '.a11y-speak-region',
311-
} );
309+
getByText(
310+
/Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete/,
311+
{
312+
ignore: '.a11y-speak-region',
313+
}
314+
);
312315
expect( queryByText( 'Change deposit schedule' ) ).toBeFalsy();
313316
expect( queryByText( 'View full deposits history' ) ).toBeFalsy();
314317
} );
@@ -426,7 +429,11 @@ describe( 'Deposits Overview information', () => {
426429
} );
427430

428431
const { queryByText } = render( <DepositsOverview /> );
429-
expect( queryByText( /Your first payout is held for/ ) ).toBeFalsy();
432+
expect(
433+
queryByText(
434+
/Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete/
435+
)
436+
).toBeFalsy();
430437
} );
431438

432439
test( 'Confirm new account waiting period notice shows if within waiting period', () => {
@@ -444,10 +451,13 @@ describe( 'Deposits Overview information', () => {
444451
} );
445452

446453
const { getByText, getByRole } = render( <DepositsOverview /> );
447-
getByText( /Your first payout is held for/, {
448-
ignore: '.a11y-speak-region',
449-
} );
450-
expect( getByRole( 'link', { name: /Why\?/ } ) ).toHaveAttribute(
454+
getByText(
455+
/Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete/,
456+
{
457+
ignore: '.a11y-speak-region',
458+
}
459+
);
460+
expect( getByRole( 'link', { name: /Learn more/ } ) ).toHaveAttribute(
451461
'href',
452462
'https://woocommerce.com/document/woopayments/payouts/payout-schedule/#new-accounts'
453463
);

client/components/deposits-overview/deposit-notices.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ export const NewAccountWaitingPeriodNotice: React.FC = () => (
5858
>
5959
{ interpolateComponents( {
6060
mixedString: __(
61-
'Your first payout is held for 7-14 days. {{whyLink}}Why?{{/whyLink}}',
61+
'Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete. {{learnMoreLink}}Learn more{{/learnMoreLink}}',
6262
'woocommerce-payments'
6363
),
6464
components: {
65-
whyLink: (
65+
learnMoreLink: (
6666
// Link content is in the format string above. Consider disabling jsx-a11y/anchor-has-content.
6767
// eslint-disable-next-line jsx-a11y/anchor-has-content
6868
<a

client/settings/deposits/__tests__/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe( 'Deposits', () => {
163163
);
164164

165165
const depositsMessage = screen.getByText(
166-
/Your first payout will be held for/,
166+
/Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete/,
167167
{
168168
ignore: '.a11y-speak-region',
169169
}

client/settings/deposits/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ const DepositsSchedule = () => {
189189
<InlineNotice status="warning" isDismissible={ false } icon>
190190
{ interpolateComponents( {
191191
mixedString: __(
192-
'Your first payout will be held for 7-14 days. ' +
193-
'Payout scheduling will be available after this period. {{learnMoreLink}}Learn more{{/learnMoreLink}}',
192+
'Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete.' +
193+
' ' +
194+
'{{learnMoreLink}}Learn more{{/learnMoreLink}}',
194195
'woocommerce-payments'
195196
),
196197
components: {

0 commit comments

Comments
 (0)