From 9641438dca3e8da7af157b2d26ee809bbdd425b6 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 3 May 2025 22:19:13 +0800 Subject: [PATCH] feat(desktop): remove trending in home --- .../entry-content/EntryContentPlaceholder.tsx | 15 ++++---- .../renderer/src/modules/trending/index.tsx | 36 +------------------ packages/internal/shared/src/hono.ts | 1 - 3 files changed, 7 insertions(+), 45 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryContentPlaceholder.tsx b/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryContentPlaceholder.tsx index 533a9cd28..cd3d326de 100644 --- a/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryContentPlaceholder.tsx +++ b/apps/desktop/layer/renderer/src/modules/app-layout/entry-content/EntryContentPlaceholder.tsx @@ -10,9 +10,9 @@ import { ROUTE_FEED_PENDING } from "~/constants" import { useRouteParams } from "~/hooks/biz/useRouteParams" import { DayOf } from "~/modules/ai/ai-daily/constants" import { DailyItem } from "~/modules/ai/ai-daily/daily" +import { EntryPlaceholderDaily } from "~/modules/ai/ai-daily/EntryPlaceholderDaily" import type { DailyView } from "~/modules/ai/ai-daily/types" import { EntryPlaceholderLogo } from "~/modules/entry-content/components/EntryPlaceholderLogo" -import { Trending } from "~/modules/trending" import type { EntryContentPlaceholderContextValue } from "./EntryContentPlaceholderContext" import { EntryContentPlaceholderContext } from "./EntryContentPlaceholderContext" @@ -28,23 +28,20 @@ export const EntryContentPlaceholder = () => { ) const openedSummary = useAtomValue(ctxValue.openedSummary) - - const isTrending = feedId === ROUTE_FEED_PENDING && view === FeedViewType.Articles - return ( {openedSummary === null ? ( - {isTrending ? : } + + {feedId === ROUTE_FEED_PENDING && view === FeedViewType.Articles && ( + + )} ) : ( diff --git a/apps/desktop/layer/renderer/src/modules/trending/index.tsx b/apps/desktop/layer/renderer/src/modules/trending/index.tsx index 079f63d06..b55ba7cfc 100644 --- a/apps/desktop/layer/renderer/src/modules/trending/index.tsx +++ b/apps/desktop/layer/renderer/src/modules/trending/index.tsx @@ -29,27 +29,6 @@ const LanguageOptions = [ type Language = (typeof LanguageOptions)[number]["value"] -const rangeOptions = [ - { - label: "Today", - value: "1d", - }, - { - label: "Three days", - value: "3d", - }, - { - label: "This week", - value: "7d", - }, - { - label: "This month", - value: "30d", - }, -] - -type Range = (typeof rangeOptions)[number]["value"] - const viewOptions = [ { label: "All", @@ -77,11 +56,10 @@ export function Trending({ const lang = useGeneralSettingKey("language") const [selectedLang, setSelectedLang] = useState(lang.startsWith("zh") ? "all" : "eng") - const [selectedRange, setSelectedRange] = useState("7d") const [selectedView, setSelectedView] = useState("all") const { data, isLoading } = useQuery({ - queryKey: ["trending", selectedLang, selectedView, selectedRange], + queryKey: ["trending", selectedLang, selectedView], queryFn: async () => { return await apiFetch<{ data: { @@ -123,18 +101,6 @@ export function Trending({ items={LanguageOptions} /> -
- Range: - { - setSelectedRange(value as Range) - }} - triggerClassName="h-8 rounded border-0" - size="sm" - items={rangeOptions} - /> -
View: