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.
 
 
 
 

28 lines
748 B

  1. import React from 'react';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import PropTypes from 'prop-types';
  4. export default class DisplayName extends React.PureComponent {
  5. static propTypes = {
  6. account: ImmutablePropTypes.map.isRequired,
  7. withAcct: PropTypes.bool,
  8. };
  9. static defaultProps = {
  10. withAcct: true,
  11. };
  12. render () {
  13. const { account, withAcct } = this.props;
  14. const displayNameHtml = { __html: account.get('display_name_html') };
  15. return (
  16. <span className='display-name'>
  17. <bdi><strong className='display-name__html' dangerouslySetInnerHTML={displayNameHtml} /></bdi> {withAcct && <span className='display-name__account'>@{account.get('acct')}</span>}
  18. </span>
  19. );
  20. }
  21. }