de daisy follow button
This commit is contained in:
parent
a6d5d5ad15
commit
7c2f19126f
|
@ -5,6 +5,7 @@ import { useFollows } from 'web/hooks/use-follows'
|
||||||
import { useUser } from 'web/hooks/use-user'
|
import { useUser } from 'web/hooks/use-user'
|
||||||
import { follow, unfollow } from 'web/lib/firebase/users'
|
import { follow, unfollow } from 'web/lib/firebase/users'
|
||||||
import { withTracking } from 'web/lib/service/analytics'
|
import { withTracking } from 'web/lib/service/analytics'
|
||||||
|
import { Button } from './button'
|
||||||
|
|
||||||
export function FollowButton(props: {
|
export function FollowButton(props: {
|
||||||
isFollowing: boolean | undefined
|
isFollowing: boolean | undefined
|
||||||
|
@ -22,35 +23,33 @@ export function FollowButton(props: {
|
||||||
|
|
||||||
if (!user || isFollowing === undefined)
|
if (!user || isFollowing === undefined)
|
||||||
return (
|
return (
|
||||||
<button
|
<Button size="sm" color="blue" className={className}>
|
||||||
className={clsx('btn btn-sm invisible', small && smallStyle, className)}
|
|
||||||
>
|
|
||||||
Follow
|
Follow
|
||||||
</button>
|
</Button>
|
||||||
)
|
)
|
||||||
|
|
||||||
if (isFollowing) {
|
if (isFollowing) {
|
||||||
return (
|
return (
|
||||||
<button
|
<Button
|
||||||
className={clsx(
|
size="sm"
|
||||||
'btn btn-outline btn-sm',
|
color="gray-outline"
|
||||||
small && smallStyle,
|
className={clsx('my-auto', className)}
|
||||||
className
|
|
||||||
)}
|
|
||||||
onClick={withTracking(onUnfollow, 'unfollow')}
|
onClick={withTracking(onUnfollow, 'unfollow')}
|
||||||
>
|
>
|
||||||
Following
|
Following
|
||||||
</button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<Button
|
||||||
className={clsx('btn btn-sm', small && smallStyle, className)}
|
size="sm"
|
||||||
|
color="blue"
|
||||||
|
className={clsx(className, 'my-auto')}
|
||||||
onClick={withTracking(onFollow, 'follow')}
|
onClick={withTracking(onFollow, 'follow')}
|
||||||
>
|
>
|
||||||
Follow
|
Follow
|
||||||
</button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user