From 9de78cb69b39a7d6bffe56236ef48af417fb5e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 25 Jul 2024 19:53:48 +0200 Subject: [PATCH] Restore mention link behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/status-content.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/status-content.tsx b/src/components/status-content.tsx index 35700438c4..17d8d7f5bc 100644 --- a/src/components/status-content.tsx +++ b/src/components/status-content.tsx @@ -2,6 +2,7 @@ import clsx from 'clsx'; import parse, { Element, type HTMLReactParserOptions, domToReact, type DOMNode } from 'html-react-parser'; import React, { useState, useRef, useLayoutEffect, useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; +import { Link } from 'react-router-dom'; import Icon from 'soapbox/components/icon'; import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content'; @@ -9,8 +10,8 @@ import { onlyEmoji as isOnlyEmoji } from 'soapbox/utils/rich-content'; import { getTextDirection } from '../utils/rtl'; import HashtagLink from './hashtag-link'; +import HoverRefWrapper from './hover-ref-wrapper'; import Markup from './markup'; -import Mention from './mention'; import Poll from './polls/poll'; import type { Sizes } from 'soapbox/components/ui/text/text'; @@ -105,7 +106,18 @@ const StatusContent: React.FC = React.memo(({ if (classes?.includes('mention')) { const mention = status.mentions.find(({ url }) => domNode.attribs.href === url); if (mention) { - return ; + return ( + + e.stopPropagation()} + > + @{mention.username} + + + ); } }