import { PureComponent } from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { makeGetAccount } from 'flavours/glitch/selectors'; import { Avatar } from 'flavours/glitch/components/avatar'; const makeMapStateToProps = () => { const getAccount = makeGetAccount(); const mapStateToProps = (state, { accountId }) => ({ account: getAccount(state, accountId), }); return mapStateToProps; }; class InlineAccount extends PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, }; render () { const { account } = this.props; return ( {account.get('username')} ); } } export default connect(makeMapStateToProps)(InlineAccount);