From 25a87a90d7248dacffae7f3660f431ea83300c23 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Mon, 31 Mar 2025 10:03:03 +0800 Subject: [PATCH] fix(mobile): show title and translation at grid footer, close #3351 --- .../modules/entry-content/EntryGridFooter.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx b/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx index 245aa0bc9..6b9764d25 100644 --- a/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx +++ b/apps/mobile/src/modules/entry-content/EntryGridFooter.tsx @@ -9,8 +9,10 @@ import { FeedIcon } from "@/src/components/ui/icon/feed-icon" import { gentleSpringPreset } from "@/src/constants/spring" import { useEntry } from "@/src/store/entry/hooks" import { useFeed } from "@/src/store/feed/hooks" +import { useEntryTranslation, usePrefetchEntryTranslation } from "@/src/store/translation/hooks" import { useEntryListContextView } from "../entry-list/EntryListContext" +import { EntryTranslation } from "../entry-list/templates/EntryTranslation" export const EntryGridFooter = ({ entryId, @@ -20,6 +22,8 @@ export const EntryGridFooter = ({ descriptionClassName?: string }) => { const entry = useEntry(entryId) + usePrefetchEntryTranslation(entryId) + const translation = useEntryTranslation(entryId) const feed = useFeed(entry?.feedId || "") const view = useEntryListContextView() @@ -51,17 +55,19 @@ export const EntryGridFooter = ({ className="bg-red mt-2 inline-block rounded-full" style={unreadIndicatorStyle} /> - {entry.description && ( - - {entry.description} - + source={entry.title} + target={translation?.title} + showTranslation={!!entry.settings?.translation} + inline + /> )}