diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlTextInput.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlTextInput.js new file mode 100644 index 000000000..08e6a8d11 --- /dev/null +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/ControlTextInput.js @@ -0,0 +1,18 @@ +import { TextControl } from '@wordpress/components'; + +import { Action } from '../Elements'; + +const ControlTextInput = ( { value, onChange, placeholder = '' } ) => { + return ( + + + + ); +}; + +export default ControlTextInput; diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/InputSettingsBlock.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/InputSettingsBlock.js deleted file mode 100644 index 21cc53887..000000000 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/InputSettingsBlock.js +++ /dev/null @@ -1,37 +0,0 @@ -import { TextControl } from '@wordpress/components'; - -import SettingsBlock from '../SettingsBlock'; -import { Title, Action, Description, TitleExtra } from '../Elements'; - -const InputSettingsBlock = ( { - title, - description, - supplementaryLabel, - showDescriptionFirst = false, - value, - onChange, - placeholder = '', -} ) => { - const TheDescription = { description }; - - return ( - - - { title } - <TitleExtra>{ supplementaryLabel }</TitleExtra> - - { showDescriptionFirst && TheDescription } - - - - { ! showDescriptionFirst && TheDescription } - - ); -}; - -export default InputSettingsBlock; diff --git a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/index.js b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/index.js index cb06265c4..048c09ca1 100644 --- a/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/index.js +++ b/modules/ppcp-settings/resources/js/Components/ReusableComponents/SettingsBlocks/index.js @@ -1,8 +1,9 @@ export { default as ButtonSettingsBlock } from './ButtonSettingsBlock'; -export { default as InputSettingsBlock } from './InputSettingsBlock'; export { default as SelectSettingsBlock } from './SelectSettingsBlock'; export { default as AccordionSettingsBlock } from './AccordionSettingsBlock'; export { default as ToggleSettingsBlock } from './ToggleSettingsBlock'; export { default as RadioSettingsBlock } from './RadioSettingsBlock'; export { default as PaymentMethodsBlock } from './PaymentMethodsBlock'; export { default as PaymentMethodItemBlock } from './PaymentMethodItemBlock'; + +export { default as ControlTextInput } from './ControlTextInput'; diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/ConnectionDetails.js b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/ConnectionDetails.js index 144f9a55b..224b5dbd0 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/ConnectionDetails.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/ConnectionDetails.js @@ -3,7 +3,7 @@ import { Button } from '@wordpress/components'; import { AccordionSettingsBlock, - InputSettingsBlock, + ControlTextInput, RadioSettingsBlock, } from '../../../../ReusableComponents/SettingsBlocks'; @@ -80,7 +80,7 @@ const generateOptions = ( config, settings, updateFormValue ) => [ ), additionalContent: ( <> - [ 'woocommerce-paypal-payments' ) } /> - { return ( @@ -81,37 +82,39 @@ const PaypalSettings = ( { updateFormValue, settings } ) => { } } /> - + > + + - + > + + { const { invoicePrefix, setInvoicePrefix } = SettingsHooks.useSettings(); return ( - + > + + ); };