refactor: 重构奖池配置页面,移除冗余组件,优化加载体验与国际化支持
This commit is contained in:
43
src/modules/jackpot/jackpot-config-screen.tsx
Normal file
43
src/modules/jackpot/jackpot-config-screen.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { ConfigDocPage } from "@/modules/config/config-doc-page";
|
||||
import { ConfigSection } from "@/modules/config/config-section";
|
||||
import { JackpotPoolsConsole } from "@/modules/jackpot/jackpot-pools-console";
|
||||
import { JackpotRecordsConsole } from "@/modules/jackpot/jackpot-records-console";
|
||||
|
||||
/**
|
||||
* 奖池:仅保留「侧栏 + 运营配置顶栏」两层导航;池参数与流水在同一页用分区展示。
|
||||
*/
|
||||
export function JackpotConfigScreen() {
|
||||
const { t } = useTranslation("jackpot");
|
||||
|
||||
useEffect(() => {
|
||||
const scrollToRecords = () => {
|
||||
if (window.location.hash !== "#records") {
|
||||
return;
|
||||
}
|
||||
document.getElementById("jackpot-records")?.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
};
|
||||
scrollToRecords();
|
||||
window.addEventListener("hashchange", scrollToRecords);
|
||||
return () => window.removeEventListener("hashchange", scrollToRecords);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<ConfigDocPage title={t("configTitle")} description={t("pageDescription")}>
|
||||
<ConfigSection title={t("poolsSectionTitle")} description={t("poolsSectionDescription")}>
|
||||
<JackpotPoolsConsole embedded />
|
||||
</ConfigSection>
|
||||
<ConfigSection
|
||||
id="jackpot-records"
|
||||
title={t("recordsSectionTitle")}
|
||||
description={t("recordsSectionDescription")}
|
||||
>
|
||||
<JackpotRecordsConsole embedded />
|
||||
</ConfigSection>
|
||||
</ConfigDocPage>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user