Don't show follow button for yourself
This commit is contained in:
parent
0cd9943e0d
commit
21d6815de1
|
@ -36,6 +36,7 @@ export function FollowList(props: { userIds: string[] }) {
|
||||||
}
|
}
|
||||||
onFollow={() => onFollow(userId)}
|
onFollow={() => onFollow(userId)}
|
||||||
onUnfollow={() => onUnfollow(userId)}
|
onUnfollow={() => onUnfollow(userId)}
|
||||||
|
hideFollowButton={userId === currentUser?.id}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -47,9 +48,17 @@ function UserFollowItem(props: {
|
||||||
isFollowing: boolean
|
isFollowing: boolean
|
||||||
onFollow: () => void
|
onFollow: () => void
|
||||||
onUnfollow: () => void
|
onUnfollow: () => void
|
||||||
|
hideFollowButton?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
}) {
|
}) {
|
||||||
const { userId, isFollowing, onFollow, onUnfollow, className } = props
|
const {
|
||||||
|
userId,
|
||||||
|
isFollowing,
|
||||||
|
onFollow,
|
||||||
|
onUnfollow,
|
||||||
|
hideFollowButton,
|
||||||
|
className,
|
||||||
|
} = props
|
||||||
const user = useUserById(userId)
|
const user = useUserById(userId)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -58,11 +67,13 @@ function UserFollowItem(props: {
|
||||||
<Avatar username={user?.username} avatarUrl={user?.avatarUrl} />
|
<Avatar username={user?.username} avatarUrl={user?.avatarUrl} />
|
||||||
{user && <UserLink name={user.name} username={user.username} />}
|
{user && <UserLink name={user.name} username={user.username} />}
|
||||||
</Row>
|
</Row>
|
||||||
|
{!hideFollowButton && (
|
||||||
<FollowButton
|
<FollowButton
|
||||||
isFollowing={isFollowing}
|
isFollowing={isFollowing}
|
||||||
onFollow={onFollow}
|
onFollow={onFollow}
|
||||||
onUnfollow={onUnfollow}
|
onUnfollow={onUnfollow}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user