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