2019-07-02 08:10:25 +01:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
2020-01-29 21:53:33 +00:00
|
|
|
import { makeGetAccount } from '../../selectors';
|
2019-08-09 17:06:27 +01:00
|
|
|
import Avatar from '../avatar';
|
|
|
|
import DisplayName from '../display_name';
|
|
|
|
|
2019-08-07 06:02:36 +01:00
|
|
|
const makeMapStateToProps = () => {
|
|
|
|
const getAccount = makeGetAccount();
|
|
|
|
|
|
|
|
const mapStateToProps = (state, { id }) => ({
|
|
|
|
account: getAccount(state, id),
|
|
|
|
});
|
|
|
|
|
|
|
|
return mapStateToProps;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default @connect(makeMapStateToProps)
|
|
|
|
class AutosuggestAccount extends ImmutablePureComponent {
|
2019-07-02 08:10:25 +01:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { account } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='autosuggest-account' title={account.get('acct')}>
|
2019-08-09 17:06:27 +01:00
|
|
|
<div className='autosuggest-account__icon'>
|
2019-08-07 06:02:36 +01:00
|
|
|
<Avatar account={account} size={18} />
|
|
|
|
</div>
|
2019-07-02 08:10:25 +01:00
|
|
|
<DisplayName account={account} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|