2
0

Fix: Embed author handle using wrong DisplayName (#36413)

This commit is contained in:
Echo
2025-10-09 16:08:36 +02:00
committed by GitHub
parent d4a4a7177a
commit 258869278e
2 changed files with 22 additions and 23 deletions

View File

@@ -1,23 +0,0 @@
import PropTypes from 'prop-types';
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]));
if (!account) {
return null;
}
return (
<LinkedDisplayName displayProps={{account}} className='story__details__shared__author-link'>
<Avatar account={account} size={16} />
</LinkedDisplayName>
);
};
AuthorLink.propTypes = {
accountId: PropTypes.string.isRequired,
};

View File

@@ -0,0 +1,22 @@
import type { FC } from 'react';
import { LinkedDisplayName } from '@/mastodon/components/display_name';
import { Avatar } from 'mastodon/components/avatar';
import { useAppSelector } from 'mastodon/store';
export const AuthorLink: FC<{ accountId: string }> = ({ accountId }) => {
const account = useAppSelector((state) => state.accounts.get(accountId));
if (!account) {
return null;
}
return (
<LinkedDisplayName
displayProps={{ account, variant: 'simple' }}
className='story__details__shared__author-link'
>
<Avatar account={account} size={16} />
</LinkedDisplayName>
);
};