From d5024745f163ef38a833c3253177ebc67f2e8642 Mon Sep 17 00:00:00 2001 From: SwiftHawk Date: Fri, 5 Jul 2024 14:04:20 +0500 Subject: [PATCH] fix: navigation to profile page from username component --- src/components/username.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/username.tsx b/src/components/username.tsx index 404e4cb..7ab6d3d 100644 --- a/src/components/username.tsx +++ b/src/components/username.tsx @@ -65,13 +65,14 @@ export const UserComponent = ({ pubkey, name, image }: UserProps) => { const npub = hexToNpub(pubkey) const roboImage = `https://robohash.org/${npub}.png?set=set3` + const handleClick = (e: React.MouseEvent) => { + e.stopPropagation() + navigate(getProfileRoute(pubkey)) + } + return ( { - e.stopPropagation() - navigate(getProfileRoute(pubkey)) - }} > { borderStyle: 'solid', borderColor: `#${pubkey.substring(0, 6)}` }} + onClick={handleClick} /> { cursor: 'pointer', color: theme.palette.text.primary }} + onClick={handleClick} > {name}