From 223bd0a7c4ff3fe6543cc31a9125f423fd6dacb5 Mon Sep 17 00:00:00 2001 From: HannesOberreiter Date: Wed, 15 Jan 2025 09:12:52 +0100 Subject: [PATCH 1/2] feat: :sparkles: added button to delete all pending notifications --- .../src/components/Header/NotificationsStep.jsx | 15 +++++++++++++++ .../Header/NotificationsStep.module.scss | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/client/src/components/Header/NotificationsStep.jsx b/client/src/components/Header/NotificationsStep.jsx index 5e06e83e3..b533045c2 100755 --- a/client/src/components/Header/NotificationsStep.jsx +++ b/client/src/components/Header/NotificationsStep.jsx @@ -22,6 +22,12 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => { [onDelete], ); + const handleDeleteAll = useCallback(() => { + items.forEach((item) => { + onDelete(item.id); + }); + }, [items, onDelete]); + const renderItemContent = useCallback( ({ activity, card }) => { switch (activity.type) { @@ -85,6 +91,15 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => { {items.length > 0 ? (
+ {items.length > 1 && ( +