♻️ Refactor InputSettingsBlock for Redux usage

This commit is contained in:
Philipp Stracker 2025-01-21 19:06:53 +01:00
parent b958fe597c
commit bd2af4fd64
No known key found for this signature in database
4 changed files with 39 additions and 53 deletions

View file

@ -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 }