Merge pull request #3016 from woocommerce/PCP-3932-implement-logic-for-the-features

Settings UI: Refactor Overview tab and update Feature button links
This commit is contained in:
Philipp Stracker 2025-01-23 17:28:58 +01:00 committed by GitHub
commit 143e089f79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 66 additions and 76 deletions

View file

@ -24,7 +24,7 @@ const FeatureSettingsBlock = ( { title, description, ...props } ) => {
<Button
className={ button.class ? button.class : '' }
key={ button.text }
isBusy={ props.actionProps?.isBusy }
isBusy={ props.actionProps?.isBusy }
variant={ button.type }
onClick={ button.onClick }
>
@ -32,13 +32,17 @@ const FeatureSettingsBlock = ( { title, description, ...props } ) => {
</Button>
);
return button.urls ? (
<a href={ button.urls.live } key={ button.text }>
{ buttonElement }
</a>
) : (
buttonElement
);
// 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>
);
}
return buttonElement;
};
return (