@cometchat/chat-uikit-react-native 4.3.10 → 4.3.11
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/package.json
CHANGED
|
@@ -260,10 +260,10 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
260
260
|
AppBarOption,
|
|
261
261
|
options,
|
|
262
262
|
hideSeparator = true,
|
|
263
|
-
hideSubmitIcon =
|
|
263
|
+
hideSubmitIcon = false,
|
|
264
264
|
backButtonIcon,
|
|
265
265
|
showBackButton = false,
|
|
266
|
-
selectionMode = "
|
|
266
|
+
selectionMode = "single",
|
|
267
267
|
onSelection,
|
|
268
268
|
title = localize("CHATS"),
|
|
269
269
|
emptyStateText,
|
|
@@ -290,7 +290,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
290
290
|
const conversationListRef = React.useRef<CometChatListActionsInterface>(null);
|
|
291
291
|
const loggedInUser = React.useRef(null);
|
|
292
292
|
const [confirmDelete, setConfirmDelete] = React.useState(undefined);
|
|
293
|
-
const [selecting, setSelecting] = React.useState(false);
|
|
293
|
+
const [selecting, setSelecting] = React.useState(selectionMode === 'none' ? false : true);
|
|
294
294
|
const [selectedConversation, setSelectedConversations] = React.useState([]);
|
|
295
295
|
const onMemberAddedToGroupDebounceTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
296
296
|
|
|
@@ -1089,6 +1089,13 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1089
1089
|
CometChatUIEventHandler.addGroupListener(
|
|
1090
1090
|
groupListenerId,
|
|
1091
1091
|
{
|
|
1092
|
+
ccGroupCreated: ({ group }) => {
|
|
1093
|
+
CometChat.getConversation(group.getGuid(), CometChatUiKitConstants.ConversationTypeConstants.group).then(
|
|
1094
|
+
conversation => {
|
|
1095
|
+
conversationListRef.current?.addItemToList(conversation, 0);
|
|
1096
|
+
}
|
|
1097
|
+
)
|
|
1098
|
+
},
|
|
1092
1099
|
ccGroupDeleted: ({ group }) => {
|
|
1093
1100
|
conversationListRef.current?.removeItemFromList(group['conversationId']);
|
|
1094
1101
|
removeItemFromSelectionList(group['conversationId'])
|
|
@@ -209,6 +209,10 @@ export const CometChatMessageList = memo(forwardRef<
|
|
|
209
209
|
let _updatedCustomRequestBuilder = _defaultRequestBuilder;
|
|
210
210
|
if (messageRequestBuilder) {
|
|
211
211
|
_updatedCustomRequestBuilder = messageRequestBuilder;
|
|
212
|
+
if (user)
|
|
213
|
+
_updatedCustomRequestBuilder = _updatedCustomRequestBuilder.setUID(user["uid"])
|
|
214
|
+
if (group)
|
|
215
|
+
_updatedCustomRequestBuilder = _updatedCustomRequestBuilder.setGUID(group["guid"])
|
|
212
216
|
} else {
|
|
213
217
|
_updatedCustomRequestBuilder.hideReplies(true);
|
|
214
218
|
if (user)
|
|
@@ -802,6 +806,8 @@ export const CometChatMessageList = memo(forwardRef<
|
|
|
802
806
|
}
|
|
803
807
|
tmpMsg['updatedAt'] = receipt['timestamp'];
|
|
804
808
|
|
|
809
|
+
tmpList[index] = CommonUtils.clone(tmpMsg);
|
|
810
|
+
|
|
805
811
|
messagesContentListRef.current = tmpList;
|
|
806
812
|
setMessagesList(tmpList);
|
|
807
813
|
}
|
|
@@ -18,11 +18,11 @@ const CometChatCalls = CallingPackage.CometChatCalls;
|
|
|
18
18
|
|
|
19
19
|
export interface CometChatCallLogsConfigurationInterface {
|
|
20
20
|
title?: string,
|
|
21
|
-
SubtitleView?: (param: { call?:
|
|
22
|
-
ListItemView?: (param: { call?:
|
|
23
|
-
TailView?: (param: { call?:
|
|
21
|
+
SubtitleView?: (param: { call?: any }) => JSX.Element,
|
|
22
|
+
ListItemView?: (param: { call?: any }) => JSX.Element,
|
|
23
|
+
TailView?: (param: { call?: any }) => JSX.Element,
|
|
24
24
|
AppBarOptions?: () => JSX.Element,
|
|
25
|
-
options?: (param: { message:
|
|
25
|
+
options?: (param: { message: any }) => CometChatOptions[],
|
|
26
26
|
callRequestBuilder?: any,
|
|
27
27
|
datePattern: DatePattern,
|
|
28
28
|
dateSeparatorPattern: DatePattern,
|
|
@@ -36,10 +36,10 @@ export interface CometChatCallLogsConfigurationInterface {
|
|
|
36
36
|
loadingIcon?: ImageType,
|
|
37
37
|
LoadingStateView?: () => JSX.Element,
|
|
38
38
|
hideError?: boolean,
|
|
39
|
-
onItemPress?: (item:
|
|
39
|
+
onItemPress?: (item: any) => void,
|
|
40
40
|
onError?: (e: CometChat.CometChatException) => void,
|
|
41
41
|
onBack?: () => void,
|
|
42
|
-
onInfoIconPress?: (prop: { call:
|
|
42
|
+
onInfoIconPress?: (prop: { call: any }) => void,
|
|
43
43
|
infoIcon?: ImageType,
|
|
44
44
|
avatarStyle?: AvatarStyleInterface,
|
|
45
45
|
listItemStyle?: ListItemStyleInterface,
|
|
@@ -5,7 +5,7 @@ import { CometChatMessageBubble } from "../views/CometChatMessageBubble";
|
|
|
5
5
|
import { CometChatTheme } from "../resources";
|
|
6
6
|
import { ChatConfigurator } from "../framework";
|
|
7
7
|
import { CometChatMessageTemplate } from "../modals";
|
|
8
|
-
import { MessageBubbleAlignmentType } from "../base
|
|
8
|
+
import { BaseStyle, MessageBubbleAlignmentType } from "../base";
|
|
9
9
|
|
|
10
10
|
type MessageViewType = {
|
|
11
11
|
message: CometChat.BaseMessage,
|
|
@@ -14,9 +14,9 @@ type MessageViewType = {
|
|
|
14
14
|
theme?: CometChatTheme,
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const MessageContentView = (props:{message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme}) => {
|
|
17
|
+
const MessageContentView = (props: { message: CometChat.BaseMessage, alignment: MessageBubbleAlignmentType, theme: CometChatTheme }) => {
|
|
18
18
|
const {
|
|
19
|
-
message,
|
|
19
|
+
message,
|
|
20
20
|
alignment,
|
|
21
21
|
theme
|
|
22
22
|
} = props;
|
|
@@ -48,12 +48,21 @@ export const MessageUtils = {
|
|
|
48
48
|
alignment,
|
|
49
49
|
theme,
|
|
50
50
|
} = params
|
|
51
|
+
|
|
52
|
+
const getStyle = (item: CometChat.BaseMessage) => {
|
|
53
|
+
let _style: BaseStyle = {};
|
|
54
|
+
|
|
55
|
+
_style.backgroundColor = (alignment !== "left" && (item.getType() === MessageTypeConstants.text || item.getType() === MessageTypeConstants.meeting)) ? theme?.palette.getPrimary() : theme?.palette.getAccent50();
|
|
56
|
+
|
|
57
|
+
return _style;
|
|
58
|
+
};
|
|
59
|
+
|
|
51
60
|
return <CometChatMessageBubble
|
|
52
61
|
id={`${message.getId()}`}
|
|
53
62
|
alignment={alignment}
|
|
54
63
|
ContentView={template?.ContentView?.bind(this, message, alignment) || MessageContentView.bind(this, message, alignment, theme)}
|
|
55
64
|
BottomView={template?.BottomView && template?.BottomView?.bind(this, message, alignment)}
|
|
56
|
-
style={
|
|
57
|
-
|
|
65
|
+
style={getStyle(message)}
|
|
66
|
+
/>;
|
|
58
67
|
}
|
|
59
68
|
}
|