aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/presentational
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-01-31 16:13:02 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-01-31 16:13:02 +0100
commitf00f7adb339f0587c8cf4a82ac2dadebe6a25bfd (patch)
tree12f9786d99084f427d9f652e6c4b53cf70d92daa /src/client/react/components/presentational
parent54d166b6756929843ff0804f5da1507fc459f767 (diff)
Add click functionality to result
Diffstat (limited to 'src/client/react/components/presentational')
-rw-r--r--src/client/react/components/presentational/Result.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/react/components/presentational/Result.js b/src/client/react/components/presentational/Result.js
index 0b9e024..6d39a80 100644
--- a/src/client/react/components/presentational/Result.js
+++ b/src/client/react/components/presentational/Result.js
@@ -5,13 +5,17 @@ import users from '../../users';
import IconFromUserType from './IconFromUserType';
-const Result = ({ userId, isSelected }) => (
+const Result = ({ userId, isSelected, onClick }) => (
+ // eslint-disable-next-line
<div
className={classnames('search__result', {
'search__result--selected': isSelected,
})}
+ onClick={onClick}
>
- <div className="search__icon-wrapper"><IconFromUserType userType={users.byId[userId].type} /></div>
+ <div className="search__icon-wrapper">
+ <IconFromUserType userType={users.byId[userId].type} />
+ </div>
<div className="search__result__text">{users.byId[userId].value}</div>
</div>
);
@@ -19,6 +23,7 @@ const Result = ({ userId, isSelected }) => (
Result.propTypes = {
userId: PropTypes.string.isRequired,
isSelected: PropTypes.bool.isRequired,
+ onClick: PropTypes.func.isRequired,
};
export default Result;