diff --git a/apps/desktop/layer/renderer/src/modules/discover/feed-card.tsx b/apps/desktop/layer/renderer/src/modules/discover/feed-card.tsx index 6b1355f20..9236b50e3 100644 --- a/apps/desktop/layer/renderer/src/modules/discover/feed-card.tsx +++ b/apps/desktop/layer/renderer/src/modules/discover/feed-card.tsx @@ -13,6 +13,7 @@ import { getRouteParams } from "~/hooks/biz/useRouteParams" import { useFeedSafeUrl } from "~/hooks/common/useFeedSafeUrl" import type { apiClient } from "~/lib/api-fetch" import { UrlBuilder } from "~/lib/url-builder" +import { useSubscriptionByFeedId } from "~/store/subscription" import { FollowSummary } from "../feed/feed-summary" @@ -25,14 +26,28 @@ export const FeedCard: FC<{ onSuccess?: (item: DiscoverSearchData[number]) => void onUnSubscribed?: (item: DiscoverSearchData[number]) => void children?: React.ReactNode - followButtonVariant?: "ghost" + followButtonVariant?: "ghost" | "outline" + followedButtonVariant?: "ghost" | "outline" followButtonClassName?: string + followedButtonClassName?: string className?: string }> = memo( - ({ item, onSuccess, children, followButtonVariant, followButtonClassName, className }) => { + ({ + item, + onSuccess, + children, + followButtonVariant, + followedButtonVariant, + followButtonClassName, + followedButtonClassName, + className, + }) => { const follow = useFollow() const { t } = useTranslation() + const subscription = useSubscriptionByFeedId(item.feed?.id || item.list?.id || "") + const isSubscribed = !!subscription + return ( diff --git a/apps/desktop/layer/renderer/src/modules/trending/index.tsx b/apps/desktop/layer/renderer/src/modules/trending/index.tsx index 47689c8fe..079f63d06 100644 --- a/apps/desktop/layer/renderer/src/modules/trending/index.tsx +++ b/apps/desktop/layer/renderer/src/modules/trending/index.tsx @@ -162,7 +162,9 @@ export function Trending({