Updated packages
This commit is contained in:
@@ -1,7 +1,40 @@
|
||||
import { NotificationProvider } from "@refinedev/core";
|
||||
import { message } from "antd";
|
||||
import { UndoOutlined } from "@ant-design/icons";
|
||||
import { NotificationProvider, OpenNotificationParams } from "@refinedev/core";
|
||||
import { Button, Progress, message } from "antd";
|
||||
|
||||
import { UndoableNotification } from "@refinedev/antd/src/components/undoableNotification";
|
||||
type UndoableNotificationProps = {
|
||||
notificationKey: OpenNotificationParams["key"];
|
||||
message: OpenNotificationParams["message"];
|
||||
cancelMutation: OpenNotificationParams["cancelMutation"];
|
||||
undoableTimeout: OpenNotificationParams["undoableTimeout"];
|
||||
};
|
||||
|
||||
const UndoableNotification: React.FC<UndoableNotificationProps> = ({ message, cancelMutation, undoableTimeout }) => (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
marginTop: "-7px",
|
||||
}}
|
||||
>
|
||||
<Progress
|
||||
type="circle"
|
||||
percent={(undoableTimeout ?? 0) * 20}
|
||||
format={(time) => time && time / 20}
|
||||
size={50}
|
||||
strokeColor="#1890ff"
|
||||
status="normal"
|
||||
/>
|
||||
<span style={{ marginLeft: 8, width: "100%" }}>{message}</span>
|
||||
<Button
|
||||
style={{ flexShrink: 0 }}
|
||||
onClick={cancelMutation}
|
||||
disabled={undoableTimeout === 0}
|
||||
icon={<UndoOutlined />}
|
||||
></Button>
|
||||
</div>
|
||||
);
|
||||
|
||||
const SpoolmanNotificationProvider: NotificationProvider = {
|
||||
open: ({ key, message: content, type, cancelMutation, undoableTimeout }) => {
|
||||
|
||||
Reference in New Issue
Block a user