Skip to content

Commit 5c53982

Browse files
committed
simplify the implementation & add the top margin for ECE when ready only
1 parent bddfdc9 commit 5c53982

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

client/checkout/express-checkout-buttons.scss

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,11 @@
1919
padding: 0;
2020
height: 0;
2121
}
22-
}
2322

24-
&.is-ready {
25-
#wcpay-express-checkout-element {
23+
&.is-ready {
24+
margin-top: 12px;
2625
opacity: 1;
2726
}
28-
29-
#wcpay-express-checkout-button-separator {
30-
opacity: 1;
31-
}
32-
}
33-
34-
// WooPay button is always visible
35-
#wcpay-woopay-button {
36-
opacity: 1;
3727
}
3828

3929
.woocommerce-cart & {
@@ -43,14 +33,6 @@
4333
.woocommerce-checkout & {
4434
margin-top: 0;
4535
}
46-
47-
> div {
48-
margin-bottom: 12px;
49-
50-
&:last-of-type {
51-
margin-bottom: 0;
52-
}
53-
}
5436
}
5537

5638
// This fixes width calculation issues inside the iframe for blocks and shortcode pages.

client/express-checkout/button-ui.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const expressCheckoutButtonUi = {
3232

3333
renderButton: ( eceButton ) => {
3434
if ( get$Container()?.length ) {
35-
expressCheckoutButtonUi.showContainer();
35+
// expressCheckoutButtonUi.showContainer();
3636
eceButton.mount( expressCheckoutElementId );
3737
}
3838
},
@@ -42,6 +42,11 @@ const expressCheckoutButtonUi = {
4242
},
4343

4444
showContainer: () => {
45+
get$Container().show();
46+
get$Container().addClass( 'is-ready' );
47+
},
48+
49+
markAsReady: () => {
4550
get$Container()
4651
.closest( '.wcpay-express-checkout-wrapper' )
4752
.addClass( 'is-ready' );

client/express-checkout/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jQuery( ( $ ) => {
3737
}
3838

3939
const publishableKey = getExpressCheckoutData( 'stripe' ).publishableKey;
40+
// const publishableKey = 'pk_test_51N000000000000000000000';
4041
const quantityInputSelector = '.quantity .qty[type=number]';
4142

4243
if ( ! publishableKey ) {

0 commit comments

Comments
 (0)