diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-01-06 15:42:04 +0100 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-01-06 15:42:04 +0100 |
commit | c0aa588bc8f85b13b5a55ccd6cdf11bf99048a1c (patch) | |
tree | 4914a9d09b362e222a83b0b9637ed87e11eebe7b /src/client/react/components/container | |
parent | 928edee90f4a35eea20d581e093b002be04e9b47 (diff) |
Add user page
Diffstat (limited to 'src/client/react/components/container')
-rw-r--r-- | src/client/react/components/container/Search.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/react/components/container/Search.js b/src/client/react/components/container/Search.js index 06523be..27b0563 100644 --- a/src/client/react/components/container/Search.js +++ b/src/client/react/components/container/Search.js @@ -6,7 +6,7 @@ import { withRouter } from 'react-router-dom'; import SearchIcon from 'react-icons/lib/md/search'; -import { inputChange, changeSelectedResult } from '../../actions/search'; +import { setUser, inputChange, changeSelectedResult } from '../../actions/search'; import users from '../../users'; import Results from './Results'; @@ -25,6 +25,10 @@ class Search extends React.Component { this.onKeyDown = this.onKeyDown.bind(this); } + componentDidMount() { + this.props.dispatch(setUser(this.props.urlUser)); + } + onFocus() { this.setState({ hasFocus: true, @@ -97,6 +101,7 @@ class Search extends React.Component { Search.propTypes = { selectedResult: PropTypes.string, + urlUser: PropTypes.string, isExactMatch: PropTypes.bool.isRequired, searchText: PropTypes.string.isRequired, dispatch: PropTypes.func.isRequired, @@ -107,6 +112,7 @@ Search.propTypes = { Search.defaultProps = { selectedResult: null, + urlUser: null, }; const mapStateToProps = state => ({ @@ -116,4 +122,4 @@ const mapStateToProps = state => ({ isExactMatch: state.search.isExactMatch, }); -export default connect(mapStateToProps)(withRouter(Search)); +export default withRouter(connect(mapStateToProps)(Search)); |