aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/react/components/container/HelpBox.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client/react/components/container/HelpBox.js b/src/client/react/components/container/HelpBox.js
index 6579383..3358a76 100644
--- a/src/client/react/components/container/HelpBox.js
+++ b/src/client/react/components/container/HelpBox.js
@@ -27,13 +27,13 @@ import './HelpBox.scss';
class HelpBox extends React.Component {
static propTypes = {
// redux
- results: PropTypes.arrayOf(PropTypes.string).isRequired,
- searchText: PropTypes.string.isRequired,
+ isVisible: PropTypes.bool.isRequired,
}
render() {
- const { results, searchText } = this.props;
- if (results.length > 0 || searchText !== '') {
+ const { isVisible } = this.props;
+
+ if (!isVisible) {
return <div />;
}
@@ -49,8 +49,7 @@ class HelpBox extends React.Component {
}
const mapStateToProps = state => ({
- results: state.search.results,
- searchText: state.search.text,
+ isVisible: state.search.results.length === 0 && state.search.text === '',
});
export default connect(mapStateToProps)(HelpBox);