mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Update web dependencies
- react: Update to new root rendering method - react-router: Replace useHistory with useNavigate - react-router: Replace <Switch> with <Routes> - reimplement sticky notice from scratch in ModPackViewPage - remove isomorphic-ws as it's latest version doesn't work and only saves one line of code. - remove import of antd.dark.css - fix misc css breakages.
This commit is contained in:
1 parent
8d98eaf3a5
commit
fd709fd98c
22 files changed
+143
-127
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import React, { useContext, useState } from "react";
|
||||
import { useHistory, useParams } from "react-router-dom";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { Alert, Button, Descriptions, Dropdown, Menu, Modal, Space, Spin, Typography } from "antd";
|
||||
import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
|
||||
import DownOutlined from "@ant-design/icons/DownOutlined";
|
||||
@@ -60,7 +60,7 @@ export default function InstanceViewPage(props) {
|
||||
let params = useParams();
|
||||
let instanceId = Number(params.id);
|
||||
|
||||
let history = useHistory();
|
||||
let navigate = useNavigate();
|
||||
|
||||
let account = useAccount();
|
||||
let control = useContext(ControlContext);
|
||||
@@ -84,7 +84,7 @@ export default function InstanceViewPage(props) {
|
||||
action={
|
||||
<Button
|
||||
type="text"
|
||||
onClick={() => { history.push("/instances"); }}
|
||||
onClick={() => { navigate("/instances"); }}
|
||||
>
|
||||
Go back to instances list
|
||||
</Button>
|
||||
@@ -163,7 +163,7 @@ export default function InstanceViewPage(props) {
|
||||
control.send(
|
||||
new libData.InstanceDeleteRequest(instanceId)
|
||||
).then(() => {
|
||||
history.push("/instances");
|
||||
navigate("/instances");
|
||||
}).catch(notifyErrorHandler("Error deleting instance"));
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user