From 00cbec230931343dfbd5ad5aabca2f4622d51620 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Tue, 7 Jun 2022 23:07:05 -0500 Subject: [PATCH] Show edit following button on home --- web/components/contract-search.tsx | 15 ++++------ web/components/feed/category-selector.tsx | 3 +- web/components/following-button.tsx | 34 +++++++++++++++++++++++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/web/components/contract-search.tsx b/web/components/contract-search.tsx index 8ea2d1bd..fa22e0ef 100644 --- a/web/components/contract-search.tsx +++ b/web/components/contract-search.tsx @@ -25,6 +25,7 @@ import { useFollows } from 'web/hooks/use-follows' import { EditCategoriesButton } from './feed/category-selector' import { CATEGORIES } from 'common/categories' import { Tabs } from './layout/tabs' +import { EditFollowingButton } from './following-button' const searchClient = algoliasearch( 'GJQPAYENIF', @@ -249,10 +250,6 @@ function CategoryFollowSelector(props: { const user = useUser() - const categoriesLabel = `Categories ${ - followedCategories.length ? followedCategories.length : '(All)' - }` - let categoriesDescription = `Showing all categories` if (followedCategories.length) { @@ -267,14 +264,12 @@ function CategoryFollowSelector(props: { categoriesDescription = `Showing ${categoriesLabel}${andMoreLabel}` } - const followingLabel = `Following ${follows.length}` - return (
{categoriesDescription}
@@ -285,11 +280,11 @@ function CategoryFollowSelector(props: { ...(user ? [ { - title: followingLabel, - + title: 'Following', content: ( - +
Showing markets by users you are following.
+
), }, diff --git a/web/components/feed/category-selector.tsx b/web/components/feed/category-selector.tsx index a9e6244a..4827186a 100644 --- a/web/components/feed/category-selector.tsx +++ b/web/components/feed/category-selector.tsx @@ -91,11 +91,12 @@ export function EditCategoriesButton(props: {
setIsOpen(true)} > + Categories setOpen(true)} + > + +
+ {followingIds?.length ?? ''}{' '} + Following +
+ + +
+ ) +} + export function FollowersButton(props: { user: User }) { const { user } = props const [isOpen, setIsOpen] = useState(false)