2016-08-24 21:08:00 +02:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2016-08-31 16:15:12 +02:00
|
|
|
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
2016-08-24 21:08:00 +02:00
|
|
|
|
|
|
|
const DisplayName = React.createClass({
|
2016-08-31 16:15:12 +02:00
|
|
|
|
2016-08-24 21:08:00 +02:00
|
|
|
propTypes: {
|
|
|
|
account: ImmutablePropTypes.map.isRequired
|
|
|
|
},
|
|
|
|
|
2016-08-31 16:15:12 +02:00
|
|
|
mixins: [PureRenderMixin],
|
|
|
|
|
2016-08-24 21:08:00 +02:00
|
|
|
render () {
|
|
|
|
var displayName = this.props.account.get('display_name', this.props.account.get('username'));
|
|
|
|
var acct = this.props.account.get('acct');
|
|
|
|
var url = this.props.account.get('url');
|
|
|
|
|
|
|
|
return (
|
2016-08-25 19:52:55 +02:00
|
|
|
<a href={url} style={{ display: 'inline-block', color: '#616b86', textDecoration: 'none', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '190px' }}>
|
2016-08-24 21:08:00 +02:00
|
|
|
<strong style={{ fontWeight: 'bold', color: '#fff' }}>{displayName}</strong> <span>{acct}</span>
|
|
|
|
</a>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default DisplayName;
|