aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/container/Search.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/react/components/container/Search.jsx')
-rw-r--r--src/client/react/components/container/Search.jsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/client/react/components/container/Search.jsx b/src/client/react/components/container/Search.jsx
index 7a2822f..7890423 100644
--- a/src/client/react/components/container/Search.jsx
+++ b/src/client/react/components/container/Search.jsx
@@ -7,8 +7,8 @@ import SearchIcon from 'react-icons/lib/md/search';
import { inputChange, focusChange } from '../../actions/search';
+import Results from './Results';
import IconFromUserType from '../presentational/IconFromUserType';
-import Result from '../presentational/Result';
const userShape = {
value: PropTypes.string.isRequired,
@@ -21,16 +21,14 @@ const Search = ({
onBlur,
hasFocus,
value,
- results,
exactMatch,
}) => (
- <div className={classnames('search', { 'search--has-focus': hasFocus, 'search--has-results': results.length > 0 })}>
+ <div className={classnames('search', { 'search--has-focus': hasFocus })}>
<div className="search__input-wrapper">
- {/* Show the icon from the exact match if there is an exact match, otherwise show the search icon. */}
<div className="search__icon-wrapper">
<IconFromUserType
userType={exactMatch ? exactMatch.type : null}
- default={<SearchIcon />}
+ defaultIcon={<SearchIcon />}
/>
</div>
<input
@@ -42,9 +40,7 @@ const Search = ({
onBlur={onBlur}
/>
</div>
- {results.map(user => (
- <Result key={user.value} user={user} />
- ))}
+ <Results />
</div>
);
@@ -54,7 +50,6 @@ Search.propTypes = {
onBlur: PropTypes.func.isRequired,
hasFocus: PropTypes.bool.isRequired,
value: PropTypes.string.isRequired,
- results: PropTypes.arrayOf(PropTypes.shape(userShape)).isRequired,
exactMatch: PropTypes.shape(userShape),
};