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

View file

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