Show count in bubble tag whenever a new notification is received#2015
Show count in bubble tag whenever a new notification is received#2015rohitmalhotra1420 merged 3 commits intomainfrom
Conversation
|
In the file src/common/hooks/useInAppNotifications.tsx:
In the file src/components/MobileNavButton.jsx:
In the file src/components/NavigationButton.jsx:
In the file src/config/NavigationList.js:
All looks good. |
|
@riyanshu-patro please fix this alignment.
|
|
In the code provided for File: src/common/hooks/useInAppNotifications.tsx
In the code provided for File: src/components/MobileNavButton.jsx
In the code provided for File: src/components/NavigationButton.jsx
That's all from my code review. |
| ); | ||
| if (data.source != 'PUSH_CHAT') | ||
| if (data.source != 'PUSH_CHAT') { | ||
| setNewNotifsCount((prev: any) => prev + 1); |
There was a problem hiding this comment.
| setNewNotifsCount((prev: any) => prev + 1); | |
| setNewNotifsCount((prev: number) => prev + 1); |
| updatedMessages[data.chatId].push(data); | ||
| } | ||
| setNewMessages(updatedMessages); | ||
| setNewChatsCount((prev: any) => prev + 1); |
There was a problem hiding this comment.
| setNewChatsCount((prev: any) => prev + 1); | |
| setNewChatsCount((prev: number) => prev + 1); |
src/structure/MobileNavigation.tsx
Outdated
| ...prev, | ||
| notificationList: prev.notificationList.map((item: any) => | ||
| item.id === '2_inbox' ? { ...item, data: { ...item.data, count: newNotifsCount } } : item | ||
| ), |
There was a problem hiding this comment.
Why not create a common function for this as its being used in 2 files.
src/structure/Navigation.tsx
Outdated
| useEffect(() => { | ||
| if (navigationSetup) { | ||
| setNavigationSetup((prev: any) => ({ | ||
| ...prev, |
|
In the file src/common/Common.utils.tsx:
In the file src/common/hooks/useInAppNotifications.tsx:
In the file src/components/MobileNavButton.jsx:
The rest of the files are not included for review. Please review and make the necessary corrections. Let me know if you need any further assistance with this code. |

Pull Request Template
#1940
Description
Show a bubble in inbox sidebar menu, when a new notification is received and remove it once the user clicks on the inbox menu.
Type of Change
Checklist
Frontend Guidelines
Build & Testing
Screenshots/Video with Explanation
Before: Explain the previous behavior
After: What's changed now
Additional Context
Review & Approvals
Notes