Settings UI: Update Overview tab Features button links

This commit is contained in:
Daniel Dudzic 2025-01-22 18:23:46 +01:00
parent b902d2eea2
commit b2bb4efb60
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
2 changed files with 19 additions and 36 deletions

View file

@ -32,13 +32,17 @@ const FeatureSettingsBlock = ( { title, description, ...props } ) => {
</Button>
);
return button.urls ? (
<a href={ button.urls.live } key={ button.text }>
// If there's a URL (either direct or in urls object), wrap in anchor tag
if ( button.url || button.urls ) {
const href = button.urls ? button.urls.live : button.url;
return (
<a href={ href } key={ button.text }>
{ buttonElement }
</a>
) : (
buttonElement
);
}
return buttonElement;
};
return (

View file

@ -39,10 +39,7 @@ const Features = {
{
type: 'tertiary',
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/studio/checkout/standard',
class: 'small-button',
},
],
@ -88,10 +85,7 @@ const Features = {
{
type: 'tertiary',
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/studio/checkout/advanced',
class: 'small-button',
},
],
@ -122,20 +116,14 @@ const Features = {
{
type: 'secondary',
text: __( 'Apply', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/docs/checkout/apm/',
showWhen: 'disabled',
class: 'small-button',
},
{
type: 'tertiary',
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/docs/checkout/apm/',
class: 'small-button',
},
],
@ -176,10 +164,7 @@ const Features = {
{
type: 'tertiary',
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/docs/checkout/apm/google-pay/',
class: 'small-button',
},
],
@ -240,10 +225,7 @@ const Features = {
{
type: 'tertiary',
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/docs/checkout/apm/apple-pay/',
class: 'small-button',
},
],
@ -283,10 +265,7 @@ const Features = {
{
type: 'tertiary',
text: __( 'Learn more', 'woocommerce-paypal-payments' ),
urls: {
sandbox: '#',
live: '#',
},
url: 'https://developer.paypal.com/studio/checkout/pay-later/us',
class: 'small-button',
},
],