You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
692 B

7 years ago
7 years ago
7 years ago
  1. import ImmutablePropTypes from 'react-immutable-proptypes';
  2. const DisplayName = React.createClass({
  3. propTypes: {
  4. account: ImmutablePropTypes.map.isRequired
  5. },
  6. render () {
  7. let displayName = this.props.account.get('display_name');
  8. if (displayName.length === 0) {
  9. displayName = this.props.account.get('username');
  10. }
  11. return (
  12. <span style={{ display: 'block', maxWidth: '100%', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
  13. <strong style={{ fontWeight: 'bold' }}>{displayName}</strong> <span style={{ fontSize: '14px' }}>@{this.props.account.get('acct')}</span>
  14. </span>
  15. );
  16. }
  17. });
  18. export default DisplayName;