前端: 添加通知组件
This commit is contained in:
parent
2102b60930
commit
d906b9ae37
22
frontend/src/renderer/components/Notification.jsx
Normal file
22
frontend/src/renderer/components/Notification.jsx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { notification } from 'antd';
|
||||||
|
|
||||||
|
const { success, error, warning, info } = notification;
|
||||||
|
|
||||||
|
export const showSuccess = (message, description) => {
|
||||||
|
success({ message, description, placement: 'topRight' });
|
||||||
|
};
|
||||||
|
|
||||||
|
export const showError = (message, description) => {
|
||||||
|
error({ message, description, placement: 'topRight' });
|
||||||
|
};
|
||||||
|
|
||||||
|
export const showWarning = (message, description) => {
|
||||||
|
warning({ message, description, placement: 'topRight' });
|
||||||
|
};
|
||||||
|
|
||||||
|
export const showInfo = (message, description) => {
|
||||||
|
info({ message, description, placement: 'topRight' });
|
||||||
|
};
|
||||||
|
|
||||||
|
export default notification;
|
||||||
Loading…
Reference in New Issue
Block a user