add notification (beta)
This commit is contained in:
parent
e6c26cb304
commit
0581875dc3
27
src/client/Elements/Notification.ts
Normal file
27
src/client/Elements/Notification.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { notification } from 'antd';
|
||||
import { throttle } from 'lodash';
|
||||
|
||||
type TNotification = 'success' | 'info' | 'warning' | 'error';
|
||||
|
||||
export const openNotification = ({
|
||||
type,
|
||||
title,
|
||||
description,
|
||||
}: {
|
||||
type: TNotification;
|
||||
title: string;
|
||||
description: string;
|
||||
}) =>
|
||||
throttle(
|
||||
() =>
|
||||
notification[type]({
|
||||
message: title,
|
||||
description,
|
||||
placement: 'bottomRight',
|
||||
style: {
|
||||
zIndex: 9999999999,
|
||||
},
|
||||
}),
|
||||
3000,
|
||||
{ trailing: false },
|
||||
);
|
||||
Reference in New Issue
Block a user