Fix apm button styling

This commit is contained in:
Pedro Silva 2023-12-07 18:20:58 +00:00
parent 45516d0075
commit 46c575a401
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
16 changed files with 163 additions and 32 deletions

View file

@ -1,8 +1,6 @@
.ppcp-button-googlepay {
margin: 7px 0;
overflow: hidden;
min-height: 40px;
height: 45px;
&.ppcp-button-pill {
border-radius: 50px;
@ -10,13 +8,6 @@
&.ppcp-button-minicart {
display: block;
height: 40px;
}
}
.woocommerce-checkout {
.ppcp-button-googlepay {
margin-top: 0;
}
}
@ -25,14 +16,12 @@
.wp-block-woocommerce-checkout {
.ppcp-button-googlepay {
margin: 0;
height: 48px;
}
}
.wp-block-woocommerce-cart {
.ppcp-button-googlepay {
margin: 0;
height: 48px;
}
}

View file

@ -3,10 +3,13 @@ import {setVisible} from '../../../ppcp-button/resources/js/modules/Helper/Hidin
import {setEnabled} from '../../../ppcp-button/resources/js/modules/Helper/ButtonDisabler';
import widgetBuilder from "../../../ppcp-button/resources/js/modules/Renderer/WidgetBuilder";
import UpdatePaymentData from "./Helper/UpdatePaymentData";
import {apmButtonInit} from "../../../ppcp-button/resources/js/modules/Helper/ApmButton";
class GooglepayButton {
constructor(context, externalHandler, buttonConfig, ppcpConfig) {
apmButtonInit();
this.isInitialized = false;
this.context = context;

View file

@ -67,7 +67,7 @@ import widgetBuilder from "../../../ppcp-button/resources/js/modules/Renderer/Wi
buttonConfig.button.wrapper = selector;
applyConfigOptions(buttonConfig);
const wrapperElement = `<div id="${selector.replace('#', '')}" class="ppcp-button-googlepay"></div>`;
const wrapperElement = `<div id="${selector.replace('#', '')}" class="ppcp-button-apm ppcp-button-googlepay"></div>`;
if (!jQuery(selector).length) {
jQuery(ppcpConfig.button.wrapper).after(wrapperElement);

View file

@ -51,7 +51,7 @@ const GooglePayComponent = () => {
}, [paypalLoaded, googlePayLoaded]);
return (
<div id={buttonConfig.button.wrapper.replace('#', '')} className="ppcp-button-googlepay"></div>
<div id={buttonConfig.button.wrapper.replace('#', '')} className="ppcp-button-apm ppcp-button-googlepay"></div>
);
}

View file

@ -311,7 +311,7 @@ class Button implements ButtonInterface {
add_action(
$render_placeholder,
function () {
echo '<span id="ppc-button-googlepay-container-minicart" class="ppcp-button-googlepay ppcp-button-minicart"></span>';
echo '<span id="ppc-button-googlepay-container-minicart" class="ppcp-button-apm ppcp-button-googlepay ppcp-button-minicart"></span>';
},
21
);
@ -325,7 +325,7 @@ class Button implements ButtonInterface {
*/
private function googlepay_button(): void {
?>
<div id="ppc-button-googlepay-container" class="ppcp-button-googlepay">
<div id="ppc-button-googlepay-container" class="ppcp-button-apm ppcp-button-googlepay">
<?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
</div>
<?php