Use highlight for payment methods

This commit is contained in:
carmenmaymo 2025-02-18 12:46:06 +01:00
parent 17702ff06b
commit 36bf0d9e7f
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E
2 changed files with 28 additions and 19 deletions

View file

@ -26,7 +26,10 @@ import {
import SpinnerOverlay from '../../../ReusableComponents/SpinnerOverlay'; import SpinnerOverlay from '../../../ReusableComponents/SpinnerOverlay';
import { useFeatures } from '../../../../data/features/hooks'; import { useFeatures } from '../../../../data/features/hooks';
import { selectTab, TAB_IDS } from '../../../../utils/tabSelector'; import { selectTab, TAB_IDS } from '../../../../utils/tabSelector';
import { setActiveModal } from '../../../../data/common/actions'; import {
setActiveHighlight,
setActiveModal,
} from '../../../../data/common/actions';
const TabOverview = () => { const TabOverview = () => {
const { isReady: areTodosReady } = TodosHooks.useStore(); const { isReady: areTodosReady } = TodosHooks.useStore();
@ -231,6 +234,9 @@ const OverviewFeatureItem = ( {
if ( feature.action?.modal ) { if ( feature.action?.modal ) {
setActiveModal( feature.action.modal ); setActiveModal( feature.action.modal );
} }
if ( feature.action?.highlight ) {
setActiveHighlight( feature.action.highlight );
}
}; };
const actionProps = { const actionProps = {

View file

@ -78,9 +78,8 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'settings', 'tab' => 'settings',
'section' => 'ppcp--save-payment-methods',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -112,10 +111,11 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-card-payments-card', 'section' => 'ppcp-credit-card-gateway',
'modal' => 'ppcp-credit-card-gateway', 'highlight' => 'ppcp-credit-card-gateway',
'modal' => 'ppcp-credit-card-gateway',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -147,9 +147,10 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-alternative-payments-card', 'section' => 'ppcp-alternative-payments-card',
'highlight' => 'ppcp-alternative-payments-card',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -178,10 +179,11 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-card-payments-card', 'section' => 'ppcp-card-payments-card',
'modal' => 'ppcp-googlepay', 'highlight' => 'ppcp-googlepay',
'modal' => 'ppcp-googlepay',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',
@ -216,10 +218,11 @@ class FeaturesDefinition {
'type' => 'secondary', 'type' => 'secondary',
'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'text' => __( 'Configure', 'woocommerce-paypal-payments' ),
'action' => array( 'action' => array(
'type' => 'tab', 'type' => 'tab',
'tab' => 'payment_methods', 'tab' => 'payment_methods',
'section' => 'ppcp-card-payments-card', 'section' => 'ppcp-card-payments-card',
'modal' => 'ppcp-applepay', 'highlight' => 'ppcp-applepay',
'modal' => 'ppcp-applepay',
), ),
'showWhen' => 'enabled', 'showWhen' => 'enabled',
'class' => 'small-button', 'class' => 'small-button',