You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
835 B

  1. import React from 'react';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import { connect } from 'react-redux';
  4. import { makeGetAccount } from 'mastodon/selectors';
  5. import Avatar from 'mastodon/components/avatar';
  6. const makeMapStateToProps = () => {
  7. const getAccount = makeGetAccount();
  8. const mapStateToProps = (state, { accountId }) => ({
  9. account: getAccount(state, accountId),
  10. });
  11. return mapStateToProps;
  12. };
  13. export default @connect(makeMapStateToProps)
  14. class InlineAccount extends React.PureComponent {
  15. static propTypes = {
  16. account: ImmutablePropTypes.map.isRequired,
  17. };
  18. render () {
  19. const { account } = this.props;
  20. return (
  21. <span className='inline-account'>
  22. <Avatar size={13} account={account} /> <strong>{account.get('username')}</strong>
  23. </span>
  24. );
  25. }
  26. }