Skip to content

Commit 920246f

Browse files
committed
Use CSS empty selector to remove spacing
1 parent b7fc6e8 commit 920246f

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

client/checkout/blocks/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ button.wcpay-stripelink-modal-trigger:hover {
9292
}
9393
}
9494

95+
#remember-me:empty {
96+
margin-bottom: 0;
97+
}
98+
9599
#payment-method {
96100
/* stylelint-disable-next-line selector-id-pattern */
97101
#radio-control-wc-payment-method-options-woocommerce_payments_affirm__label

client/components/woopay/save-user/checkout-page-save-user.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,31 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => {
6464
const viewportWidth = window.document.documentElement.clientWidth;
6565
const viewportHeight = window.document.documentElement.clientHeight;
6666

67-
const woopayComponent = isBlocksCheckout
68-
? document.querySelector( '#remember-me' )
69-
: document.querySelector( '.woopay-save-new-user-container' );
70-
7167
useEffect( () => {
7268
if ( ! isBlocksCheckout ) {
7369
return;
7470
}
7571

76-
if ( ! woopayComponent ) {
72+
const rememberMe = document.querySelector( '#remember-me' );
73+
74+
if ( ! rememberMe ) {
7775
return;
7876
}
7977

8078
if ( checkoutIsProcessing ) {
81-
woopayComponent.classList.add(
79+
rememberMe.classList.add(
8280
'wc-block-components-checkout-step--disabled'
8381
);
84-
woopayComponent.setAttribute( 'disabled', 'disabled' );
82+
rememberMe.setAttribute( 'disabled', 'disabled' );
8583

8684
return;
8785
}
8886

89-
woopayComponent.classList.remove(
87+
rememberMe.classList.remove(
9088
'wc-block-components-checkout-step--disabled'
9189
);
92-
woopayComponent.removeAttribute( 'disabled', 'disabled' );
93-
}, [ woopayComponent, checkoutIsProcessing, isBlocksCheckout ] );
90+
rememberMe.removeAttribute( 'disabled', 'disabled' );
91+
}, [ checkoutIsProcessing, isBlocksCheckout ] );
9492

9593
const getPhoneFieldValue = useCallback( () => {
9694
let phoneFieldValue = '';
@@ -305,13 +303,9 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => {
305303
! isWCPayWithNewTokenChosen ||
306304
isRegisteredUser
307305
) {
308-
woopayComponent.style.display = 'none';
309-
310306
return null;
311307
}
312308

313-
woopayComponent.style.display = 'block';
314-
315309
return (
316310
<Container isBlocksCheckout={ isBlocksCheckout }>
317311
<div className="save-details">

client/components/woopay/save-user/style.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
.woocommerce-checkout-payment {
2-
.woopay-save-new-user-container {
3-
padding: 1.41575em;
4-
}
5-
}
6-
71
.woopay-save-new-user-container {
82
.save-details {
93
.wc-block-components-text-input input:-webkit-autofill {

0 commit comments

Comments
 (0)