2020-08-17 15:07:16 -05:00
|
|
|
import React from 'react'
|
2020-08-17 15:59:29 -05:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-17 15:39:25 -05:00
|
|
|
import { connect } from 'react-redux'
|
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
|
|
|
class AutosuggestAccount extends ImmutablePureComponent {
|
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-08-18 15:49:11 -05:00
|
|
|
className={[_s.d, _s.cursorPointer, _s.bgSubtle_onHover, _s.flexRow, _s.py10, _s.aiCenter, _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
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-17 19:57:35 -05:00
|
|
|
|
2020-08-20 10:26:00 -05:00
|
|
|
const mapStateToProps = (state, { id }) => ({
|
2020-08-17 19:57:35 -05:00
|
|
|
account: makeGetAccount()(state, id),
|
|
|
|
})
|
|
|
|
|
|
|
|
AutosuggestAccount.propTypes = {
|
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(AutosuggestAccount)
|