From 1f3707aabda2e9b92db52c9eb33f69a26fbfbd60 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Thu, 15 May 2025 10:52:23 +0800 Subject: [PATCH] fix(web): only show view with subscription --- .../feed-column/float-bar.mobile.tsx | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx index 1d011dcd8..4b8247572 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/feed-column/float-bar.mobile.tsx @@ -13,6 +13,7 @@ import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" import { useEntry } from "~/store/entry" import { useFeedById } from "~/store/feed" import { feedIconSelector } from "~/store/feed/selector" +import { useViewWithSubscription } from "~/store/subscription/hooks" import { ProfileButton } from "../../user/ProfileButton" import { PodcastButton } from "./components/PodcastButton" @@ -101,6 +102,7 @@ export const MobileFloatBar = ({ } const ViewTabs = ({ onViewChange }: { onViewChange?: (view: number) => void }) => { + const viewsWithSubscription = useViewWithSubscription() const view = useRouteParamsSelector((s) => s.view) const navigate = useNavigateEntry() @@ -109,21 +111,23 @@ const ViewTabs = ({ onViewChange }: { onViewChange?: (view: number) => void }) = className="text-text-secondary scrollbar-none flex shrink items-center justify-center gap-6 overflow-x-auto overflow-y-hidden text-xl" onClick={stopPropagation} > - {views.map((item) => ( - { - navigate({ view: item.view }) - onViewChange?.(item.view) - }} - > -
{item.icon}
-
- ))} + {views + .filter((item) => viewsWithSubscription.includes(item.view)) + .map((item) => ( + { + navigate({ view: item.view }) + onViewChange?.(item.view) + }} + > +
{item.icon}
+
+ ))} ) }