Client: Notifications now appear in center instead

Closes #59
This commit is contained in:
Donkie
2023-08-12 20:38:26 +02:00
parent 130aed4ed6
commit 5a8a5b185d
2 changed files with 35 additions and 2 deletions

View File

@@ -0,0 +1,32 @@
import { NotificationProvider } from "@refinedev/core";
import { message } from "antd";
import { UndoableNotification } from "@refinedev/antd/src/components/undoableNotification";
const SpoolmanNotificationProvider: NotificationProvider = {
open: ({ key, message: content, type, cancelMutation, undoableTimeout }) => {
if (type === "progress") {
message.open({
key,
content: (
<UndoableNotification
notificationKey={key}
message={content}
cancelMutation={cancelMutation}
undoableTimeout={undoableTimeout}
/>
),
duration: 0,
});
} else {
message.open({
key,
content,
type,
});
}
},
close: (key) => message.destroy(key),
};
export default SpoolmanNotificationProvider;