From b2cd6bbe034e7f4b8f1cc4de39c6f26bd7709506 Mon Sep 17 00:00:00 2001
From: ingawei <46611122+ingawei@users.noreply.github.com>
Date: Wed, 12 Oct 2022 01:00:52 -0500
Subject: [PATCH] Inga/de daisy follow button (#1028)
* de daisy follow button
---
web/components/follow-button.tsx | 38 +++++++++++++------------------
web/components/sign-in-button.tsx | 2 +-
2 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/web/components/follow-button.tsx b/web/components/follow-button.tsx
index 6344757d..3c84ec26 100644
--- a/web/components/follow-button.tsx
+++ b/web/components/follow-button.tsx
@@ -5,57 +5,52 @@ import { useFollows } from 'web/hooks/use-follows'
import { useUser } from 'web/hooks/use-user'
import { follow, unfollow } from 'web/lib/firebase/users'
import { withTracking } from 'web/lib/service/analytics'
+import { Button } from './button'
export function FollowButton(props: {
isFollowing: boolean | undefined
onFollow: () => void
onUnfollow: () => void
- small?: boolean
className?: string
}) {
- const { isFollowing, onFollow, onUnfollow, small, className } = props
+ const { isFollowing, onFollow, onUnfollow, className } = props
const user = useUser()
- const smallStyle =
- 'btn !btn-xs border-2 border-gray-500 bg-white normal-case text-gray-500 hover:border-gray-500 hover:bg-white hover:text-gray-500'
-
if (!user || isFollowing === undefined)
return (
-
)
if (isFollowing) {
return (
-
Following
-
+
)
}
return (
-
Follow
-
+
)
}
-export function UserFollowButton(props: { userId: string; small?: boolean }) {
- const { userId, small } = props
+export function UserFollowButton(props: { userId: string }) {
+ const { userId } = props
const user = useUser()
const following = useFollows(user?.id)
const isFollowing = following?.includes(userId)
@@ -67,7 +62,6 @@ export function UserFollowButton(props: { userId: string; small?: boolean }) {
isFollowing={isFollowing}
onFollow={() => follow(user.id, userId)}
onUnfollow={() => unfollow(user.id, userId)}
- small={small}
/>
)
}
diff --git a/web/components/sign-in-button.tsx b/web/components/sign-in-button.tsx
index 48afb6c7..b2f0db69 100644
--- a/web/components/sign-in-button.tsx
+++ b/web/components/sign-in-button.tsx
@@ -10,7 +10,7 @@ export const SignInButton = (props: { className?: string }) => {
return (
{
// login, and then reload the page, to hit any SSR redirect (e.g.
// redirecting from / to /home for logged in users)