]> cat aescling's git repositories - mastodon.git/blob - app/javascript/flavours/glitch/components/display_name.js
Merge branch 'master' into glitch-soc/merge-upstream
[mastodon.git] / app / javascript / flavours / glitch / components / display_name.js
1 // Package imports.
2 import classNames from 'classnames';
3 import PropTypes from 'prop-types';
4 import React from 'react';
5 import ImmutablePropTypes from 'react-immutable-proptypes';
6
7 // The component.
8 export default function DisplayName ({
9 account,
10 className,
11 inline,
12 }) {
13 const computedClass = classNames('display-name', { inline }, className);
14
15 // The result.
16 return account ? (
17 <span className={computedClass}>
18 <bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi>
19 {inline ? ' ' : null}
20 <span className='display-name__account'>@{account.get('acct')}</span>
21 </span>
22 ) : null;
23 }
24
25 // Props.
26 DisplayName.propTypes = {
27 account: ImmutablePropTypes.map,
28 className: PropTypes.string,
29 inline: PropTypes.bool,
30 };
This page took 0.081893 seconds and 4 git commands to generate.