unable to select a readed notification
This commit is contained in:
@@ -521,7 +521,7 @@
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* .upload-progress {
|
||||
/* .upload-progress {
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
margin-right: 16px;
|
||||
@@ -5250,6 +5250,11 @@
|
||||
border: 2px solid v.$border-color-1-hover;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-block {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,11 @@ export function NotificationsList() {
|
||||
}
|
||||
|
||||
function selectAllHandler() {
|
||||
setSelectedFiles(new Set(allNotifications?.notifications.map(item => item.id)));
|
||||
const idsToSelect = allNotifications?.notifications
|
||||
.filter(item => item.status !== 'READIED')
|
||||
.map(item => item.id);
|
||||
|
||||
setSelectedFiles(new Set(idsToSelect));
|
||||
}
|
||||
|
||||
async function notificationActionHandler(ids: number[], action: 'remove' | 'mark-as-read') {
|
||||
@@ -179,15 +183,19 @@ export function NotificationsList() {
|
||||
<div
|
||||
className="notification-check"
|
||||
>
|
||||
<button
|
||||
onClick={() => {
|
||||
selectHandler(item.id);
|
||||
}}
|
||||
>
|
||||
{selectedFiles.has(item.id) && (
|
||||
<IconCheck />
|
||||
)}
|
||||
</button>
|
||||
{item.status !== 'READIED' ? (
|
||||
<button
|
||||
onClick={() => {
|
||||
selectHandler(item.id);
|
||||
}}
|
||||
>
|
||||
{selectedFiles.has(item.id) && (
|
||||
<IconCheck />
|
||||
)}
|
||||
</button>
|
||||
) : (
|
||||
<div className="empty-block"></div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -210,7 +218,7 @@ export function NotificationsList() {
|
||||
<div
|
||||
className="notification-text"
|
||||
>
|
||||
{norificationTranslate.has(item.message) ? norificationTranslate(item.message): item.message}
|
||||
{norificationTranslate.has(item.message) ? norificationTranslate(item.message) : item.message}
|
||||
</div>
|
||||
<div
|
||||
className="notification-footer"
|
||||
|
||||
Reference in New Issue
Block a user