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:
Daniel Dudzic 2024-10-10 20:40:03 +02:00
parent e67e9be95d
commit 0d228d0d76
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
3 changed files with 4 additions and 10 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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 {