Refactor: Replace all display name usage for new component (#36137)

This commit is contained in:
Echo 2025-09-17 11:00:57 +02:00 committed by GitHub
commit dfef7d9407
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 198 additions and 364 deletions

View file

@ -1,9 +1,8 @@
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { Avatar } from 'mastodon/components/avatar';
import { useAppSelector } from 'mastodon/store';
import { LinkedDisplayName } from '@/mastodon/components/display_name';
export const AuthorLink = ({ accountId }) => {
const account = useAppSelector(state => state.getIn(['accounts', accountId]));
@ -13,10 +12,9 @@ export const AuthorLink = ({ accountId }) => {
}
return (
<Link to={`/@${account.get('acct')}`} className='story__details__shared__author-link' data-hover-card-account={accountId}>
<LinkedDisplayName displayProps={{account}} className='story__details__shared__author-link'>
<Avatar account={account} size={16} />
<bdi dangerouslySetInnerHTML={{ __html: account.get('display_name_html') }} />
</Link>
</LinkedDisplayName>
);
};