feat(desktop): remove trending in home

This commit is contained in:
DIYgod 2025-05-03 22:19:13 +08:00
parent 92ee0a04fa
commit 9641438dca
No known key found for this signature in database
3 changed files with 7 additions and 45 deletions

View File

@ -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 (
<LayoutGroup>
<EntryContentPlaceholderContext.Provider value={ctxValue}>
<AnimatePresence>
{openedSummary === null ? (
<m.div
className={cn(
"flex size-full flex-col items-center",
isTrending ? "overflow-scroll p-11" : "center",
)}
className="center size-full flex-col"
initial={{ opacity: 0.01, y: 300 }}
animate={{ opacity: 1, y: 0 }}
>
{isTrending ? <Trending narrow center /> : <EntryPlaceholderLogo />}
<EntryPlaceholderLogo />
{feedId === ROUTE_FEED_PENDING && view === FeedViewType.Articles && (
<EntryPlaceholderDaily view={view} />
)}
</m.div>
) : (
<SummaryDetailContent />

View File

@ -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<Language>(lang.startsWith("zh") ? "all" : "eng")
const [selectedRange, setSelectedRange] = useState<Range>("7d")
const [selectedView, setSelectedView] = useState<View>("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}
/>
</div>
<div className="flex items-center">
<span className="text-text text-sm font-medium">Range:</span>
<ResponsiveSelect
value={selectedRange}
onValueChange={(value: string) => {
setSelectedRange(value as Range)
}}
triggerClassName="h-8 rounded border-0"
size="sm"
items={rangeOptions}
/>
</div>
<div className="flex items-center">
<span className="text-text text-sm font-medium">View:</span>
<ResponsiveSelect

View File

@ -13798,7 +13798,6 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
} | null | undefined;
} | undefined;
docs?: string | undefined;
isSubscribed?: boolean | undefined;
subscriptionCount?: number | undefined;
updatesPerWeek?: number | undefined;
}[];