@xenide-io/the-old-ui-theme 0.9.14 → 0.9.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/suite.d.mts +3 -5
- package/dist/suite.d.ts +3 -5
- package/dist/suite.js +258 -259
- package/dist/suite.mjs +110 -111
- package/package.json +1 -1
- package/src/suite/components/suite-entity-icon.tsx +11 -11
- package/src/suite/components/suite-notification-bell.test.tsx +75 -1
- package/src/suite/components/suite-notification-bell.tsx +13 -4
- package/src/suite/lib/suite-notifications.tsx +1 -23
|
@@ -39,8 +39,6 @@ export interface SuiteNotificationsResponse {
|
|
|
39
39
|
export interface SuiteNotificationsContextValue {
|
|
40
40
|
notifications: SuiteNotification[];
|
|
41
41
|
unreadCount: number;
|
|
42
|
-
open: boolean;
|
|
43
|
-
setOpen: (open: boolean) => void;
|
|
44
42
|
refresh: () => void;
|
|
45
43
|
select: (notification: SuiteNotification) => void;
|
|
46
44
|
markAllRead: () => void;
|
|
@@ -96,7 +94,6 @@ export function SuiteNotificationsProvider({
|
|
|
96
94
|
const router = useRouter();
|
|
97
95
|
const [notifications, setNotifications] = useState<SuiteNotification[]>([]);
|
|
98
96
|
const [unreadCount, setUnreadCount] = useState(0);
|
|
99
|
-
const [open, setOpen] = useState(false);
|
|
100
97
|
|
|
101
98
|
const load = useCallback(async () => {
|
|
102
99
|
try {
|
|
@@ -168,17 +165,8 @@ export function SuiteNotificationsProvider({
|
|
|
168
165
|
};
|
|
169
166
|
}, [enabled, load, pollMs, cacheKey]);
|
|
170
167
|
|
|
171
|
-
const setOpenAndRefresh = useCallback(
|
|
172
|
-
(next: boolean) => {
|
|
173
|
-
setOpen(next);
|
|
174
|
-
if (next) void load();
|
|
175
|
-
},
|
|
176
|
-
[load],
|
|
177
|
-
);
|
|
178
|
-
|
|
179
168
|
const select = useCallback(
|
|
180
169
|
(notification: SuiteNotification) => {
|
|
181
|
-
setOpen(false);
|
|
182
170
|
if (!notification.read_at) {
|
|
183
171
|
setNotifications((prev) =>
|
|
184
172
|
prev.map((item) =>
|
|
@@ -257,21 +245,11 @@ export function SuiteNotificationsProvider({
|
|
|
257
245
|
() => ({
|
|
258
246
|
notifications,
|
|
259
247
|
unreadCount,
|
|
260
|
-
open,
|
|
261
|
-
setOpen: setOpenAndRefresh,
|
|
262
248
|
refresh: () => void load(),
|
|
263
249
|
select,
|
|
264
250
|
markAllRead,
|
|
265
251
|
}),
|
|
266
|
-
[
|
|
267
|
-
notifications,
|
|
268
|
-
unreadCount,
|
|
269
|
-
open,
|
|
270
|
-
setOpenAndRefresh,
|
|
271
|
-
load,
|
|
272
|
-
select,
|
|
273
|
-
markAllRead,
|
|
274
|
-
],
|
|
252
|
+
[notifications, unreadCount, load, select, markAllRead],
|
|
275
253
|
);
|
|
276
254
|
|
|
277
255
|
return (
|