mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Refactor InputSettingsBlock for Redux usage
This commit is contained in:
parent
b958fe597c
commit
bd2af4fd64
4 changed files with 39 additions and 53 deletions
|
@ -8,13 +8,14 @@ const InputSettingsBlock = ( {
|
|||
description,
|
||||
supplementaryLabel,
|
||||
showDescriptionFirst = false,
|
||||
actionProps = {},
|
||||
...props
|
||||
value,
|
||||
onChange,
|
||||
placeholder = '',
|
||||
} ) => {
|
||||
const TheDescription = <Description>{ description }</Description>;
|
||||
|
||||
return (
|
||||
<SettingsBlock { ...props } className="ppcp-r-settings-block__input">
|
||||
<SettingsBlock className="ppcp-r-settings-block__input">
|
||||
<Title>
|
||||
{ title }
|
||||
{ supplementaryLabel && (
|
||||
|
@ -27,11 +28,9 @@ const InputSettingsBlock = ( {
|
|||
<Action>
|
||||
<TextControl
|
||||
className="ppcp-r-vertical-text-control"
|
||||
placeholder={ actionProps.placeholder }
|
||||
value={ actionProps.value }
|
||||
onChange={ ( newValue ) =>
|
||||
actionProps.callback( actionProps.key, newValue )
|
||||
}
|
||||
placeholder={ placeholder }
|
||||
value={ value }
|
||||
onChange={ onChange }
|
||||
/>
|
||||
</Action>
|
||||
{ ! showDescriptionFirst && TheDescription }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue