2023-05-28 14:18:23 +02:00
|
|
|
import { PureComponent } from 'react';
|
2022-02-09 01:17:07 +01:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { makeGetAccount } from 'flavours/glitch/selectors';
|
2023-05-09 03:11:56 +02:00
|
|
|
import { Avatar } from 'flavours/glitch/components/avatar';
|
2022-02-09 01:17:07 +01:00
|
|
|
|
|
|
|
const makeMapStateToProps = () => {
|
|
|
|
const getAccount = makeGetAccount();
|
|
|
|
|
|
|
|
const mapStateToProps = (state, { accountId }) => ({
|
|
|
|
account: getAccount(state, accountId),
|
|
|
|
});
|
|
|
|
|
|
|
|
return mapStateToProps;
|
|
|
|
};
|
|
|
|
|
2023-05-28 14:18:23 +02:00
|
|
|
class InlineAccount extends PureComponent {
|
2022-02-09 01:17:07 +01:00
|
|
|
|
|
|
|
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>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-24 23:15:25 +01:00
|
|
|
|
|
|
|
export default connect(makeMapStateToProps)(InlineAccount);
|