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:
Hornwitser committed 2023-07-27 13:42:35 +02:00
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 CreateSaveModal(props) {
let [visible, setVisible] = useState(false);
let [open, setOpen] = useState(false);
let [creatingSave, setCreatingSave] = useState(false);
let [form] = Form.useForm();
let control = useContext(ControlContext);
@@ -56,7 +56,7 @@ export default function CreateSaveModal(props) {
new libData.InstanceCreateSaveRequest(name, seed, mapGenSettings, mapSettings),
).then(() => {
form.resetFields();
setVisible(false);
setOpen(false);
}).catch(
notifyErrorHandler("Error creating save")
).finally(() => {
@@ -81,7 +81,7 @@ export default function CreateSaveModal(props) {
}
function handleCancel() {
setVisible(false);
setOpen(false);
}
return <>
@@ -89,7 +89,7 @@ export default function CreateSaveModal(props) {
loading={creatingSave}
disabled={props.instance.status !== "stopped"}
onClick={() => {
setVisible(true);
setOpen(true);
}}
>
Create save
@@ -98,7 +98,7 @@ export default function CreateSaveModal(props) {
title="Create Save"
width={560}
okText="Create"
visible={visible}
open={open}
confirmLoading={creatingSave}
onOk={createSave}
onCancel={handleCancel}