mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 07:24:53 +09:00
Migrate deprecated ant design APIs
Rename visible to open and use menu instead of overlay in Dropdown as both of these have been removed in the next major version of Antd.
This commit is contained in:
1 parent
2de029b96e
commit
a1c9bc5f9b
12 files changed
+81
-85
No files matched your search
@@ -485,7 +485,7 @@ function CopyButton(props) {
|
||||
}, []);
|
||||
|
||||
let denied = clipboard.readPermissionState === "denied";
|
||||
return <Tooltip title={denied ? clipboard.deniedReason : "Copied!"} visible={denied ? undefined : copiedVisible}>
|
||||
return <Tooltip title={denied ? clipboard.deniedReason : "Copied!"} open={denied ? undefined : copiedVisible}>
|
||||
<Button disabled={denied} onClick={() => {
|
||||
try {
|
||||
clipboard.writeText(props.content);
|
||||
@@ -503,19 +503,19 @@ function CopyButton(props) {
|
||||
}
|
||||
|
||||
function ExportButton(props) {
|
||||
let [visible, setVisible] = useState(false);
|
||||
let [open, setOpen] = useState(false);
|
||||
function close() {
|
||||
setVisible(false);
|
||||
setOpen(false);
|
||||
}
|
||||
|
||||
let exportString;
|
||||
if (visible) { exportString = props.modPack.toModPackString(); }
|
||||
if (open) { exportString = props.modPack.toModPackString(); }
|
||||
|
||||
return <>
|
||||
<Button icon={<ExportOutlined />} onClick={() => { setVisible(true); }}>Export to string</Button>
|
||||
<Button icon={<ExportOutlined />} onClick={() => { setOpen(true); }}>Export to string</Button>
|
||||
<Modal
|
||||
title="Mod Pack String"
|
||||
visible={visible}
|
||||
open={open}
|
||||
onOk={close}
|
||||
onCancel={close}
|
||||
destroyOnClose
|
||||
|
||||
Reference in new issue
Block a user