From 18be78475c74b3f3593fc9123b609877a5a85f08 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Mon, 24 Jul 2023 11:11:44 -0400 Subject: [PATCH] Fix bug trying to switch accounts In the profile dropdown, you couldn't click the avatar or the user's name because we had the `to` attribute on the LinkEl. This fixes that by only adding the link props when we render a Link. --- app/soapbox/components/account.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/soapbox/components/account.tsx b/app/soapbox/components/account.tsx index 861b8d4754..18b4de814c 100644 --- a/app/soapbox/components/account.tsx +++ b/app/soapbox/components/account.tsx @@ -179,6 +179,11 @@ const Account = ({ if (withDate) timestamp = account.created_at; const LinkEl: any = withLinkToProfile ? Link : 'div'; + const linkProps = withLinkToProfile ? { + to: `/@${account.acct}`, + title: account.acct, + onClick: (event: React.MouseEvent) => event.stopPropagation(), + } : {}; return (
@@ -188,11 +193,7 @@ const Account = ({ condition={showProfileHoverCard} wrapper={(children) => {children}} > - event.stopPropagation()} - > + {emoji && ( {children}} > - event.stopPropagation()} - > +