refactor: 更新管理端页面元数据,统一国际化支持,移除冗余代码
This commit is contained in:
40
src/modules/rules/rules-odds-config-screen.tsx
Normal file
40
src/modules/rules/rules-odds-config-screen.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
"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 { OddsConfigDocScreen } from "@/modules/config/doc/odds-config-doc-screen";
|
||||
import { RebateConfigDocScreen } from "@/modules/config/doc/rebate-config-doc-screen";
|
||||
import { RulesPageShell } from "@/modules/rules/rules-page-shell";
|
||||
|
||||
/** 赔率与回水:共用赔率版本线,单页上下分区。 */
|
||||
export function RulesOddsConfigScreen() {
|
||||
const { t } = useTranslation("config");
|
||||
|
||||
useEffect(() => {
|
||||
const scrollToRebate = () => {
|
||||
if (window.location.hash !== "#rebate") {
|
||||
return;
|
||||
}
|
||||
document.getElementById("rebate")?.scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
};
|
||||
scrollToRebate();
|
||||
window.addEventListener("hashchange", scrollToRebate);
|
||||
return () => window.removeEventListener("hashchange", scrollToRebate);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<RulesPageShell>
|
||||
<ConfigDocPage title={t("nav.rulesOddsTitle")} contentClassName="space-y-10">
|
||||
<ConfigSection title={t("nav.items.odds")}>
|
||||
<OddsConfigDocScreen embedded />
|
||||
</ConfigSection>
|
||||
<ConfigSection id="rebate" title={t("nav.items.rebate")}>
|
||||
<RebateConfigDocScreen embedded />
|
||||
</ConfigSection>
|
||||
</ConfigDocPage>
|
||||
</RulesPageShell>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user