From 258869278e8f42ff7c1795eb024c7c2ed6cfebca Mon Sep 17 00:00:00 2001 From: Echo Date: Thu, 9 Oct 2025 16:08:36 +0200 Subject: [PATCH] Fix: Embed author handle using wrong DisplayName (#36413) --- .../explore/components/author_link.jsx | 23 ------------------- .../explore/components/author_link.tsx | 22 ++++++++++++++++++ 2 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 app/javascript/mastodon/features/explore/components/author_link.jsx create mode 100644 app/javascript/mastodon/features/explore/components/author_link.tsx diff --git a/app/javascript/mastodon/features/explore/components/author_link.jsx b/app/javascript/mastodon/features/explore/components/author_link.jsx deleted file mode 100644 index cf92ebc78..000000000 --- a/app/javascript/mastodon/features/explore/components/author_link.jsx +++ /dev/null @@ -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 ( - - - - ); -}; - -AuthorLink.propTypes = { - accountId: PropTypes.string.isRequired, -}; diff --git a/app/javascript/mastodon/features/explore/components/author_link.tsx b/app/javascript/mastodon/features/explore/components/author_link.tsx new file mode 100644 index 000000000..a4667693a --- /dev/null +++ b/app/javascript/mastodon/features/explore/components/author_link.tsx @@ -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 ( + + + + ); +};