Skip to content

Commit

Permalink
Merge pull request #2289 from daostack/cw-2258-show-follow-icon-on-sp…
Browse files Browse the repository at this point in the history
…ace-cards

Show follow indication on space's card in parent common #2258
  • Loading branch information
roienatan authored Nov 6, 2023
2 parents 07c610b + c3a2565 commit ad70171
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -22,6 +22,10 @@ export const ProjectFeedItem: FC<ProjectFeedItemProps> = (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,
Expand Down Expand Up @@ -76,6 +80,7 @@ export const ProjectFeedItem: FC<ProjectFeedItemProps> = (props) => {
lastMessage,
renderLeftContent,
shouldHideBottomContent: !lastMessage,
isFollowing: feedItemFollow.isFollowing,
})}
</>
) || null
Expand Down

0 comments on commit ad70171

Please sign in to comment.