aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-01-06 13:12:11 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-01-06 13:12:11 +0100
commit70a9b0be3782122750388c24eb98b0d45e6fc6d1 (patch)
tree44b8117c35095a3a4d34d2fe6802252a51853e6a /src/client/react/components
parent13cac5dcd54bf87767396763226fd33719964d22 (diff)
Save searchText in redux store
Diffstat (limited to 'src/client/react/components')
-rw-r--r--src/client/react/components/container/Search.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/react/components/container/Search.js b/src/client/react/components/container/Search.js
index 957f76e..06523be 100644
--- a/src/client/react/components/container/Search.js
+++ b/src/client/react/components/container/Search.js
@@ -62,6 +62,7 @@ class Search extends React.Component {
const {
selectedResult,
isExactMatch,
+ searchText,
dispatch,
} = this.props;
@@ -82,6 +83,7 @@ class Search extends React.Component {
id="search__input"
onChange={event => dispatch(inputChange(event.target.value))}
onKeyDown={this.onKeyDown}
+ value={searchText}
placeholder="Zoeken"
onFocus={this.onFocus}
onBlur={this.onBlur}
@@ -96,6 +98,7 @@ class Search extends React.Component {
Search.propTypes = {
selectedResult: PropTypes.string,
isExactMatch: PropTypes.bool.isRequired,
+ searchText: PropTypes.string.isRequired,
dispatch: PropTypes.func.isRequired,
history: PropTypes.shape({
push: PropTypes.func.isRequired,
@@ -108,6 +111,7 @@ Search.defaultProps = {
const mapStateToProps = state => ({
results: state.search.results,
+ searchText: state.search.searchText,
selectedResult: state.search.selectedResult,
isExactMatch: state.search.isExactMatch,
});