The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

31 lines
784 B

  1. import React from 'react';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. export default class DisplayName extends React.PureComponent {
  4. static propTypes = {
  5. account: ImmutablePropTypes.map.isRequired,
  6. others: ImmutablePropTypes.list,
  7. };
  8. render () {
  9. const { account, others } = this.props;
  10. const displayNameHtml = { __html: account.get('display_name_html') };
  11. let suffix;
  12. if (others && others.size > 1) {
  13. suffix = `+${others.size}`;
  14. } else {
  15. suffix = <span className='display-name__account'>@{account.get('acct')}</span>;
  16. }
  17. return (
  18. <span className='display-name'>
  19. <bdi><strong className='display-name__html' dangerouslySetInnerHTML={displayNameHtml} /></bdi> {suffix}
  20. </span>
  21. );
  22. }
  23. }