Redesign direct messages column (#9022)
This commit is contained in:
parent
029943d59b
commit
eb1b9903a6
6 changed files with 152 additions and 108 deletions
|
@ -1,25 +1,28 @@
|
|||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export default class DisplayName extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
account: ImmutablePropTypes.map.isRequired,
|
||||
withAcct: PropTypes.bool,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
withAcct: true,
|
||||
others: ImmutablePropTypes.list,
|
||||
};
|
||||
|
||||
render () {
|
||||
const { account, withAcct } = this.props;
|
||||
const { account, others } = this.props;
|
||||
const displayNameHtml = { __html: account.get('display_name_html') };
|
||||
|
||||
let suffix;
|
||||
|
||||
if (others && others.size > 1) {
|
||||
suffix = `+${others.size}`;
|
||||
} else {
|
||||
suffix = <span className='display-name__account'>@{account.get('acct')}</span>;
|
||||
}
|
||||
|
||||
return (
|
||||
<span className='display-name'>
|
||||
<bdi><strong className='display-name__html' dangerouslySetInnerHTML={displayNameHtml} /></bdi> {withAcct && <span className='display-name__account'>@{account.get('acct')}</span>}
|
||||
<bdi><strong className='display-name__html' dangerouslySetInnerHTML={displayNameHtml} /></bdi> {suffix}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue