-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 35479: Toon aantal nieuwe berichten bij ingeklapte chat
Related work items: #129659
- Loading branch information
Showing
9 changed files
with
168 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {useContext} from 'react' | ||
import {Badge} from '@/components/ui/feedback/Badge' | ||
import {ChatContext} from '@/modules/chat/providers/chat.provider' | ||
|
||
export const NewMessageIndicator = () => { | ||
const {newMessagesCount} = useContext(ChatContext) | ||
|
||
return newMessagesCount ? ( | ||
<Badge | ||
testID="ChatNewMessageIndicatorBadge" | ||
value={newMessagesCount} | ||
/> | ||
) : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import {ConversationEntryFormat} from 'react-native-salesforce-messaging-in-app/src/types' | ||
import {isNewMessage} from '@/modules/chat/utils/isNewMessage' | ||
|
||
describe('isNewMessage', () => { | ||
it('should return true for attachments format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.attachments)).toBe(true) | ||
}) | ||
|
||
it('should return true for carousel format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.carousel)).toBe(true) | ||
}) | ||
|
||
it('should return true for imageMessage format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.imageMessage)).toBe(true) | ||
}) | ||
|
||
it('should return true for inputs format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.inputs)).toBe(true) | ||
}) | ||
|
||
it('should return true for listPicker format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.listPicker)).toBe(true) | ||
}) | ||
|
||
it('should return true for richLink format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.richLink)).toBe(true) | ||
}) | ||
|
||
it('should return true for quickReplies format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.quickReplies)).toBe(true) | ||
}) | ||
|
||
it('should return true for routingResult format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.routingResult)).toBe(true) | ||
}) | ||
|
||
it('should return true for routingWorkResult format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.routingWorkResult)).toBe(true) | ||
}) | ||
|
||
it('should return true for selections format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.selections)).toBe(true) | ||
}) | ||
|
||
it('should return true for text format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.text)).toBe(true) | ||
}) | ||
|
||
it('should return false for unspecified format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.unspecified)).toBe(false) | ||
}) | ||
|
||
it('should return false for webview format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.webview)).toBe(false) | ||
}) | ||
|
||
it('should return false for typingStartedIndicator format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.typingStartedIndicator)).toBe( | ||
false, | ||
) | ||
}) | ||
|
||
it('should return false for typingStoppedIndicator format', () => { | ||
expect(isNewMessage(ConversationEntryFormat.typingStoppedIndicator)).toBe( | ||
false, | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {ConversationEntryFormat} from 'react-native-salesforce-messaging-in-app/src/types' | ||
|
||
export const isNewMessage = (format: ConversationEntryFormat) => | ||
format === ConversationEntryFormat.attachments || | ||
format === ConversationEntryFormat.carousel || | ||
format === ConversationEntryFormat.imageMessage || | ||
format === ConversationEntryFormat.inputs || | ||
format === ConversationEntryFormat.listPicker || | ||
format === ConversationEntryFormat.richLink || | ||
format === ConversationEntryFormat.quickReplies || | ||
format === ConversationEntryFormat.routingResult || | ||
format === ConversationEntryFormat.routingWorkResult || | ||
format === ConversationEntryFormat.selections || | ||
format === ConversationEntryFormat.text |