mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Compare commits
2 Commits
b4e00814bf
...
f8fa9069a9
Author | SHA1 | Date | |
---|---|---|---|
f8fa9069a9 | |||
a51d4ec598 |
@@ -1,5 +1,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
|
import { i18nContext } from "../utils/i18n";
|
||||||
|
import { i18nData } from "../i18n.ts";
|
||||||
|
|
||||||
export default function showPopup(
|
export default function showPopup(
|
||||||
content: React.ReactNode,
|
content: React.ReactNode,
|
||||||
@@ -43,7 +45,9 @@ export default function showPopup(
|
|||||||
document.body.appendChild(mask);
|
document.body.appendChild(mask);
|
||||||
|
|
||||||
createRoot(div).render(
|
createRoot(div).render(
|
||||||
<context.Provider value={close}>{content}</context.Provider>,
|
<context.Provider value={close}>
|
||||||
|
<i18nContext.Provider value={i18nData}>{content}</i18nContext.Provider>
|
||||||
|
</context.Provider>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -181,7 +181,7 @@ export default function StorageView() {
|
|||||||
handleSetDefault(s.id);
|
handleSetDefault(s.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<a>t("Set as Default")</a>
|
<a>{t("Set as Default")}</a>
|
||||||
</PopupMenuItem>
|
</PopupMenuItem>
|
||||||
)}
|
)}
|
||||||
</ul>,
|
</ul>,
|
||||||
|
@@ -686,6 +686,7 @@ function fileSizeToString(size: number) {
|
|||||||
|
|
||||||
function FileTile({ file }: { file: RFile }) {
|
function FileTile({ file }: { file: RFile }) {
|
||||||
const buttonRef = createRef<HTMLButtonElement>();
|
const buttonRef = createRef<HTMLButtonElement>();
|
||||||
|
const buttonRef2 = createRef<HTMLButtonElement>();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -774,13 +775,14 @@ function FileTile({ file }: { file: RFile }) {
|
|||||||
<div className="flex flex-row-reverse xs:hidden p-2">
|
<div className="flex flex-row-reverse xs:hidden p-2">
|
||||||
{file.size > 10 * 1024 * 1024 ? (
|
{file.size > 10 * 1024 * 1024 ? (
|
||||||
<button
|
<button
|
||||||
|
ref={buttonRef2}
|
||||||
className={"btn btn-primary btn-soft btn-sm"}
|
className={"btn btn-primary btn-soft btn-sm"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!app.cloudflareTurnstileSiteKey) {
|
if (!app.cloudflareTurnstileSiteKey) {
|
||||||
const link = network.getFileDownloadLink(file.id, "");
|
const link = network.getFileDownloadLink(file.id, "");
|
||||||
window.open(link, "_blank");
|
window.open(link, "_blank");
|
||||||
} else {
|
} else {
|
||||||
showPopup(<CloudflarePopup file={file} />, buttonRef.current!);
|
showPopup(<CloudflarePopup file={file} />, buttonRef2.current!);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user