@heroicons/react/solid#UserRemoveIcon TypeScript Examples
The following examples show how to use
@heroicons/react/solid#UserRemoveIcon.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MobileUsers.tsx From server with MIT License | 5 votes |
UserCard = (props: UserCardProps) => {
const { user, isFollowing, updateFollowing } = props
const { name } = getNameAndSubName(user)
const [loading, updateLoading] = useState(false)
const history = useHistory()
return (
<div className="mobile-users-user-card-wrapper" onClick={e => {
e.stopPropagation()
history.push(`/profile/${user.id}`)
}}>
<div className="mobile-users-user-card-avatar">
<AvatarV2 className="mobile-users-user-card-avatar-img" user={user}/>
</div>
<div className='mobile-users-user-card-right'>
<div className="mobile-users-user-card-name">
{name}
</div>
<div className='mobile-users-user-card-buttons'>
<div
className={
!loading ?
"mobile-users-user-card-button" :
"mobile-users-user-card-button mobile-users-user-card-button-disabled"
}
onClick={async (e) => {
e.stopPropagation()
if (loading) {
return
}
updateLoading(true)
if (isFollowing) {
await api.unfollow(user.id)
} else {
await api.follow(user.id)
}
updateFollowing(!isFollowing)
updateLoading(false)
}}
>
{
isFollowing ? <UserRemoveIcon /> : <UserAddIcon />
}
</div>
</div>
</div>
</div>
)
}