0
0
Fork 0

Redesign public hashtag page to use a masonry layout (#9822)

This commit is contained in:
Eugen Rochko 2019-01-16 19:47:46 +01:00 committed by GitHub
parent 4ab42287c0
commit bc642ac24b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 392 additions and 77 deletions

View file

@ -1,15 +1,17 @@
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,
others: ImmutablePropTypes.list,
localDomain: PropTypes.string,
};
render () {
const { account, others } = this.props;
const { account, others, localDomain } = this.props;
const displayNameHtml = { __html: account.get('display_name_html') };
let suffix;
@ -17,7 +19,13 @@ export default class DisplayName extends React.PureComponent {
if (others && others.size > 1) {
suffix = `+${others.size}`;
} else {
suffix = <span className='display-name__account'>@{account.get('acct')}</span>;
let acct = account.get('acct');
if (acct.indexOf('@') === -1 && localDomain) {
acct = `${acct}@${localDomain}`;
}
suffix = <span className='display-name__account'>@{acct}</span>;
}
return (