2016-09-01 12:12:11 +00:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
|
|
|
|
const DisplayName = React.createClass({
|
|
|
|
|
|
|
|
propTypes: {
|
|
|
|
account: ImmutablePropTypes.map.isRequired
|
|
|
|
},
|
|
|
|
|
|
|
|
render () {
|
2016-09-04 12:04:26 +00:00
|
|
|
let displayName = this.props.account.get('display_name');
|
|
|
|
|
|
|
|
if (displayName.length === 0) {
|
|
|
|
displayName = this.props.account.get('username');
|
|
|
|
}
|
|
|
|
|
2016-09-01 12:12:11 +00:00
|
|
|
return (
|
|
|
|
<span style={{ display: 'block', maxWidth: '100%', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
|
2016-09-04 12:04:26 +00:00
|
|
|
<strong style={{ fontWeight: 'bold' }}>{displayName}</strong> <span style={{ fontSize: '14px' }}>@{this.props.account.get('acct')}</span>
|
2016-09-01 12:12:11 +00:00
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
export default DisplayName;
|