diff --git a/web/components/follow-fold-button.tsx b/web/components/follow-fold-button.tsx index 106b2489..f394aae9 100644 --- a/web/components/follow-fold-button.tsx +++ b/web/components/follow-fold-button.tsx @@ -11,7 +11,7 @@ export function FollowFoldButton(props: { fold: Fold; className?: string }) { const following = useFollowingFold(fold, user) const onFollow = () => { - if (user) followFold(fold, user) + if (user) followFold(fold.id, user.id) } const onUnfollow = () => { diff --git a/web/components/tags-list.tsx b/web/components/tags-list.tsx index e307c577..16cf5357 100644 --- a/web/components/tags-list.tsx +++ b/web/components/tags-list.tsx @@ -1,4 +1,6 @@ import clsx from 'clsx' +import { useUser } from '../hooks/use-user' +import { followFold } from '../lib/firebase/folds' import { Row } from './layout/row' import { SiteLink } from './site-link' @@ -44,9 +46,19 @@ export function TagsList(props: { ) } -export function FoldTag(props: { fold: { slug: string; name: string } }) { - const { fold } = props +export function FoldTag(props: { + fold: { slug: string; name: string } + isFollowButton?: boolean +}) { + const { fold, isFollowButton } = props const { slug, name } = fold + const user = useUser() + const onClick = isFollowButton + ? async () => { + await followFold(fold.id, user.id) + } + : undefined + return (
- - - + @@ -173,4 +154,31 @@ const Home = (props: { ) } +const FastFoldFollowing = () => { + return ( + <> + + + + + ) +} + export default Home