mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
💄 Improve display of webhook contents
This commit is contained in:
parent
03119cb7d4
commit
5712544f08
2 changed files with 32 additions and 29 deletions
|
@ -1,5 +1,6 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { CommonHooks } from '../../../../../../data';
|
||||
import { Title } from '../../../../../ReusableComponents/SettingsBlocks';
|
||||
|
||||
const HooksTableBlock = () => {
|
||||
const { webhooks } = CommonHooks.useWebhooks();
|
||||
|
@ -10,31 +11,36 @@ const HooksTableBlock = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<table className="ppcp-r-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="ppcp-r-table__hooks-url">
|
||||
{ __( 'URL', 'woocommerce-paypal-payments' ) }
|
||||
</th>
|
||||
<th className="ppcp-r-table__hooks-events">
|
||||
{ __(
|
||||
'Tracked events',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="ppcp-r-table__hooks-url">{ url }</td>
|
||||
<td className="ppcp-r-table__hooks-events">
|
||||
{ events.map( ( event, index ) => (
|
||||
<div key={ index }>{ event }</div>
|
||||
) ) }
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<>
|
||||
<WebhookUrl url={ url } />
|
||||
<WebhookEvents events={ events } />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const WebhookUrl = ( { url } ) => {
|
||||
return (
|
||||
<div>
|
||||
<Title>
|
||||
{ __( 'Notification URL', 'woocommerce-paypal-payments' ) }
|
||||
</Title>
|
||||
<p>{ url }</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const WebhookEvents = ( { events } ) => {
|
||||
return (
|
||||
<div>
|
||||
<Title>
|
||||
{ __( 'Subscribed Events', 'woocommerce-paypal-payments' ) }
|
||||
</Title>
|
||||
<ul>
|
||||
{ events.map( ( event, index ) => (
|
||||
<li key={ index }>{ event }</li>
|
||||
) ) }
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -42,10 +42,7 @@ const Troubleshooting = ( { updateFormValue, settings } ) => {
|
|||
<SettingsBlock>
|
||||
<Header>
|
||||
<Title>
|
||||
{ __(
|
||||
'Subscribed PayPal webhooks',
|
||||
'woocommerce-paypal-payments'
|
||||
) }
|
||||
{ __( 'Webhooks', 'woocommerce-paypal-payments' ) }
|
||||
</Title>
|
||||
<Description>
|
||||
{ __(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue