Compare commits

..

2 Commits

Author SHA1 Message Date
f8fa9069a9 fix translation 2025-09-07 14:45:10 +08:00
a51d4ec598 fix 2025-09-07 14:43:39 +08:00
3 changed files with 9 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
import React from "react";
import { createRoot } from "react-dom/client";
import { i18nContext } from "../utils/i18n";
import { i18nData } from "../i18n.ts";
export default function showPopup(
content: React.ReactNode,
@@ -43,7 +45,9 @@ export default function showPopup(
document.body.appendChild(mask);
createRoot(div).render(
<context.Provider value={close}>{content}</context.Provider>,
<context.Provider value={close}>
<i18nContext.Provider value={i18nData}>{content}</i18nContext.Provider>
</context.Provider>,
);
}

View File

@@ -181,7 +181,7 @@ export default function StorageView() {
handleSetDefault(s.id);
}}
>
<a>t("Set as Default")</a>
<a>{t("Set as Default")}</a>
</PopupMenuItem>
)}
</ul>,

View File

@@ -686,6 +686,7 @@ function fileSizeToString(size: number) {
function FileTile({ file }: { file: RFile }) {
const buttonRef = createRef<HTMLButtonElement>();
const buttonRef2 = createRef<HTMLButtonElement>();
const { t } = useTranslation();
@@ -774,13 +775,14 @@ function FileTile({ file }: { file: RFile }) {
<div className="flex flex-row-reverse xs:hidden p-2">
{file.size > 10 * 1024 * 1024 ? (
<button
ref={buttonRef2}
className={"btn btn-primary btn-soft btn-sm"}
onClick={() => {
if (!app.cloudflareTurnstileSiteKey) {
const link = network.getFileDownloadLink(file.id, "");
window.open(link, "_blank");
} else {
showPopup(<CloudflarePopup file={file} />, buttonRef.current!);
showPopup(<CloudflarePopup file={file} />, buttonRef2.current!);
}
}}
>