2017-12-29 14:55:06 -08:00
|
|
|
import classNames from 'classnames';
|
|
|
|
import PropTypes from 'prop-types';
|
2017-05-02 17:04:16 -07:00
|
|
|
import React from 'react';
|
2016-09-01 05:12:11 -07:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
|
2017-06-23 10:36:54 -07:00
|
|
|
export default class DisplayName extends React.PureComponent {
|
2016-09-12 17:24:40 -07:00
|
|
|
|
2017-05-12 05:44:10 -07:00
|
|
|
static propTypes = {
|
2017-05-20 08:31:47 -07:00
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
2017-12-29 14:55:06 -08:00
|
|
|
className: PropTypes.string,
|
2017-05-12 05:44:10 -07:00
|
|
|
};
|
|
|
|
|
2016-09-01 05:12:11 -07:00
|
|
|
render () {
|
2017-12-29 14:55:06 -08:00
|
|
|
const {
|
|
|
|
account,
|
|
|
|
className,
|
|
|
|
} = this.props;
|
|
|
|
const computedClass = classNames('display-name', className);
|
|
|
|
const displayNameHtml = { __html: account.get('display_name_html') };
|
2016-09-04 05:04:26 -07:00
|
|
|
|
2016-09-01 05:12:11 -07:00
|
|
|
return (
|
2017-12-29 14:55:06 -08:00
|
|
|
<span className={computedClass}>
|
2017-08-07 11:32:03 -07:00
|
|
|
<strong className='display-name__html' dangerouslySetInnerHTML={displayNameHtml} /> <span className='display-name__account'>@{this.props.account.get('acct')}</span>
|
2016-09-01 05:12:11 -07:00
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-04-21 11:05:35 -07:00
|
|
|
}
|