@ukpc-lib/react 0.2.12 → 0.2.13
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/assets/js/firebase-messaging-sw.js +11 -4
- package/dist/components/Notification/models/NotiticationDto.d.ts +9 -0
- package/dist/components/index.cjs +25 -25
- package/dist/components/index.js +2214 -2142
- package/dist/index.css +1 -1
- package/dist/{index.module-91685508.js → index.module-52f02ea3.js} +12 -6
- package/dist/{index.module-dcaddd18.cjs → index.module-afe68122.cjs} +2 -2
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +11 -11
- package/package.json +1 -1
- package/web-components-bundle/global-menu/index.cjs +1 -1
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.cjs +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.cjs +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-fb164b1a.js → index-6d8fc12b.js} +6321 -6305
- package/web-components-bundle/index-b1c618c5.cjs +884 -0
- package/dist/components/Notification/NotificationToast/index.d.ts +0 -11
- package/web-components-bundle/index-0c76b789.cjs +0 -884
|
@@ -26,15 +26,22 @@ firebase.initializeApp(firebaseConfig);
|
|
|
26
26
|
// Retrieve firebase messaging
|
|
27
27
|
const messaging = firebase.messaging();
|
|
28
28
|
|
|
29
|
-
//
|
|
29
|
+
//Handle incoming messages while the app is not in focus (i.e in the background, hidden behind other tabs, or completely closed).
|
|
30
30
|
messaging.onBackgroundMessage(function(payload) {
|
|
31
31
|
console.log('Received background message ', payload);
|
|
32
32
|
|
|
33
|
-
const notificationTitle = payload.
|
|
33
|
+
const notificationTitle = payload.data.message;
|
|
34
34
|
const notificationOptions = {
|
|
35
|
-
body: payload.
|
|
35
|
+
body: payload.data.context,
|
|
36
|
+
icon: 'https://ukpcsaprod.blob.core.windows.net/saas/notification-icon.svg'
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
self.registration.showNotification(notificationTitle,
|
|
39
40
|
notificationOptions);
|
|
40
|
-
|
|
41
|
+
// console.log('Received background message ', payload);
|
|
42
|
+
|
|
43
|
+
// Use BroadcastChannel to send the message to the background script
|
|
44
|
+
// const channel = new BroadcastChannel('my-channel');
|
|
45
|
+
// channel.postMessage({ notificationTitle: payload.notification.title, notificationOptions: { body: payload.notification.body } });
|
|
46
|
+
});
|
|
47
|
+
|
|
@@ -46,4 +46,13 @@ export type NotiDataType = {
|
|
|
46
46
|
notiPath: string | undefined;
|
|
47
47
|
setNotiData: React.Dispatch<React.SetStateAction<AllNotificationType>>;
|
|
48
48
|
};
|
|
49
|
+
export type NotificationToastProps = {
|
|
50
|
+
userName?: string;
|
|
51
|
+
message?: string;
|
|
52
|
+
context?: string;
|
|
53
|
+
contextUrl?: string;
|
|
54
|
+
userAvatartUrl?: string;
|
|
55
|
+
createdAt?: string;
|
|
56
|
+
readAt?: string;
|
|
57
|
+
};
|
|
49
58
|
export {};
|