Skip to content

Commit 547708c

Browse files
committed
Profile links
1 parent 1f10495 commit 547708c

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

apps/web/src/components/FollowList.jsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,19 @@ const CHECK_FOLLOWING_STATUS = gql`
8282
`;
8383

8484
function UserCard({ user, isFollowing, onFollowToggle, currentUserId }) {
85-
const navigate = useNavigate();
8685
const isOwnProfile = currentUserId === user.user_id;
86+
// Fall back to the user id if a slug is missing; /u/<uuid> canonicalises to the slug.
87+
const profileUrl = `/u/${user.slug || user.user_id}`;
8788

8889
return (
8990
<Card className="mb-3 card-bg-dark">
9091
<div className="flex align-items-center justify-content-between">
91-
<div className="flex align-items-center">
92+
{/* The whole identity block (avatar + name + handle) links to the profile. */}
93+
<Link
94+
to={profileUrl}
95+
className="flex align-items-center no-underline cursor-pointer"
96+
style={{ color: "inherit" }}
97+
>
9298
<Avatar
9399
image={generateRetroAvatar(user.slug || user.user_id, 64)}
94100
size="large"
@@ -101,15 +107,13 @@ function UserCard({ user, isFollowing, onFollowToggle, currentUserId }) {
101107
}}
102108
/>
103109
<div>
104-
<Link to={`/u/${user.slug}`} className="no-underline">
105-
<h4 className="m-0 mb-1">{user.greeting_name}</h4>
106-
</Link>
110+
<h4 className="m-0 mb-1">{user.greeting_name}</h4>
107111
<p className="text-500 m-0 text-sm">@{user.slug}</p>
108112
{user.bio && (
109113
<p className="text-400 m-0 mt-2 text-sm">{user.bio}</p>
110114
)}
111115
</div>
112-
</div>
116+
</Link>
113117
<div className="flex flex-column align-items-end">
114118
{!isOwnProfile && currentUserId && (
115119
<Button

0 commit comments

Comments
 (0)