|
|
@ -33,6 +33,7 @@ export function NotificationsMenu() {
|
|
|
|
notificationsStore,
|
|
|
|
notificationsStore,
|
|
|
|
(state) => state.userNotifications[user.Id]
|
|
|
|
(state) => state.userNotifications[user.Id]
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
const reducedNotifications = userNotifications?.slice(0, 50);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Menu>
|
|
|
|
<Menu>
|
|
|
@ -55,7 +56,7 @@ export function NotificationsMenu() {
|
|
|
|
<Icon icon={Bell} />
|
|
|
|
<Icon icon={Bell} />
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
className={
|
|
|
|
className={
|
|
|
|
userNotifications?.length > 0 ? notificationStyles.badge : ''
|
|
|
|
reducedNotifications?.length > 0 ? notificationStyles.badge : ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -77,7 +78,7 @@ export function NotificationsMenu() {
|
|
|
|
<h4>Notifications</h4>
|
|
|
|
<h4>Notifications</h4>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className={notificationStyles.itemLast}>
|
|
|
|
<div className={notificationStyles.itemLast}>
|
|
|
|
{userNotifications?.length > 0 && (
|
|
|
|
{reducedNotifications?.length > 0 && (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
color="none"
|
|
|
|
color="none"
|
|
|
|
onClick={(e) => {
|
|
|
|
onClick={(e) => {
|
|
|
@ -93,10 +94,10 @@ export function NotificationsMenu() {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{userNotifications?.length > 0 ? (
|
|
|
|
{reducedNotifications?.length > 0 ? (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
<div className={notificationStyles.notifications}>
|
|
|
|
<div className={notificationStyles.notifications}>
|
|
|
|
{userNotifications.map((notification) => (
|
|
|
|
{reducedNotifications.map((notification) => (
|
|
|
|
<MenuLink
|
|
|
|
<MenuLink
|
|
|
|
to="portainer.notifications"
|
|
|
|
to="portainer.notifications"
|
|
|
|
params={{ id: notification.id }}
|
|
|
|
params={{ id: notification.id }}
|
|
|
|