diff --git a/src/app/site/[site]/page.tsx b/src/app/site/[site]/page.tsx index 80a8a6c0..e8a97d08 100644 --- a/src/app/site/[site]/page.tsx +++ b/src/app/site/[site]/page.tsx @@ -44,12 +44,12 @@ async function SiteIndexPage({ const dehydratedState = dehydrate(queryClient) return ( -
+ <> {!!shorts?.count && } -
+ ) } diff --git a/src/components/site/ShortPreviewList.tsx b/src/components/site/ShortPreviewList.tsx index 67a32a3d..35d27865 100644 --- a/src/components/site/ShortPreviewList.tsx +++ b/src/components/site/ShortPreviewList.tsx @@ -2,10 +2,10 @@ import Link from "next/link" import { Image } from "~/components/ui/Image" import { Tooltip } from "~/components/ui/Tooltip" +import { getTranslation } from "~/lib/i18n" import { ExpandedNote } from "~/lib/types" -import { cn } from "~/lib/utils" -export default function ShortList({ +export default async function ShortList({ shorts, }: { shorts: { @@ -14,52 +14,58 @@ export default function ShortList({ cursor: string | null } }) { + const { t } = await getTranslation("site") + if (!shorts) return null return ( <> -
- {shorts.list.map((post) => ( +
+ +

+ + {t("Shorts")} +

+ +
+ {shorts.list.map((post) => ( + + + cover + + + ))} - cover + - ))} - - - - - +
) diff --git a/src/lib/i18n/locales/zh/site.json b/src/lib/i18n/locales/zh/site.json index d146faf4..cde39334 100644 --- a/src/lib/i18n/locales/zh/site.json +++ b/src/lib/i18n/locales/zh/site.json @@ -23,5 +23,7 @@ "All Posts": "所有文章", "Open in App": "在 App 中打开", "Search Posts": "搜索文章", - "URL (Optional)": "网址(可选)" + "URL (Optional)": "网址(可选)", + "Shorts": "图文", + "More shorts": "更多图文" }