♻️ Remove description-location-logic

This commit is contained in:
Philipp Stracker 2025-01-22 15:48:11 +01:00
parent f90ab656f5
commit 7a71ff3657
No known key found for this signature in database
4 changed files with 16 additions and 17 deletions

View file

@ -6,7 +6,6 @@ const SettingsBlock = ( {
children,
title,
titleSuffix,
headerDescription,
description,
horizontalLayout = false,
separatorAndGap = true,
@ -20,16 +19,13 @@ const SettingsBlock = ( {
<div className={ blockClassName }>
<Header>
<Title>
{ title } <TitleExtra>{ titleSuffix }</TitleExtra>
{ title }
<TitleExtra>{ titleSuffix }</TitleExtra>
</Title>
<Description>{ headerDescription }</Description>
<Description>{ description }</Description>
</Header>
<Content asCard={ false }>
{ children }
<Description>{ description }</Description>
</Content>
<Content asCard={ false }>{ children }</Content>
</div>
);
};

View file

@ -1,8 +1,13 @@
import { TextControl } from '@wordpress/components';
import { Action } from '../Elements';
import { Action, Description } from '../Elements';
const ControlTextInput = ( { value, onChange, placeholder = '' } ) => {
const ControlTextInput = ( {
value,
description,
onChange,
placeholder = '',
} ) => {
return (
<Action>
<TextControl
@ -11,6 +16,7 @@ const ControlTextInput = ( { value, onChange, placeholder = '' } ) => {
value={ value }
onChange={ onChange }
/>
<Description>{ description }</Description>
</Action>
);
};

View file

@ -84,7 +84,7 @@ const PaypalSettings = ( { updateFormValue, settings } ) => {
<SettingsBlock
title={ __( 'Brand name', 'woocommerce-paypal-payments' ) }
headerDescription={ __(
description={ __(
'What business name to show to your buyers during checkout and on receipts.',
'woocommerce-paypal-payments'
) }
@ -101,7 +101,7 @@ const PaypalSettings = ( { updateFormValue, settings } ) => {
<SettingsBlock
title={ __( 'Soft Descriptor', 'woocommerce-paypal-payments' ) }
headerDescription={ __(
description={ __(
"The dynamic text used to construct the statement descriptor that appears on a payer's card statement. Applies to PayPal and Credit Card transactions. Max value of 22 characters.",
'woocommerce-paypal-payments'
) }

View file

@ -9,11 +9,7 @@ const InvoicePrefix = () => {
return (
<SettingsBlock
title="Invoice Prefix"
supplementaryLabel={ __(
'(Recommended)',
'woocommerce-paypal-payments'
) }
description="Add a unique prefix to invoice numbers for site-specific tracking (recommended)."
titleSuffix={ __( '(Recommended)', 'woocommerce-paypal-payments' ) }
>
<ControlTextInput
placeholder={ __(
@ -22,6 +18,7 @@ const InvoicePrefix = () => {
) }
onChange={ setInvoicePrefix }
value={ invoicePrefix }
description="Add a unique prefix to invoice numbers for site-specific tracking (recommended)."
/>
</SettingsBlock>
);