From c3a25654b29d8d3dbd7e8bb6dc446963a3d0b193 Mon Sep 17 00:00:00 2001 From: Roie Natan Date: Fri, 3 Nov 2023 11:43:47 -0400 Subject: [PATCH] show follow icon on space cards --- .../components/ProjectFeedItem/ProjectFeedItem.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/common/components/FeedItem/components/ProjectFeedItem/ProjectFeedItem.tsx b/src/pages/common/components/FeedItem/components/ProjectFeedItem/ProjectFeedItem.tsx index ae282dc417..3b4624f969 100644 --- a/src/pages/common/components/FeedItem/components/ProjectFeedItem/ProjectFeedItem.tsx +++ b/src/pages/common/components/FeedItem/components/ProjectFeedItem/ProjectFeedItem.tsx @@ -3,7 +3,7 @@ import { useHistory } from "react-router-dom"; import classNames from "classnames"; import { useFeedItemContext } from "@/pages/common"; import { useRoutesContext } from "@/shared/contexts"; -import { useCommon } from "@/shared/hooks/useCases"; +import { useCommon, useFeedItemFollow } from "@/shared/hooks/useCases"; import { OpenIcon } from "@/shared/icons"; import { CommonFeed } from "@/shared/models"; import { CommonAvatar, parseStringToTextEditorValue } from "@/shared/ui-kit"; @@ -22,6 +22,10 @@ export const ProjectFeedItem: FC = (props) => { const { getCommonPagePath } = useRoutesContext(); const { renderFeedItemBaseContent } = useFeedItemContext(); const { data: common, fetched: isCommonFetched, fetchCommon } = useCommon(); + const feedItemFollow = useFeedItemFollow( + { feedItemId: item.id, commonId: item.data.id }, + { withSubscription: true }, + ); const { projectUnreadStreamsCount: unreadStreamsCount, projectUnreadMessages: unreadMessages, @@ -76,6 +80,7 @@ export const ProjectFeedItem: FC = (props) => { lastMessage, renderLeftContent, shouldHideBottomContent: !lastMessage, + isFollowing: feedItemFollow.isFollowing, })} ) || null