diff --git a/client/coral-admin/src/routes/Configure/components/Wordlist.js b/client/coral-admin/src/routes/Configure/components/Wordlist.js index 1a5c177d0..6acc045b8 100644 --- a/client/coral-admin/src/routes/Configure/components/Wordlist.js +++ b/client/coral-admin/src/routes/Configure/components/Wordlist.js @@ -6,7 +6,7 @@ import ConfigureCard from 'coral-framework/components/ConfigureCard'; const Wordlist = ({ suspectWords, bannedWords, onChangeWordlist }) => (
- +

{t('configure.banned_word_text')}

( onChange={tags => onChangeWordlist('banned', tags)} />
- +

{t('configure.suspect_word_text')}

( - - {checked !== undefined && ( -
- -
- )} -
-
{title}
-
this.setState({ isOpen: !this.state.isOpen }); + + render() { + const { + title, + children, + className, + onCheckbox, + checked, + collapsible, + ...rest + } = this.props; + + const { isOpen } = this.state; + + const iconName = isOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down'; + + return ( + - {children} -
-
-
-); + {checked !== undefined && ( +
+ +
+ )} +
+
+
{title}
+ {collapsible && ( + + )} +
+ {isOpen && ( +
+ {children} +
+ )} +
+ + ); + } +} ConfigureCard.propTypes = { title: PropTypes.string, @@ -48,6 +71,7 @@ ConfigureCard.propTypes = { onCheckbox: PropTypes.func, checked: PropTypes.bool, children: PropTypes.node, + collapsible: PropTypes.bool, }; export default ConfigureCard;