0
0
Fork 0

Add server banner to web app, add GET /api/v2/instance to REST API (#19294)

This commit is contained in:
Eugen Rochko 2022-10-05 03:47:56 +02:00 committed by GitHub
parent cedcece0cc
commit d2528b26b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 473 additions and 196 deletions

View file

@ -2,11 +2,12 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { autoPlayGif } from 'mastodon/initial_state';
import Skeleton from 'mastodon/components/skeleton';
export default class DisplayName extends React.PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
account: ImmutablePropTypes.map,
others: ImmutablePropTypes.list,
localDomain: PropTypes.string,
};
@ -48,7 +49,7 @@ export default class DisplayName extends React.PureComponent {
if (others.size - 2 > 0) {
suffix = `+${others.size - 2}`;
}
} else {
} else if ((others && others.size > 0) || this.props.account) {
if (others && others.size > 0) {
account = others.first();
} else {
@ -63,6 +64,9 @@ export default class DisplayName extends React.PureComponent {
displayName = <bdi><strong className='display-name__html' dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} /></bdi>;
suffix = <span className='display-name__account'>@{acct}</span>;
} else {
displayName = <bdi><strong className='display-name__html'><Skeleton width='10ch' /></strong></bdi>;
suffix = <span className='display-name__account'><Skeleton width='7ch' /></span>;
}
return (