From c777f19d373c5e80e250e5f380aac3e346aaa8d5 Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Fri, 30 Jun 2023 10:56:22 +1200 Subject: [PATCH] FIX ESLint issues --- .../ColorPickerField/ColorPickerField.js | 14 +++++++------- .../components/FontPickerField/FontPickerField.js | 14 +++++++------- client/src/legacy/entwine.js | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/src/components/ColorPickerField/ColorPickerField.js b/client/src/components/ColorPickerField/ColorPickerField.js index 6223c9e..c500180 100644 --- a/client/src/components/ColorPickerField/ColorPickerField.js +++ b/client/src/components/ColorPickerField/ColorPickerField.js @@ -17,9 +17,9 @@ class ColorPickerField extends Component { } handleToggle() { - this.setState({ - isOpen: !this.state.isOpen - }); + this.setState((prevState) => ({ + isOpen: !prevState.isOpen, + })); } renderButton() { @@ -61,14 +61,14 @@ class ColorPickerField extends Component { />, {color.Title} - + , ]; const buttons = colors.map((color) => ({ key: color.CSSClass, content: buttonContent(color), className: ['color-picker-field-popover__option', { - 'color-picker-field-popover__option--selected': color.CSSClass === value + 'color-picker-field-popover__option--selected': color.CSSClass === value, }], text: color.Title, onClick: () => { @@ -80,7 +80,7 @@ class ColorPickerField extends Component { })); const handleSearch = (term, set) => set.filter( - ({ text }) => text.toLowerCase().includes(term.toLowerCase()) + ({ text }) => text.toLowerCase().includes(term.toLowerCase()), ); return ( @@ -124,5 +124,5 @@ ColorPickerField.propTypes = { export default inject( ['PopoverOptionSet'], (PopoverOptionSetComponent) => ({ PopoverOptionSetComponent }), - () => 'ColorPickerField' + () => 'ColorPickerField', )(ColorPickerField); diff --git a/client/src/components/FontPickerField/FontPickerField.js b/client/src/components/FontPickerField/FontPickerField.js index 44b488b..be41501 100644 --- a/client/src/components/FontPickerField/FontPickerField.js +++ b/client/src/components/FontPickerField/FontPickerField.js @@ -37,9 +37,9 @@ class FontPickerField extends Component { } handleToggle() { - this.setState({ - isOpen: !this.state.isOpen - }); + this.setState((prevState) => ({ + isOpen: !prevState.isOpen, + })); } renderSelectorButton() { @@ -76,7 +76,7 @@ class FontPickerField extends Component { value: font.CSSClass, selectedFont: font.Title, }); - } + }, })); return ( @@ -97,11 +97,11 @@ class FontPickerField extends Component { const previewTextSentence = i18n._t( 'FontPickerField.PREVIEW_FONT_SENTENCE', - 'The quick brown fox jumps over the lazy dog.' + 'The quick brown fox jumps over the lazy dog.', ); const previewTextAlphabet = i18n._t( 'FontPickerField.PREVIEW_FONT_ALPHABET', - 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz 0123456789 - = _ + < > ? / . , : "' + 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz 0123456789 - = _ + < > ? / . , : "', ); return (
({ PopoverOptionSetComponent }), - () => 'FontPickerField' + () => 'FontPickerField', )(FontPickerField); diff --git a/client/src/legacy/entwine.js b/client/src/legacy/entwine.js index d480a5d..0a73294 100644 --- a/client/src/legacy/entwine.js +++ b/client/src/legacy/entwine.js @@ -22,7 +22,7 @@ jQuery.entwine('ss', ($) => { root = createRoot(this[0]); this.setReactRoot(root); } - root.render(,); + root.render(); }, onunmatch() { @@ -31,7 +31,7 @@ jQuery.entwine('ss', ($) => { root.unmount(); this.setReactRoot(null); } - } + }, }); $('.js-injector-boot .form__field-holder .font-picker-field').entwine({ @@ -61,6 +61,6 @@ jQuery.entwine('ss', ($) => { root.unmount(); this.setReactRoot(null); } - } + }, }); });