Skip to content

Commit 6534d1d

Browse files
committed
fiew minor fixes
1 parent 9367160 commit 6534d1d

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

Diff for: hashkitty-front/src/App/NotificationsContext.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class NotificationsContextImplementation
8080
this.removeFromListShortliveNotifications(notif.id);
8181
return notif;
8282
});
83-
}, 5000);
83+
}, 3000);
8484
this.setShortLiveNotifications(prevNotifs => [
8585
...new Set([...prevNotifs, ...notifs]),
8686
]);

Diff for: hashkitty-front/src/components/Frame/Frame.tsx

+20-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { Alert, CircularProgress } from '@mui/material';
2-
31
import { useContext } from 'react';
2+
import Alert from '@mui/material/Alert';
3+
import Grow from '@mui/material/Grow';
4+
import CircularProgress from '@mui/material/CircularProgress';
5+
46
import NavBar from '../NavBar/NavBar';
57
import ColorModeContext from '../../App/ColorModeContext';
68
import NotificationsContext from '../../App/NotificationsContext';
@@ -20,21 +22,23 @@ export default function Frame({ children, isLoading }: FrameProps) {
2022

2123
return (
2224
<>
23-
<header>
25+
<header className="relative">
2426
<NavBar />
25-
<div className="flex flex-wrap justify-center px-[15vw]">
26-
{shortLiveNotifications.map(notif => (
27-
<Alert
28-
key={notif.id}
29-
onClose={() => deleteNotification(notif.id)}
30-
severity={notif.status}
31-
sx={{
32-
backgroundColor: colors.alerts[notif.status],
33-
}}
34-
className="w-full"
35-
>
36-
{notif.message}
37-
</Alert>
27+
<div className="absolute flex flex-wrap justify-center px-[15vw] w-[90vw] z-10">
28+
{shortLiveNotifications.map(({ id, status, message }) => (
29+
<Grow key={id} in>
30+
<Alert
31+
key={id}
32+
onClose={() => deleteNotification(id)}
33+
severity={status}
34+
sx={{
35+
backgroundColor: colors.alerts[status],
36+
}}
37+
className="w-full"
38+
>
39+
{message}
40+
</Alert>
41+
</Grow>
3842
))}
3943
</div>
4044
</header>

Diff for: hashkitty-front/src/components/NavBar/NavBar.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ const NavBar = memo(() => {
100100
</div>
101101
<div className="flex lg:hidden gap-6">
102102
<IconButton
103-
onClick={handleOpenPopper}
103+
onClick={e => handleOpenPopper(e)}
104104
style={{ backgroundColor: 'transparent' }}
105+
disabled={notifications.length === 0}
105106
>
106-
<Badge badgeContent={4} color="secondary">
107+
<Badge
108+
badgeContent={notifications.length}
109+
color="secondary"
110+
sx={{ '& > span': { color: 'white' } }}
111+
>
107112
<NotificationsIcon />
108113
</Badge>
109114
</IconButton>

0 commit comments

Comments
 (0)