mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-16 19:55:14 +00:00
0c7f710be1
Port 7861c5f108
to glitch-soc
31 lines
824 B
JavaScript
31 lines
824 B
JavaScript
// Package imports.
|
|
import classNames from 'classnames';
|
|
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
// The component.
|
|
export default function DisplayName ({
|
|
account,
|
|
className,
|
|
inline,
|
|
}) {
|
|
const computedClass = classNames('display-name', { inline }, className);
|
|
|
|
// The result.
|
|
return account ? (
|
|
<span className={computedClass}>
|
|
<bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi>
|
|
{inline ? ' ' : null}
|
|
<span className='display-name__account'>@{account.get('acct')}</span>
|
|
</span>
|
|
) : null;
|
|
}
|
|
|
|
// Props.
|
|
DisplayName.propTypes = {
|
|
account: ImmutablePropTypes.map,
|
|
className: PropTypes.string,
|
|
inline: PropTypes.bool,
|
|
};
|