mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-04 11:50:09 +00:00
Notification toasts, nicer loading, add new user support
This commit is contained in:
27
frontend/src/notifications/helpers.tsx
Normal file
27
frontend/src/notifications/helpers.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { toast } from "react-toastify";
|
||||
import { intl } from "src/locale";
|
||||
import { Msg } from "./Msg";
|
||||
import styles from "./Msg.module.css";
|
||||
|
||||
const showSuccess = (message: string) => {
|
||||
toast(Msg, {
|
||||
className: styles.toaster,
|
||||
data: {
|
||||
type: "success",
|
||||
title: intl.formatMessage({ id: "notification.success" }),
|
||||
message,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const showError = (message: string) => {
|
||||
toast(<Msg />, {
|
||||
data: {
|
||||
type: "error",
|
||||
title: intl.formatMessage({ id: "notification.error" }),
|
||||
message,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export { showSuccess, showError };
|
Reference in New Issue
Block a user