about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/compose
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-12 14:33:21 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-12 14:36:10 +0100
commit09218d4c0152013750dd1c127d3c8267dc45f880 (patch)
tree7cd9975b84a28de92403c80f483d08e471b10155 /app/assets/javascripts/components/features/compose
parentcd765f26a9610e160ffd347637fca40d7b80164e (diff)
Use full-text search for autosuggestions
Diffstat (limited to 'app/assets/javascripts/components/features/compose')
-rw-r--r--app/assets/javascripts/components/features/compose/components/autosuggest_account.jsx11
-rw-r--r--app/assets/javascripts/components/features/compose/containers/autosuggest_account_container.jsx15
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);