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
813 B

// Package imports.
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
8 years ago
import ImmutablePropTypes from 'react-immutable-proptypes';
// The component.
export default function DisplayName ({
account,
className,
inline,
}) {
const computedClass = classNames('display-name', { inline }, className);
8 years ago
// The result.
return account ? (
<span className={computedClass}>
<strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} />
{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,
};