aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/presentational
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-12-13 15:53:19 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-12-13 15:53:19 +0100
commit503ab5c66ab524dfe36aed84a01899cd07ed2bc5 (patch)
tree68f3461d561ddc6a8e83898916aba06c193e6ffa /src/client/react/components/presentational
parentfe27a0819a60caaa69b059f0c86d95ab0c4084b7 (diff)
Allow selection of result using keyboard
Diffstat (limited to 'src/client/react/components/presentational')
-rw-r--r--src/client/react/components/presentational/Result.jsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/react/components/presentational/Result.jsx b/src/client/react/components/presentational/Result.jsx
index a4a0b8e..80f65d4 100644
--- a/src/client/react/components/presentational/Result.jsx
+++ b/src/client/react/components/presentational/Result.jsx
@@ -1,10 +1,15 @@
import React from 'react';
import PropTypes from 'prop-types';
+import classnames from 'classnames';
import IconFromUserType from './IconFromUserType';
-const Result = ({ user }) => (
- <div className="search__result">
+const Result = ({ user, selected }) => (
+ <div
+ className={classnames('search__result', {
+ 'search__result--selected': selected,
+ })}
+ >
<div className="search__icon-wrapper"><IconFromUserType userType={user.type} /></div>
<div className="search__result__text">{user.value}</div>
</div>
@@ -15,6 +20,7 @@ Result.propTypes = {
value: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
}).isRequired,
+ selected: PropTypes.bool.isRequired,
};
export default Result;