diff --git a/app/[locale]/course/[moduleIndex]/[lessonIndex]/page.tsx b/app/[locale]/course/[moduleIndex]/[lessonIndex]/page.tsx index 926480a..374d004 100644 --- a/app/[locale]/course/[moduleIndex]/[lessonIndex]/page.tsx +++ b/app/[locale]/course/[moduleIndex]/[lessonIndex]/page.tsx @@ -1,8 +1,8 @@ "use client"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useParams, useRouter } from "next/navigation"; -import { Link } from "@/i18n/navigation"; +import { Link, useTranslation } from "@/i18n/navigation"; import { VideoPlayer } from "@/app/components/course/VideoPlayer"; import { LessonMarkdown } from "./LessonMarkdown"; import { getLesson } from "@/config/lessons"; @@ -14,6 +14,8 @@ import Header from "@/app/components/Header"; export default function LessonPage() { const params = useParams(); const router = useRouter(); + const { t } = useTranslation("community"); + const [toast, setToast] = useState(false); const moduleIndex = Number(params.moduleIndex); const lessonIndex = Number(params.lessonIndex); @@ -149,6 +151,14 @@ export default function LessonPage() { )} + {toast && ( +
+ {t("updating")} +
+ )} ); } diff --git a/app/[locale]/day/[id]/page.tsx b/app/[locale]/day/[id]/page.tsx index faf0189..fa9bb31 100644 --- a/app/[locale]/day/[id]/page.tsx +++ b/app/[locale]/day/[id]/page.tsx @@ -120,7 +120,7 @@ export default async function DayPage({ params }: PageProps) { 🌍 数字游民指南 · - 开源免费 · 社区驱动 + 精选内容 · 持续更新 ); diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 1610e14..747088f 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -5,10 +5,13 @@ import Roadmap from "../components/Roadmap"; import Tools from "../components/Tools"; import Community from "../components/Community"; import Footer from "../components/Footer"; -import { getThemeToolsData } from "../lib/theme-data"; +import { getThemeToolsData, getResourceData } from "../lib/theme-data"; export default async function HomePage() { - const toolsData = await getThemeToolsData(); + const [toolsData, resourceData] = await Promise.all([ + getThemeToolsData(), + getResourceData(), + ]); return ( <> @@ -18,7 +21,7 @@ export default async function HomePage() { - +