Merge pull request #2690 from woocommerce/PCP-3778-axo-block-the-fastlane-watermark-under-the-email-input-should-always-display-the-more-info-icon

Axo Block: Always display the Fastlane watermark in the includeAdditionalInfo mode (3778)
This commit is contained in:
Emili Castells 2024-10-11 14:53:22 +02:00 committed by GitHub
commit 7c74400643
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 13 deletions

View file

@ -174,9 +174,6 @@ $fast-transition-duration: 0.5s;
grid-area: watermark; grid-area: watermark;
justify-self: end; justify-self: end;
grid-column: 1; grid-column: 1;
}
&:not(.wc-block-axo-is-authenticated) .wc-block-checkout-axo-block-watermark-container {
margin-top: 0; margin-top: 0;
} }
@ -259,8 +256,8 @@ a.wc-block-axo-change-link {
.wp-block-woocommerce-checkout-fields-block:not(.wc-block-axo-is-loaded) { .wp-block-woocommerce-checkout-fields-block:not(.wc-block-axo-is-loaded) {
.wc-block-checkout-axo-block-watermark-container { .wc-block-checkout-axo-block-watermark-container {
display: flex; display: flex;
justify-content: left; justify-content: right;
margin-left: 10px; margin-right: 10px;
align-items: center; align-items: center;
position: relative; position: relative;

View file

@ -16,9 +16,6 @@ import {
*/ */
const WatermarkManager = ( { fastlaneSdk } ) => { const WatermarkManager = ( { fastlaneSdk } ) => {
// Select relevant states from the AXO store // Select relevant states from the AXO store
const isGuest = useSelect( ( select ) =>
select( STORE_NAME ).getIsGuest()
);
const isAxoActive = useSelect( ( select ) => const isAxoActive = useSelect( ( select ) =>
select( STORE_NAME ).getIsAxoActive() select( STORE_NAME ).getIsAxoActive()
); );
@ -34,7 +31,6 @@ const WatermarkManager = ( { fastlaneSdk } ) => {
isAxoActive, isAxoActive,
isAxoScriptLoaded, isAxoScriptLoaded,
fastlaneSdk, fastlaneSdk,
isGuest,
} ); } );
} else { } else {
// Remove watermark when AXO is inactive and not loading // Remove watermark when AXO is inactive and not loading
@ -43,7 +39,7 @@ const WatermarkManager = ( { fastlaneSdk } ) => {
// Cleanup function to remove watermark on unmount // Cleanup function to remove watermark on unmount
return removeWatermark; return removeWatermark;
}, [ fastlaneSdk, isGuest, isAxoActive, isAxoScriptLoaded ] ); }, [ fastlaneSdk, isAxoActive, isAxoScriptLoaded ] );
// This component doesn't render anything directly // This component doesn't render anything directly
return null; return null;

View file

@ -112,13 +112,11 @@ export const renderWatermarkContent = ( content ) => {
* @param {boolean} params.isAxoActive - Whether AXO is active. * @param {boolean} params.isAxoActive - Whether AXO is active.
* @param {boolean} params.isAxoScriptLoaded - Whether AXO script is loaded. * @param {boolean} params.isAxoScriptLoaded - Whether AXO script is loaded.
* @param {Object} params.fastlaneSdk - The Fastlane SDK instance. * @param {Object} params.fastlaneSdk - The Fastlane SDK instance.
* @param {boolean} params.isGuest - Whether the user is a guest.
*/ */
export const updateWatermarkContent = ( { export const updateWatermarkContent = ( {
isAxoActive, isAxoActive,
isAxoScriptLoaded, isAxoScriptLoaded,
fastlaneSdk, fastlaneSdk,
isGuest,
} ) => { } ) => {
if ( ! isAxoActive && ! isAxoScriptLoaded ) { if ( ! isAxoActive && ! isAxoScriptLoaded ) {
// Show loading spinner // Show loading spinner
@ -134,7 +132,7 @@ export const updateWatermarkContent = ( {
createElement( Watermark, { createElement( Watermark, {
fastlaneSdk, fastlaneSdk,
name: 'fastlane-watermark-email', name: 'fastlane-watermark-email',
includeAdditionalInfo: isGuest, includeAdditionalInfo: true,
} ) } )
); );
} else { } else {