diff --git a/src/components/shared/Notifications.tsx b/src/components/shared/Notifications.tsx index 88a825f8b3..efc29ec09f 100644 --- a/src/components/shared/Notifications.tsx +++ b/src/components/shared/Notifications.tsx @@ -10,31 +10,28 @@ import { NOTIFICATION_CONTEXT, NOTIFICATION_CONTEXT_ACCESS, } from "../../configs/modalConfig"; -import { useAppDispatch } from "../../store"; -import { setHidden } from "../../slices/notificationSlice"; +import { useAppDispatch, useAppSelector } from "../../store"; +import { OurNotification, setHidden } from "../../slices/notificationSlice"; /** * This component renders notifications about occurred errors, warnings and info */ const Notifications : React.FC<{ - notifications: any, - globalPosition: any, - context?: any, + context?: string, }> = ({ - notifications, - globalPosition, context, }) => { const { t } = useTranslation(); const dispatch = useAppDispatch(); -// @ts-expect-error TS(7006): Parameter 'id' implicitly has an 'any' type. - const closeNotification = (id) => { + const notifications = useAppSelector(getNotifications); + const globalPosition = useAppSelector(getGlobalPositions); + + const closeNotification = (id: number) => { dispatch(setHidden({id: id, isHidden: true})); }; -// @ts-expect-error TS(7006): Parameter 'notification' implicitly has an 'any' t... Remove this comment to see the full error message - const renderNotification = (notification, key) => ( + const renderNotification = (notification: OurNotification, key: number) => (