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.
36 lines
875 B
36 lines
875 B
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 (
|
|
<span className='inline-account'>
|
|
<Avatar size={13} account={account} /> <strong>{account.get('username')}</strong>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
export default connect(makeMapStateToProps)(InlineAccount);
|