add notification (beta)

This commit is contained in:
Chika 2020-09-28 13:52:31 +03:00
parent e6c26cb304
commit 0581875dc3

View 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 },
);