@refinedev/antd 5.36.8 → 5.36.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/notificationProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAMvD;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,EAAE,oBAkClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,oBA4C1C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/notificationProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAMvD;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,EAAE,oBAqClC,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,oBA+C1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinedev/antd",
3
- "version": "5.36.8",
3
+ "version": "5.36.10",
4
4
  "description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
5
5
  "private": false,
6
6
  "sideEffects": [
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Button, notification, Progress } from "antd";
2
+ import { Button, Progress } from "antd";
3
3
  import { OpenNotificationParams } from "@refinedev/core";
4
4
  import { UndoOutlined } from "@ant-design/icons";
5
5
 
@@ -11,7 +11,6 @@ export type UndoableNotificationProps = {
11
11
  };
12
12
 
13
13
  export const UndoableNotification: React.FC<UndoableNotificationProps> = ({
14
- notificationKey,
15
14
  message,
16
15
  cancelMutation,
17
16
  undoableTimeout,
@@ -35,10 +34,7 @@ export const UndoableNotification: React.FC<UndoableNotificationProps> = ({
35
34
  <span style={{ marginLeft: 8, width: "100%" }}>{message}</span>
36
35
  <Button
37
36
  style={{ flexShrink: 0 }}
38
- onClick={() => {
39
- cancelMutation?.();
40
- notification.destroy(notificationKey ?? "");
41
- }}
37
+ onClick={cancelMutation}
42
38
  disabled={undoableTimeout === 0}
43
39
  icon={<UndoOutlined />}
44
40
  ></Button>
@@ -25,7 +25,10 @@ export const notificationProvider: NotificationProvider = {
25
25
  <UndoableNotification
26
26
  notificationKey={key}
27
27
  message={message}
28
- cancelMutation={cancelMutation}
28
+ cancelMutation={() => {
29
+ cancelMutation?.();
30
+ staticNotification.destroy(key ?? "");
31
+ }}
29
32
  undoableTimeout={undoableTimeout}
30
33
  />
31
34
  ),
@@ -68,7 +71,10 @@ export const useNotificationProvider = (): NotificationProvider => {
68
71
  <UndoableNotification
69
72
  notificationKey={key}
70
73
  message={message}
71
- cancelMutation={cancelMutation}
74
+ cancelMutation={() => {
75
+ cancelMutation?.();
76
+ notification.destroy(key ?? "");
77
+ }}
72
78
  undoableTimeout={undoableTimeout}
73
79
  />
74
80
  ),