2023-05-23 11:52:27 +03:00
|
|
|
import { PureComponent } from 'react';
|
2023-05-23 18:15:17 +03:00
|
|
|
|
2022-02-09 02:17:07 +02:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import { connect } from 'react-redux';
|
2023-05-23 18:15:17 +03:00
|
|
|
|
2023-05-09 04:11:56 +03:00
|
|
|
import { Avatar } from 'mastodon/components/avatar';
|
2023-05-23 18:15:17 +03:00
|
|
|
import { makeGetAccount } from 'mastodon/selectors';
|
2022-02-09 02:17:07 +02:00
|
|
|
|
|
|
|
const makeMapStateToProps = () => {
|
|
|
|
const getAccount = makeGetAccount();
|
|
|
|
|
|
|
|
const mapStateToProps = (state, { accountId }) => ({
|
|
|
|
account: getAccount(state, accountId),
|
|
|
|
});
|
|
|
|
|
|
|
|
return mapStateToProps;
|
|
|
|
};
|
|
|
|
|
2023-05-23 11:52:27 +03:00
|
|
|
class InlineAccount extends PureComponent {
|
2022-02-09 02:17:07 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
2023-11-03 17:00:03 +02:00
|
|
|
account: ImmutablePropTypes.record.isRequired,
|
2022-02-09 02:17:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { account } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<span className='inline-account'>
|
|
|
|
<Avatar size={13} account={account} /> <strong>{account.get('username')}</strong>
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-03-24 04:17:53 +02:00
|
|
|
|
|
|
|
export default connect(makeMapStateToProps)(InlineAccount);
|