From 754a17471a9c3077f374f2280b7108584032f932 Mon Sep 17 00:00:00 2001 From: Carlos Bravo <37012961+cbravobernal@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:36:23 +0200 Subject: [PATCH] Refactor the EnableCustomFieldsOption component to improve code readability and maintainability. --- .../preferences-modal/enable-custom-fields.js | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/edit-post/src/components/preferences-modal/enable-custom-fields.js b/packages/edit-post/src/components/preferences-modal/enable-custom-fields.js index 3f72202e9f07b2..87690fbe774bfb 100644 --- a/packages/edit-post/src/components/preferences-modal/enable-custom-fields.js +++ b/packages/edit-post/src/components/preferences-modal/enable-custom-fields.js @@ -63,24 +63,22 @@ export function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) { const [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled ); return ( - <> - - { isChecked && ( -

- { __( - 'Connected attributes cannot be edited in the block editor while this interface is active.' - ) } -

- ) } - { isChecked !== areCustomFieldsEnabled && ( - - ) } -
- + + { isChecked && ( +

+ { __( + 'Custom fields connected to block attributes cannot be edited in the block editor while this interface is active.' + ) } +

+ ) } + { isChecked !== areCustomFieldsEnabled && ( + + ) } +
); }