feature/IO-3096-GlobalNotifications - Adjust the Global Placement for notificationContext.jsx, removed adjustments to said location and duration to socket

This commit is contained in:
Dave Richer
2025-02-27 13:30:18 -05:00
parent 01b18a4a02
commit 3766c3d938
5 changed files with 9 additions and 16 deletions

View File

@@ -1,5 +1,4 @@
// NotificationProvider.jsx
import React, { createContext, useContext } from "react";
import { createContext, useContext } from "react";
import { notification } from "antd";
/**
@@ -22,7 +21,10 @@ export const useNotification = () => {
* - Provide `api` via the NotificationContext.
*/
export const NotificationProvider = ({ children }) => {
const [api, contextHolder] = notification.useNotification();
const [api, contextHolder] = notification.useNotification({
placement: "bottomRight",
showProgress: true
});
return (
<NotificationContext.Provider value={api}>

View File

@@ -18,9 +18,6 @@ const SocketContext = createContext(null);
// This is how many notifications the database will populate on load, and the increment for load more
export const INITIAL_NOTIFICATIONS = 10;
export const SCENARIO_NOTIFICATION_LOCATION = "bottomRight";
export const SCENARIO_NOTIFICATION_DURATION = 15; // Seconds
export const SocketProvider = ({ children, bodyshop, navigate }) => {
const socketRef = useRef(null);
const [clientId, setClientId] = useState(null);
@@ -298,9 +295,7 @@ export const SocketProvider = ({ children, bodyshop, navigate }) => {
</li>
))}
</ul>
),
placement: SCENARIO_NOTIFICATION_LOCATION,
duration: SCENARIO_NOTIFICATION_DURATION
)
});
} catch (error) {
console.error(`Something went wrong handling a new notification: ${error?.message || ""}`);