Skip to content

Commit 03da1ba

Browse files
authored
🐛 修复 Modali18n问题 (#825)
1 parent b3c30f5 commit 03da1ba

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/pages/components/layout/MainLayout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const MainLayout: React.FC<{
4242
className: string;
4343
pageName?: string;
4444
}> = ({ children, className, pageName }) => {
45+
const [modal, contextHolder] = Modal.useModal();
4546
const { colorThemeState, updateColorTheme } = useAppContext();
4647

4748
const importRef = useRef<RefTextAreaType>(null);
@@ -51,7 +52,7 @@ const MainLayout: React.FC<{
5152

5253
const showImportResult = (stat: Awaited<ReturnType<ScriptClient["importByUrls"]>>) => {
5354
if (!stat) return;
54-
Modal.info({
55+
modal.info!({
5556
title: t("script_import_result"),
5657
content: (
5758
<Space direction="vertical" style={{ width: "100%" }}>
@@ -198,6 +199,7 @@ const MainLayout: React.FC<{
198199
}}
199200
locale={arcoLocale(i18n.language)}
200201
>
202+
{contextHolder}
201203
<Layout>
202204
<Layout.Header
203205
style={{

src/pages/options/routes/Tools.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { migrateToChromeStorage } from "@App/app/migrate";
2727
import { useSystemConfig } from "./utils";
2828

2929
function Tools() {
30+
const [modal, contextHolder] = Modal.useModal();
3031
const [loading, setLoading] = useState<{ [key: string]: boolean }>({});
3132
const fileRef = useRef<HTMLInputElement>(null);
3233
const [backupFileList, setBackupFileList] = useState<File[]>([]);
@@ -47,6 +48,7 @@ function Tools() {
4748
position: "relative",
4849
}}
4950
>
51+
{contextHolder}
5052
<Card className="backup" title={t("backup")} bordered={false}>
5153
<Space direction="vertical">
5254
<Title heading={6}>{t("local")}</Title>
@@ -226,7 +228,7 @@ function Tools() {
226228
status="danger"
227229
size="small"
228230
onClick={() => {
229-
Modal.confirm({
231+
modal.confirm!({
230232
title: t("confirm_delete"),
231233
content: `${t("confirm_delete_backup_file")}${item.name}?`,
232234
onOk: async () => {

0 commit comments

Comments
 (0)