mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-25 17:44:14 -05:00
7fe5623a27
Port 3bf2a7296e
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
38 lines
880 B
JavaScript
38 lines
880 B
JavaScript
import { PureComponent } from 'react';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
import { connect } from 'react-redux';
|
|
|
|
import { Avatar } from 'flavours/glitch/components/avatar';
|
|
import { makeGetAccount } from 'flavours/glitch/selectors';
|
|
|
|
const makeMapStateToProps = () => {
|
|
const getAccount = makeGetAccount();
|
|
|
|
const mapStateToProps = (state, { accountId }) => ({
|
|
account: getAccount(state, accountId),
|
|
});
|
|
|
|
return mapStateToProps;
|
|
};
|
|
|
|
class InlineAccount extends PureComponent {
|
|
|
|
static propTypes = {
|
|
account: ImmutablePropTypes.record.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);
|