Update notifikasi send email

This commit is contained in:
ivan-sim
2023-11-21 12:07:51 +07:00
parent 0b211e12a4
commit 6d72b1b789
4 changed files with 252 additions and 15 deletions

View File

@@ -14,6 +14,7 @@ import {
ListSubheader,
ListItemAvatar,
ListItemButton,
Stack
} from '@mui/material';
// utils
import { fToNow } from '@/utils/formatTime';
@@ -93,13 +94,13 @@ export default function NotificationsPopover() {
</Typography>
</Box>
{totalUnRead > 0 && (
{/* {totalUnRead > 0 && (
<Tooltip title=" Mark all as read">
<IconButtonAnimate color="primary" onClick={handleMarkAllAsRead}>
<Iconify icon="eva:done-all-fill" width={20} height={20} />
</IconButtonAnimate>
</Tooltip>
)}
)} */}
</Box>
<Divider sx={{ borderStyle: 'dashed' }} />
@@ -116,7 +117,7 @@ export default function NotificationsPopover() {
}
>
{notifications.slice(0, 2).map((notification) => (
<NotificationItem key={notification.id} notification={notification} onClick={notification.id} getDataNotifications={getDataNotifications}/>
<NotificationItem key={notification.id} notification={notification} getDataNotifications={getDataNotifications}/>
))}
</List>
@@ -129,7 +130,7 @@ export default function NotificationsPopover() {
}
>
{notifications.slice(2, 5).map((notification) => (
<NotificationItem key={notification.id} notification={notification} onClick={notification.id} getDataNotifications={getDataNotifications}/>
<NotificationItem key={notification.id} notification={notification} getDataNotifications={getDataNotifications}/>
))}
</List>
</>
@@ -161,7 +162,7 @@ type NotificationItemProps = {
isUnRead: boolean;
};
function NotificationItem({ notification, onClick, getDataNotifications }: { notification: NotificationItemProps, onClick: (id: string) => void, getDataNotifications: () => void}) {
function NotificationItem({ notification, getDataNotifications }: { notification: NotificationItemProps, getDataNotifications: () => void}) {
const { avatar, title } = renderContent(notification);
const {enqueueSnackbar} = useSnackbar();
const handleClick = () => {
@@ -223,12 +224,12 @@ function NotificationItem({ notification, onClick, getDataNotifications }: { not
function renderContent(notification: NotificationItemProps) {
const title = (
<Typography variant="subtitle2">
{notification.title}
<Typography component="span" variant="body2" sx={{ color: 'text.secondary' }}>
&nbsp; {noCase(notification.description)}
</Typography>
</Typography>
<Stack direction="column">
<Typography variant="subtitle2">{notification.title}</Typography>
<Typography component="span" variant="body2" sx={{ color: 'text.secondary' }}>
{notification.description}
</Typography>
</Stack>
);
if (notification.type === 'order_placed') {