mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-26 18:14:15 -05:00
fd3a45e348
* Add edit history to web UI * Change history reducer to store items per status * Fix missing loading prop
35 lines
835 B
JavaScript
35 lines
835 B
JavaScript
import React from 'react';
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
import { connect } from 'react-redux';
|
|
import { makeGetAccount } from 'mastodon/selectors';
|
|
import Avatar from 'mastodon/components/avatar';
|
|
|
|
const makeMapStateToProps = () => {
|
|
const getAccount = makeGetAccount();
|
|
|
|
const mapStateToProps = (state, { accountId }) => ({
|
|
account: getAccount(state, accountId),
|
|
});
|
|
|
|
return mapStateToProps;
|
|
};
|
|
|
|
export default @connect(makeMapStateToProps)
|
|
class InlineAccount extends React.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>
|
|
);
|
|
}
|
|
|
|
}
|