about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/inline_account.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-02-09 01:17:07 +0100
committerGitHub <noreply@github.com>2022-02-09 01:17:07 +0100
commitfd3a45e3482e86dad3c1dfc069144864c4ff0b0b (patch)
tree41d497599cf1ecb35f9f2e278b67c90e3a850a46 /app/javascript/mastodon/components/inline_account.js
parent2adcad04ff96fc8e7cb9aeefef1b22ea38e65457 (diff)
Add edit history to web UI (#17390)
* Add edit history to web UI

* Change history reducer to store items per status

* Fix missing loading prop
Diffstat (limited to 'app/javascript/mastodon/components/inline_account.js')
-rw-r--r--app/javascript/mastodon/components/inline_account.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/inline_account.js b/app/javascript/mastodon/components/inline_account.js
new file mode 100644
index 000000000..a1b495590
--- /dev/null
+++ b/app/javascript/mastodon/components/inline_account.js
@@ -0,0 +1,34 @@
+import React from 'react';
+import ImmutablePropTypes from 'react-immutable-proptypes';
+import { connect } from 'react-redux';
+import { makeGetAccount } from 'mastodon/selectors';
+import Avatar from 'mastodon/components/avatar';
+
+const makeMapStateToProps = () => {
+  const getAccount = makeGetAccount();
+
+  const mapStateToProps = (state, { accountId }) => ({
+    account: getAccount(state, accountId),
+  });
+
+  return mapStateToProps;
+};
+
+export default @connect(makeMapStateToProps)
+class InlineAccount extends React.PureComponent {
+
+  static propTypes = {
+    account: ImmutablePropTypes.map.isRequired,
+  };
+
+  render () {
+    const { account } = this.props;
+
+    return (
+      <span className='inline-account'>
+        <Avatar size={13} account={account} /> <strong>{account.get('username')}</strong>
+      </span>
+    );
+  }
+
+}