2020-06-15 22:59:48 -04:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import { makeGetAccount } from '../selectors'
|
|
|
|
import Avatar from './avatar'
|
|
|
|
import DisplayName from './display_name'
|
2019-08-09 12:06:27 -04:00
|
|
|
|
2019-08-07 01:02:36 -04:00
|
|
|
const makeMapStateToProps = () => {
|
2020-06-15 22:59:48 -04:00
|
|
|
const getAccount = makeGetAccount()
|
2019-08-07 01:02:36 -04:00
|
|
|
|
|
|
|
const mapStateToProps = (state, { id }) => ({
|
|
|
|
account: getAccount(state, id),
|
2020-06-15 22:59:48 -04:00
|
|
|
})
|
2019-08-07 01:02:36 -04:00
|
|
|
|
2020-06-15 22:59:48 -04:00
|
|
|
return mapStateToProps
|
|
|
|
}
|
2019-08-07 01:02:36 -04:00
|
|
|
|
2020-02-24 16:56:07 -05:00
|
|
|
export default
|
|
|
|
@connect(makeMapStateToProps)
|
2019-08-07 01:02:36 -04:00
|
|
|
class AutosuggestAccount extends ImmutablePureComponent {
|
2019-07-02 03:10:25 -04:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
2020-04-11 18:29:19 -04:00
|
|
|
}
|
2019-07-02 03:10:25 -04:00
|
|
|
|
|
|
|
render () {
|
2020-06-15 22:59:48 -04:00
|
|
|
const { account } = this.props
|
2019-07-02 03:10:25 -04:00
|
|
|
|
|
|
|
return (
|
2020-06-15 22:59:48 -04:00
|
|
|
<div
|
2020-06-15 23:16:43 -04:00
|
|
|
className={[_s.default, _s.cursorPointer, _s.bgSubtle_onHover, _s.flexRow, _s.py10, _s.alignItemsCenter, _s.px10, _s.borderBottom1PX, _s.borderColorSecondary].join(' ')}
|
2020-06-15 22:59:48 -04:00
|
|
|
title={account.get('acct')}
|
|
|
|
>
|
|
|
|
<Avatar account={account} size={26} />
|
|
|
|
<div className={_s.ml10}>
|
|
|
|
<DisplayName account={account} noRelationship noHover />
|
2019-08-07 01:02:36 -04:00
|
|
|
</div>
|
2019-07-02 03:10:25 -04:00
|
|
|
</div>
|
2020-06-15 22:59:48 -04:00
|
|
|
)
|
2019-07-02 03:10:25 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|