diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-12 14:33:21 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-11-12 14:36:10 +0100 |
commit | 09218d4c0152013750dd1c127d3c8267dc45f880 (patch) | |
tree | 7cd9975b84a28de92403c80f483d08e471b10155 /app/assets/javascripts/components/features/compose | |
parent | cd765f26a9610e160ffd347637fca40d7b80164e (diff) |
Use full-text search for autosuggestions
Diffstat (limited to 'app/assets/javascripts/components/features/compose')
2 files changed, 26 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/features/compose/components/autosuggest_account.jsx b/app/assets/javascripts/components/features/compose/components/autosuggest_account.jsx new file mode 100644 index 000000000..9ea7f190f --- /dev/null +++ b/app/assets/javascripts/components/features/compose/components/autosuggest_account.jsx @@ -0,0 +1,11 @@ +import Avatar from '../../../components/avatar'; +import DisplayName from '../../../components/display_name'; + +const AutosuggestAccount = ({ account }) => ( + <div style={{ overflow: 'hidden' }}> + <div style={{ float: 'left', marginRight: '5px' }}><Avatar src={account.get('avatar')} size={18} /></div> + <DisplayName account={account} /> + </div> +); + +export default AutosuggestAccount; diff --git a/app/assets/javascripts/components/features/compose/containers/autosuggest_account_container.jsx b/app/assets/javascripts/components/features/compose/containers/autosuggest_account_container.jsx new file mode 100644 index 000000000..de76a364d --- /dev/null +++ b/app/assets/javascripts/components/features/compose/containers/autosuggest_account_container.jsx @@ -0,0 +1,15 @@ +import { connect } from 'react-redux'; +import AutosuggestAccount from '../components/autosuggest_account'; +import { makeGetAccount } from '../../../selectors'; + +const makeMapStateToProps = () => { + const getAccount = makeGetAccount(); + + const mapStateToProps = (state, { id }) => ({ + account: getAccount(state, id) + }); + + return mapStateToProps; +}; + +export default connect(makeMapStateToProps)(AutosuggestAccount); |