From 39c9808eaa52c155d8468b16ceb48cf8dcc81a82 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 27 May 2026 23:25:02 +0500 Subject: [PATCH] fix: use native Snackbar positioning for NotificationStack instead of custom Stack wrapper --- .../NotificationStack/NotificationStack.tsx | 29 ++++++++---------- server/prisma/prisma/dev.db | Bin 352256 -> 352256 bytes 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/client/src/shared/ui/NotificationStack/NotificationStack.tsx b/client/src/shared/ui/NotificationStack/NotificationStack.tsx index bd1fef7..6ff1266 100644 --- a/client/src/shared/ui/NotificationStack/NotificationStack.tsx +++ b/client/src/shared/ui/NotificationStack/NotificationStack.tsx @@ -1,9 +1,11 @@ import CloseIcon from '@mui/icons-material/Close' -import { Snackbar, Alert, Stack, IconButton, Button } from '@mui/material' +import { Snackbar, Alert, IconButton, Button } from '@mui/material' import { useUnit } from 'effector-react' import { useNavigate } from 'react-router-dom' import { $notifications, dismissNotification as dismissNotificationEvent } from '../../model/notification' +const GAP = 76 + export function NotificationStack() { const notifications = useUnit($notifications) const dismissNotification = useUnit(dismissNotificationEvent) @@ -12,27 +14,18 @@ export function NotificationStack() { if (notifications.length === 0) return null return ( - - {notifications.map((n) => ( + <> + {notifications.map((n, index) => ( dismissNotification(n.id)} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} - sx={{ position: 'static' }} + sx={{ + bottom: `${88 + (notifications.length - 1 - index) * GAP}px !important`, + zIndex: 2000 + index, + }} > dismissNotification(n.id)} sx={{ width: '100%', + minWidth: 360, + maxWidth: 440, px: 2, py: 1.5, alignItems: 'center', @@ -100,6 +95,6 @@ export function NotificationStack() { ))} - + ) } diff --git a/server/prisma/prisma/dev.db b/server/prisma/prisma/dev.db index 4c1a5c9385248278d832d0c77858d529261182bb..4f891b66c8c96a99918c518c5637d39996ab896f 100644 GIT binary patch delta 219 zcmZoTAlh(1bb>Tv(nJ|&#-zrCtqF|p=cx&>*>kem+b8E1Tv&_o$$#-PT8tqF|p=c)0q*>kem+b8E1B7#HT4TW01} z7?hYA