aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-01-19 14:58:49 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-01-19 14:58:49 +0100
commit3f228d0d84868e4a02aa7a62b09dde8092f2cc4c (patch)
tree8a4df9f1c6f23db36f9246844d812fac0da8640b /src
parent0bea1f5a594b8adfccb59783b0ec10b33443d2b3 (diff)
Add helpbox
Diffstat (limited to 'src')
-rw-r--r--src/client/react/components/container/HelpBox.js25
-rw-r--r--src/client/react/components/page/Index.js8
2 files changed, 31 insertions, 2 deletions
diff --git a/src/client/react/components/container/HelpBox.js b/src/client/react/components/container/HelpBox.js
new file mode 100644
index 0000000..b4556a5
--- /dev/null
+++ b/src/client/react/components/container/HelpBox.js
@@ -0,0 +1,25 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { connect } from 'react-redux';
+
+const HelpBox = ({ results }) => {
+ if (results.length > 0) {
+ return <div />;
+ }
+
+ return (
+ <div className="help-box">
+ Voer hier een docentafkorting, klas, leerlingnummer of lokaalnummer in.
+ </div>
+ );
+};
+
+HelpBox.propTypes = {
+ results: PropTypes.arrayOf(PropTypes.string).isRequired,
+};
+
+const mapStateToProps = state => ({
+ results: state.search.results,
+});
+
+export default connect(mapStateToProps)(HelpBox);
diff --git a/src/client/react/components/page/Index.js b/src/client/react/components/page/Index.js
index 9b8dbd7..c2994c9 100644
--- a/src/client/react/components/page/Index.js
+++ b/src/client/react/components/page/Index.js
@@ -1,10 +1,14 @@
import React from 'react';
import Search from '../container/Search';
+import HelpBox from '../container/HelpBox';
const App = () => (
<div className="page-index">
- <img src="/icons/mml-logo.png" alt="Metis" />
- <Search />
+ <div className="container">
+ <img src="/icons/mml-logo.png" alt="Metis" />
+ <Search />
+ <HelpBox />
+ </div>
</div>
);