💄 Improve UI of webhook section

This commit is contained in:
Philipp Stracker 2025-01-10 18:30:11 +01:00
parent 406e8ebc98
commit 1c33c42507
No known key found for this signature in database
3 changed files with 21 additions and 20 deletions

View file

@ -1,6 +1,9 @@
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { CommonHooks } from '../../../../../../data'; import { CommonHooks } from '../../../../../../data';
import { Title } from '../../../../../ReusableComponents/SettingsBlocks'; import {
SettingsBlock,
Title,
} from '../../../../../ReusableComponents/SettingsBlocks';
const HooksTableBlock = () => { const HooksTableBlock = () => {
const { webhooks } = CommonHooks.useWebhooks(); const { webhooks } = CommonHooks.useWebhooks();
@ -11,10 +14,10 @@ const HooksTableBlock = () => {
} }
return ( return (
<> <SettingsBlock separatorAndGap={ false }>
<WebhookUrl url={ url } /> <WebhookUrl url={ url } />
<WebhookEvents events={ events } /> <WebhookEvents events={ events } />
</> </SettingsBlock>
); );
}; };

View file

@ -56,6 +56,7 @@ const ResubscribeBlock = () => {
'Click to remove the current webhook subscription and subscribe again, for example, if the website domain or URL structure changed.', 'Click to remove the current webhook subscription and subscribe again, for example, if the website domain or URL structure changed.',
'woocommerce-paypal-payments' 'woocommerce-paypal-payments'
) } ) }
separatorAndGap={ false }
actionProps={ { actionProps={ {
buttonType: 'secondary', buttonType: 'secondary',
isBusy: resubscribing, isBusy: resubscribing,

View file

@ -107,23 +107,20 @@ const SimulationBlock = () => {
}; };
return ( return (
<> <ButtonSettingsBlock
<ButtonSettingsBlock title={ __( 'Test webhooks', 'woocommerce-paypal-payments' ) }
title={ __( description={ __(
'Simulate webhooks', 'Send a test-webhook from PayPal to confirm that webhooks are being received and processed correctly.',
'woocommerce-paypal-payments' 'woocommerce-paypal-payments'
) } ) }
actionProps={ { separatorAndGap={ false }
buttonType: 'secondary', actionProps={ {
isBusy: simulating, buttonType: 'secondary',
callback: () => startSimulation( 30 ), isBusy: simulating,
value: __( callback: () => startSimulation( 30 ),
'Simulate webhooks', value: __( 'Simulate webhooks', 'woocommerce-paypal-payments' ),
'woocommerce-paypal-payments' } }
), />
} }
/>
</>
); );
}; };
export default SimulationBlock; export default SimulationBlock;