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:
@@ -78,9 +78,7 @@ const Eula = ({ currentEula, currentUser, acceptEula }) => {
|
||||
} catch (err) {
|
||||
notification.error({
|
||||
message: t("eula.errors.acceptance.message"),
|
||||
description: t("eula.errors.acceptance.description"),
|
||||
placement: "bottomRight",
|
||||
duration: 5000
|
||||
description: t("eula.errors.acceptance.description")
|
||||
});
|
||||
console.log(`${t("eula.errors.acceptance.message")}`);
|
||||
console.dir({
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { AlertOutlined } from "@ant-design/icons";
|
||||
import { Alert, Button, Col, Row, Space } from "antd";
|
||||
import i18n from "i18next";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -81,8 +81,7 @@ export function UpdateAlert({ updateAvailable }) {
|
||||
imex: "$t(titles.imexonline)",
|
||||
rome: "$t(titles.romeonline)"
|
||||
})
|
||||
}),
|
||||
placement: "bottomRight"
|
||||
})
|
||||
});
|
||||
}
|
||||
if (needRefresh && timerStarted && timeLeft <= 0) {
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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 || ""}`);
|
||||
|
||||
@@ -167,7 +167,6 @@ export function Manage({ conflict, bodyshop, alerts, setAlerts }) {
|
||||
description: alert.description,
|
||||
type: alert.type || "info",
|
||||
duration: 0,
|
||||
placement: "bottomRight",
|
||||
closable: true,
|
||||
onClose: () => {
|
||||
// When the notification is closed, update displayed alerts state and localStorage
|
||||
|
||||
Reference in New Issue
Block a user