mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Axo Block: Always display the Fastlane watermark under the email input in the includeAdditionalInfo mode. Also move the loading spinner to the right.
This commit is contained in:
parent
e67e9be95d
commit
0d228d0d76
3 changed files with 4 additions and 10 deletions
|
@ -259,8 +259,8 @@ a.wc-block-axo-change-link {
|
|||
.wp-block-woocommerce-checkout-fields-block:not(.wc-block-axo-is-loaded) {
|
||||
.wc-block-checkout-axo-block-watermark-container {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
margin-left: 10px;
|
||||
justify-content: right;
|
||||
margin-right: 10px;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@ import {
|
|||
*/
|
||||
const WatermarkManager = ( { fastlaneSdk } ) => {
|
||||
// Select relevant states from the AXO store
|
||||
const isGuest = useSelect( ( select ) =>
|
||||
select( STORE_NAME ).getIsGuest()
|
||||
);
|
||||
const isAxoActive = useSelect( ( select ) =>
|
||||
select( STORE_NAME ).getIsAxoActive()
|
||||
);
|
||||
|
@ -34,7 +31,6 @@ const WatermarkManager = ( { fastlaneSdk } ) => {
|
|||
isAxoActive,
|
||||
isAxoScriptLoaded,
|
||||
fastlaneSdk,
|
||||
isGuest,
|
||||
} );
|
||||
} else {
|
||||
// Remove watermark when AXO is inactive and not loading
|
||||
|
@ -43,7 +39,7 @@ const WatermarkManager = ( { fastlaneSdk } ) => {
|
|||
|
||||
// Cleanup function to remove watermark on unmount
|
||||
return removeWatermark;
|
||||
}, [ fastlaneSdk, isGuest, isAxoActive, isAxoScriptLoaded ] );
|
||||
}, [ fastlaneSdk, isAxoActive, isAxoScriptLoaded ] );
|
||||
|
||||
// This component doesn't render anything directly
|
||||
return null;
|
||||
|
|
|
@ -112,13 +112,11 @@ export const renderWatermarkContent = ( content ) => {
|
|||
* @param {boolean} params.isAxoActive - Whether AXO is active.
|
||||
* @param {boolean} params.isAxoScriptLoaded - Whether AXO script is loaded.
|
||||
* @param {Object} params.fastlaneSdk - The Fastlane SDK instance.
|
||||
* @param {boolean} params.isGuest - Whether the user is a guest.
|
||||
*/
|
||||
export const updateWatermarkContent = ( {
|
||||
isAxoActive,
|
||||
isAxoScriptLoaded,
|
||||
fastlaneSdk,
|
||||
isGuest,
|
||||
} ) => {
|
||||
if ( ! isAxoActive && ! isAxoScriptLoaded ) {
|
||||
// Show loading spinner
|
||||
|
@ -134,7 +132,7 @@ export const updateWatermarkContent = ( {
|
|||
createElement( Watermark, {
|
||||
fastlaneSdk,
|
||||
name: 'fastlane-watermark-email',
|
||||
includeAdditionalInfo: isGuest,
|
||||
includeAdditionalInfo: true,
|
||||
} )
|
||||
);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue