From fe27a0819a60caaa69b059f0c86d95ab0c4084b7 Mon Sep 17 00:00:00 2001
From: Noah Loomans <noahloomans@gmail.com>
Date: Wed, 13 Dec 2017 12:26:36 +0100
Subject: Prepair changeSelectedResult

---
 src/client/react/components/container/Search.jsx | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'src/client/react/components/container/Search.jsx')

diff --git a/src/client/react/components/container/Search.jsx b/src/client/react/components/container/Search.jsx
index e974bd9..7e33e84 100644
--- a/src/client/react/components/container/Search.jsx
+++ b/src/client/react/components/container/Search.jsx
@@ -42,7 +42,8 @@ class Search extends React.Component {
   render() {
     const {
       value,
-      exactMatch,
+      selectedResult,
+      isExactMatch,
       dispatch,
     } = this.props;
 
@@ -55,7 +56,7 @@ class Search extends React.Component {
         <div className="search__input-wrapper">
           <div className="search__icon-wrapper">
             <IconFromUserType
-              userType={exactMatch ? exactMatch.type : null}
+              userType={isExactMatch ? selectedResult.type : null}
               defaultIcon={<SearchIcon />}
             />
           </div>
@@ -76,18 +77,20 @@ class Search extends React.Component {
 
 Search.propTypes = {
   value: PropTypes.string.isRequired,
-  exactMatch: PropTypes.shape(userShape),
+  selectedResult: PropTypes.shape(userShape),
+  isExactMatch: PropTypes.bool.isRequired,
   dispatch: PropTypes.func.isRequired,
 };
 
 Search.defaultProps = {
-  exactMatch: null,
+  selectedResult: null,
 };
 
 const mapStateToProps = state => ({
   results: state.search.results,
   value: state.search.input,
-  exactMatch: state.search.exactMatch,
+  selectedResult: state.search.selectedResult,
+  isExactMatch: state.search.isExactMatch,
 });
 
 export default connect(mapStateToProps)(Search);
-- 
cgit v1.1

