Update notifikasi send email
This commit is contained in:
@@ -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' }}>
|
||||
{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') {
|
||||
|
||||
Reference in New Issue
Block a user