mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 23:33:12 +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
@@ -8,7 +8,7 @@ import { notifyErrorHandler } from "../util/notify";
|
||||
|
||||
|
||||
export default function LoadScenarioModal(props) {
|
||||
let [visible, setVisible] = useState(false);
|
||||
let [open, setOpen] = useState(false);
|
||||
let [loadingScenario, setLoadingScenario] = useState(false);
|
||||
let [form] = Form.useForm();
|
||||
let control = useContext(ControlContext);
|
||||
@@ -55,7 +55,7 @@ export default function LoadScenarioModal(props) {
|
||||
{ instanceId: props.instance.id },
|
||||
new libData.InstanceLoadScenarioRequest(scenario, seed, mapGenSettings, mapSettings),
|
||||
).then(() => {
|
||||
setVisible(false);
|
||||
setOpen(false);
|
||||
}).catch(
|
||||
notifyErrorHandler("Error loading scenario")
|
||||
).finally(() => {
|
||||
@@ -80,7 +80,7 @@ export default function LoadScenarioModal(props) {
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
setVisible(false);
|
||||
setOpen(false);
|
||||
}
|
||||
|
||||
return <>
|
||||
@@ -88,7 +88,7 @@ export default function LoadScenarioModal(props) {
|
||||
loading={loadingScenario}
|
||||
disabled={props.instance.status !== "stopped"}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
setOpen(true);
|
||||
}}
|
||||
>
|
||||
Load scenario
|
||||
@@ -97,7 +97,7 @@ export default function LoadScenarioModal(props) {
|
||||
title="Load Scenario"
|
||||
width={560}
|
||||
okText="Load"
|
||||
visible={visible}
|
||||
open={open}
|
||||
confirmLoading={loadingScenario}
|
||||
onOk={loadScenario}
|
||||
onCancel={handleCancel}
|
||||
|
||||
Reference in new issue
Block a user