@cometchat/chat-uikit-react-native 4.0.2 → 4.1.0
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/README.md +1 -1
- package/package.json +3 -3
- package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +164 -0
- package/src/AI/AIAssistBot/AIAssistBotExtension.tsx +22 -0
- package/src/AI/AIAssistBot/AIAssistBotStyle.ts +43 -0
- package/src/AI/AIAssistBot/AIAssistBotView.tsx +294 -0
- package/src/AI/AIAssistBot/configuration.ts +22 -0
- package/src/AI/AIAssistBot/resources/index.ts +5 -0
- package/src/AI/{configuration.ts → AIBaseConfiguration.ts} +3 -6
- package/src/AI/AIBaseStyle.ts +58 -0
- package/src/AI/AIConversationStarter/AIConversationStarter.ts +5 -19
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +144 -130
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +11 -6
- package/src/AI/AIConversationStarter/configuration.ts +10 -17
- package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +175 -0
- package/src/AI/AIConversationSummary/AIConversationSummaryExtension.ts +21 -0
- package/src/AI/AIConversationSummary/AIConversationSummaryStyle.tsx +20 -0
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +190 -0
- package/src/AI/AIConversationSummary/configuration.ts +14 -0
- package/src/AI/AIConversationSummary/resources/close.png +0 -0
- package/src/AI/AIConversationSummary/resources/index.ts +5 -0
- package/src/AI/AIExtensionDataSource.ts +17 -12
- package/src/AI/AIOptionsStyle.ts +14 -0
- package/src/AI/AISmartReplies/AISmartReplies.ts +6 -15
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +302 -0
- package/src/AI/AISmartReplies/AISmartRepliesStyle.ts +1 -1
- package/src/AI/AISmartReplies/configuration.ts +4 -11
- package/src/AI/resources/index.ts +0 -2
- package/src/AI/utils.ts +3 -3
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +118 -5
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +3 -0
- package/src/CometChatMessageComposer/resources/index.ts +2 -0
- package/src/CometChatMessageComposer/styles.ts +1 -4
- package/src/CometChatMessageList/CometChatMessageList.tsx +33 -24
- package/src/CometChatMessages/CometChatMessages.tsx +4 -13
- package/src/CometChatMessages/MessagesConfiguration.ts +2 -2
- package/src/calls/CallUtils.ts +106 -45
- package/src/calls/CallingDetailsUtils.tsx +133 -15
- package/src/calls/CallingPackage.ts +16 -2
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +9 -10
- package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +116 -0
- package/src/calls/CometChatCallLogDetails/CallLogDetailsStyle.ts +36 -0
- package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +308 -0
- package/src/calls/CometChatCallLogDetails/index.ts +12 -0
- package/src/calls/CometChatCallLogDetails/resources/CloseIcon.png +0 -0
- package/src/calls/{CometChatCallDetails → CometChatCallLogDetails}/style.ts +1 -0
- package/src/calls/{CometChatCallHistory/CallHistoryConfiguration.ts → CometChatCallLogHistory/CallLogHistoryConfiguration.ts} +15 -27
- package/src/calls/CometChatCallLogHistory/CallLogHistoryStyle.ts +46 -0
- package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +337 -0
- package/src/calls/CometChatCallLogHistory/index.ts +12 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/incomingvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/index.ts +29 -0
- package/src/calls/CometChatCallLogHistory/resources/missedcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/missedvideo.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingcall.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/outgoingvideo.png +0 -0
- package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/style.ts +2 -1
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +61 -0
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsStyle.ts +59 -0
- package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +220 -0
- package/src/calls/CometChatCallLogParticipants/index.ts +12 -0
- package/src/calls/CometChatCallLogParticipants/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogParticipants/resources/index.ts +4 -0
- package/src/calls/CometChatCallLogParticipants/style.ts +24 -0
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +63 -0
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsStyle.ts +63 -0
- package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +253 -0
- package/src/calls/CometChatCallLogRecordings/index.ts +12 -0
- package/src/calls/CometChatCallLogRecordings/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/index.ts +6 -0
- package/src/calls/CometChatCallLogRecordings/style.ts +24 -0
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +87 -0
- package/src/calls/CometChatCallLogs/CallLogsStyle.ts +95 -0
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +482 -0
- package/src/calls/CometChatCallLogs/index.ts +12 -0
- package/src/calls/CometChatCallLogs/resources/Back.png +0 -0
- package/src/calls/CometChatCallLogs/resources/Info.png +0 -0
- package/src/calls/CometChatCallLogs/resources/Selection.png +0 -0
- package/src/calls/CometChatCallLogs/resources/Spinner.png +0 -0
- package/src/calls/CometChatCallLogs/resources/check.png +0 -0
- package/src/calls/CometChatCallLogs/resources/incomingcall.png +0 -0
- package/src/calls/CometChatCallLogs/resources/incomingvideo.png +0 -0
- package/src/calls/CometChatCallLogs/resources/index.ts +25 -0
- package/src/calls/CometChatCallLogs/resources/missedcall.png +0 -0
- package/src/calls/CometChatCallLogs/resources/missedvideo.png +0 -0
- package/src/calls/CometChatCallLogs/resources/outgoingcall.png +0 -0
- package/src/calls/CometChatCallLogs/resources/outgoingvideo.png +0 -0
- package/src/calls/CometChatCallLogs/style.ts +24 -0
- package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +9 -0
- package/src/calls/{CometChatCallHistoryWithDetails/CometChatCallHistoryWithDetails.tsx → CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx} +17 -16
- package/src/calls/CometChatCallLogsWithDetails/index.ts +7 -0
- package/src/calls/index.ts +40 -1
- package/src/calls/resources/index.ts +3 -1
- package/src/calls/resources/nextarrow.png +0 -0
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +3 -5
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +1 -1
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +5 -3
- package/src/extensions/ThumbnailGeneration/resources/empty.png +0 -0
- package/src/extensions/ThumbnailGeneration/resources/index.ts +5 -0
- package/src/index.ts +79 -4
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +154 -130
- package/src/shared/CometChatUiKit/UIKitSettings.ts +2 -2
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +1 -1
- package/src/shared/framework/DataSource.ts +4 -0
- package/src/shared/framework/DataSourceDecorator.tsx +5 -0
- package/src/shared/framework/MessageDataSource.tsx +4 -1
- package/src/shared/index.ts +4 -0
- package/src/shared/modals/CometChatCallLogDetailsOptions.ts +23 -0
- package/src/shared/modals/CometChatCallLogDetailsTemplate.ts +16 -0
- package/src/shared/modals/index.ts +5 -1
- package/src/shared/resources/CometChatLocalize/resources/ar/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/de/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/en/translation.json +21 -7
- package/src/shared/resources/CometChatLocalize/resources/es/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/fr/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/hi/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/lt/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/ms/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/pt/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/ru/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/sv/translation.json +19 -5
- package/src/shared/resources/CometChatLocalize/resources/zh/translation.json +19 -4
- package/src/shared/resources/CometChatLocalize/resources/zh-tw/translation.json +19 -5
- package/src/shared/resources/CometChatTheme/Palette.ts +16 -0
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +1 -1
- package/src/shared/views/CometChatAICard/CometChatAICard.tsx +71 -0
- package/src/shared/views/CometChatAICard/resources/errormessage.png +0 -0
- package/src/shared/views/CometChatAICard/resources/index.ts +4 -0
- package/src/shared/views/CometChatAICard/resources/nomessage.png +0 -0
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +4 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +11 -7
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +56 -47
- package/src/shared/views/CometChatBottomSheet/style.ts +0 -2
- package/src/shared/views/CometChatDate/CometChatDate.tsx +7 -3
- package/src/shared/views/CometChatDate/DateConfiguration.ts +4 -0
- package/src/shared/views/CometChatDate/style.ts +1 -1
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +31 -19
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +1 -2
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +51 -0
- package/src/shared/views/CometChatPanel/PanelStyle.tsx +43 -0
- package/src/shared/views/CometChatPanel/resources/CloseIcon.png +0 -0
- package/src/shared/views/CometChatPanel/resources/index.ts +5 -0
- package/src/AI/AIEnabler.ts +0 -115
- package/src/AI/AIEnablerDecorator.tsx +0 -324
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.ts +0 -18
- package/src/calls/CometChatCallDetails/CallDetailsConfiguration.ts +0 -68
- package/src/calls/CometChatCallDetails/CallDetailsStyle.ts +0 -52
- package/src/calls/CometChatCallDetails/CometChatCallDetails.tsx +0 -268
- package/src/calls/CometChatCallDetails/index.ts +0 -9
- package/src/calls/CometChatCallHistory/CallHistoryStyle.ts +0 -34
- package/src/calls/CometChatCallHistory/CometChatCallHistory.tsx +0 -422
- package/src/calls/CometChatCallHistory/index.ts +0 -9
- package/src/calls/CometChatCallHistory/resources/index.ts +0 -17
- package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsConfiguration.ts +0 -7
- package/src/calls/CometChatCallHistoryWithDetails/HistoryWithDetailsStyle.ts +0 -3
- package/src/calls/CometChatCallHistoryWithDetails/index.ts +0 -8
- /package/src/{calls/CometChatCallDetails → AI/AIAssistBot}/resources/CloseIcon.png +0 -0
- /package/src/{AI → CometChatMessageComposer}/resources/ai.png +0 -0
- /package/src/calls/{CometChatCallDetails → CometChatCallLogDetails}/resources/index.ts +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Back.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Call.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Info.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Selection.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Spineer.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/Video.png +0 -0
- /package/src/calls/{CometChatCallHistory → CometChatCallLogHistory}/resources/check.png +0 -0
- /package/src/calls/{CometChatCallHistoryWithDetails → CometChatCallLogsWithDetails}/style.ts +0 -0
|
@@ -1,39 +1,157 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { View, Text, Image } from "react-native";
|
|
2
3
|
import { CometChat } from "@cometchat/chat-sdk-react-native"
|
|
3
|
-
import {
|
|
4
|
+
import { CometChatCallLogDetailsTemplate, CometChatDate, CometChatListItem, CometChatTheme, localize } from "../shared"
|
|
4
5
|
import { CometChatCallButtons } from "./CometChatCallButtons";
|
|
6
|
+
import { CallUtils } from "./CallUtils";
|
|
7
|
+
import { NextArrowIcon } from "./resources";
|
|
5
8
|
|
|
6
9
|
export class CallingDetailsUtils {
|
|
7
10
|
|
|
8
|
-
static getDefaultDetailsTemplates(
|
|
11
|
+
static getDefaultDetailsTemplates(callLog: any, loggedInUser: CometChat.User, theme: CometChatTheme): Array<CometChatCallLogDetailsTemplate> {
|
|
12
|
+
|
|
9
13
|
return [
|
|
10
|
-
this.getPrimaryDetailsTemplate(
|
|
14
|
+
this.getPrimaryDetailsTemplate(callLog, loggedInUser, theme)
|
|
11
15
|
]
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
static getPrimaryDetailsTemplate(
|
|
18
|
+
static getPrimaryDetailsTemplate(callLog: any, loggedInUser: CometChat.User, theme: CometChatTheme): CometChatCallLogDetailsTemplate {
|
|
19
|
+
|
|
20
|
+
let user = callLog?.getReceiverType() == "user" ? loggedInUser?.getUid() === callLog?.getInitiator()?.getUid() ? callLog.getReceiver() : callLog?.getInitiator() : undefined
|
|
21
|
+
let group = callLog?.getReceiverType() == "group" ? loggedInUser?.getUid() === callLog?.getInitiator()?.getUid() ? callLog.getReceiver() : callLog?.getInitiator() : undefined
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
function subtitleView(): JSX.Element {
|
|
25
|
+
return (
|
|
26
|
+
<View style={{ padding: 10 }}>
|
|
27
|
+
<CometChatDate
|
|
28
|
+
timeStamp={callLog['initiatedAt'] * 1000}
|
|
29
|
+
pattern={"dayDateFormat"}
|
|
30
|
+
style={{ textColor: theme.palette.getAccent(), textFont: theme.typography.title2 }}
|
|
31
|
+
/>
|
|
32
|
+
<View style={{ marginTop: 2, flexDirection: "row", justifyContent: "space-between" }}>
|
|
33
|
+
<View style={{ flexDirection: "row" }}>
|
|
34
|
+
<CometChatDate timeStamp={callLog['initiatedAt'] * 1000} pattern={'timeFormat'} style={{ textColor: theme.palette.getAccent600(), textFont: theme.typography.subtitle1 }} />
|
|
35
|
+
<Text style={[{ marginHorizontal: 10, color: theme.palette.getAccent() }, theme.typography.subtitle1]}>
|
|
36
|
+
{
|
|
37
|
+
CallUtils.getCallStatus(callLog as CometChat.Call, loggedInUser)
|
|
38
|
+
}
|
|
39
|
+
</Text>
|
|
40
|
+
</View>
|
|
41
|
+
<Text style={[{ marginHorizontal: 10, color: theme.palette.getAccent() }, theme.typography.subtitle1]}>{CallUtils.convertMinutesToHoursMinutesSeconds(callLog['totalDurationInMinutes'])}</Text>
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let options = [{
|
|
48
|
+
id: 'lastCall',
|
|
49
|
+
CustomView: () => (
|
|
50
|
+
<View style={{ marginHorizontal: 10, marginVertical: 20 }}>
|
|
51
|
+
<CometChatListItem
|
|
52
|
+
id={user ? user['uid'] : group ? group['guid'] : undefined}
|
|
53
|
+
SubtitleView={() => subtitleView()}
|
|
54
|
+
listItemStyle={{ backgroundColor: theme.palette.getAccent100(), borderRadius: 10 }}
|
|
55
|
+
/>
|
|
56
|
+
</View>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
user && options.unshift({
|
|
62
|
+
id: "controls",
|
|
63
|
+
CustomView: () => <View
|
|
64
|
+
style={{ marginHorizontal: 2 }}
|
|
65
|
+
>
|
|
66
|
+
<CometChatCallButtons
|
|
67
|
+
group={group}
|
|
68
|
+
user={user}
|
|
69
|
+
callButtonStyle={{
|
|
70
|
+
width: "100%"
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
</View>
|
|
74
|
+
});
|
|
75
|
+
|
|
15
76
|
return {
|
|
16
77
|
id: "callControls",
|
|
17
78
|
hideItemSeparator: true,
|
|
18
79
|
hideSectionSeparator: true,
|
|
19
|
-
options: [
|
|
20
|
-
{
|
|
21
|
-
id: "controls",
|
|
22
|
-
CustomView: () => <CometChatCallButtons
|
|
23
|
-
group={group}
|
|
24
|
-
user={user}
|
|
25
|
-
/>
|
|
26
|
-
}
|
|
27
|
-
]
|
|
80
|
+
options: [...options]
|
|
28
81
|
}
|
|
29
82
|
}
|
|
30
83
|
|
|
31
|
-
static getSecondaryDetailsTemplate(
|
|
84
|
+
static getSecondaryDetailsTemplate(callLog: any, loggedInUser: CometChat.User, theme: CometChatTheme): CometChatCallLogDetailsTemplate {
|
|
85
|
+
let options = [{
|
|
86
|
+
title: localize("CALL_HISTORY"),
|
|
87
|
+
id: 'history',
|
|
88
|
+
CustomView: () => (
|
|
89
|
+
<View style={{ marginHorizontal: 10, borderBottomLeftRadius: 10, borderBottomRightRadius: 10, overflow: "hidden", borderTopWidth: .5, borderColor: theme.palette.getAccent400() }}>
|
|
90
|
+
<CometChatListItem
|
|
91
|
+
id={'history'}
|
|
92
|
+
SubtitleView={() => (
|
|
93
|
+
<View style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: 10 }}>
|
|
94
|
+
<Text style={[{ color: theme.palette.getAccent() }, theme.typography.title2]}>{localize("CALL_HISTORY")}</Text>
|
|
95
|
+
<Image source={NextArrowIcon} style={{ height: 16, width: 16, alignSelf: "center", tintColor: theme.palette.getPrimary() }} />
|
|
96
|
+
</View>
|
|
97
|
+
)}
|
|
98
|
+
listItemStyle={{ backgroundColor: theme.palette.getAccent100(), height: 50 }}
|
|
99
|
+
/>
|
|
100
|
+
</View>
|
|
101
|
+
)
|
|
102
|
+
}];
|
|
103
|
+
|
|
104
|
+
let recordingObj = {
|
|
105
|
+
title: localize("RECORDINGS"),
|
|
106
|
+
id: 'recordings',
|
|
107
|
+
CustomView: () => (
|
|
108
|
+
<View style={{ marginHorizontal: 10, overflow: "hidden", borderTopWidth: .5, borderColor: theme.palette.getAccent400() }}>
|
|
109
|
+
<CometChatListItem
|
|
110
|
+
id={'recordings'}
|
|
111
|
+
SubtitleView={() => (
|
|
112
|
+
<View style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: 10 }}>
|
|
113
|
+
<Text style={[{ color: theme.palette.getAccent() }, theme.typography.title2]}>{localize("RECORDINGS")}</Text>
|
|
114
|
+
<View style={{ flexDirection: "row" }}>
|
|
115
|
+
<Text style={[{ color: theme.palette.getAccent(), marginRight: 5 }, theme.typography.title2]}>{callLog?.recordings?.length}</Text>
|
|
116
|
+
<Image source={NextArrowIcon} style={{ height: 16, width: 16, alignSelf: "center", tintColor: theme.palette.getPrimary() }} />
|
|
117
|
+
</View>
|
|
118
|
+
</View>
|
|
119
|
+
)}
|
|
120
|
+
listItemStyle={{ backgroundColor: theme.palette.getAccent100(), height: 50 }}
|
|
121
|
+
/>
|
|
122
|
+
</View>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
callLog?.recordings?.length && options.unshift(recordingObj);
|
|
126
|
+
|
|
127
|
+
let participantsObj = {
|
|
128
|
+
title: localize("PARTICIPANTS"),
|
|
129
|
+
id: 'participants',
|
|
130
|
+
CustomView: () => (
|
|
131
|
+
<View style={{ marginHorizontal: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, overflow: "hidden" }}>
|
|
132
|
+
<CometChatListItem
|
|
133
|
+
id={'participants'}
|
|
134
|
+
SubtitleView={() => (
|
|
135
|
+
<View style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: 10 }}>
|
|
136
|
+
<Text style={[{ color: theme.palette.getAccent() }, theme.typography.title2]}>{localize("PARTICIPANTS")}</Text>
|
|
137
|
+
<View style={{ flexDirection: "row" }}>
|
|
138
|
+
<Text style={[{ color: theme.palette.getAccent(), marginRight: 5 }, theme.typography.title2]}>{callLog?.participants?.length}</Text>
|
|
139
|
+
<Image source={NextArrowIcon} style={{ height: 16, width: 16, alignSelf: "center", tintColor: theme.palette.getPrimary() }} />
|
|
140
|
+
</View>
|
|
141
|
+
</View>
|
|
142
|
+
)}
|
|
143
|
+
listItemStyle={{ backgroundColor: theme.palette.getAccent100(), height: 50 }}
|
|
144
|
+
/>
|
|
145
|
+
</View>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
options.unshift(participantsObj);
|
|
149
|
+
|
|
32
150
|
return {
|
|
33
151
|
id: "callInfo",
|
|
34
152
|
hideItemSeparator: true,
|
|
35
153
|
hideSectionSeparator: true,
|
|
36
|
-
options: []
|
|
154
|
+
options: [...options]
|
|
37
155
|
};
|
|
38
156
|
}
|
|
39
157
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
declare const require: any;
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
let isCallingPackageInstalled, CometChatCalls;
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
// Attempt to require the package
|
|
7
|
+
CometChatCalls = require('@cometchat/calls-sdk-react-native')?.CometChatCalls;
|
|
8
|
+
isCallingPackageInstalled = true;
|
|
9
|
+
|
|
10
|
+
// If no error is thrown, the package is installed
|
|
11
|
+
// console.log('calls sdk is installed.');
|
|
12
|
+
|
|
13
|
+
} catch (error) {
|
|
14
|
+
isCallingPackageInstalled = false;
|
|
15
|
+
// If an error is thrown, the package is not installed
|
|
16
|
+
// console.log('calls sdk is not installed.');
|
|
17
|
+
}
|
|
4
18
|
|
|
5
19
|
export const CallingPackage = {
|
|
6
20
|
isCallingPackageInstalled,
|
|
@@ -131,10 +131,10 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface) => {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
const checkActiveCallAndDoAction = () => {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
|
|
135
|
+
setDisableButton(true);
|
|
136
|
+
|
|
137
|
+
return true;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
const makeCall = (type) => {
|
|
@@ -164,17 +164,16 @@ export const CometChatCallButtons = (props: CometChatCallButtonsInterface) => {
|
|
|
164
164
|
})
|
|
165
165
|
customMessage.setCustomData(customData);
|
|
166
166
|
CometChatUIKit.sendCustomMessage(
|
|
167
|
-
customMessage
|
|
168
|
-
(res) => {
|
|
167
|
+
customMessage)
|
|
168
|
+
.then((res) => {
|
|
169
169
|
outGoingCall.current = res as CometChat.CustomMessage
|
|
170
170
|
setShowOutgoingCallScreen(true);
|
|
171
171
|
CometChatUIEventHandler.emitCallEvent(CallUIEvents.ccOutgoingCall, { call: res });
|
|
172
|
-
}
|
|
173
|
-
(rej) => {
|
|
172
|
+
})
|
|
173
|
+
.catch((rej) => {
|
|
174
174
|
console.log("custom msg error", rej);
|
|
175
175
|
onError && onError(rej);
|
|
176
|
-
}
|
|
177
|
-
);
|
|
176
|
+
});
|
|
178
177
|
} else {
|
|
179
178
|
var receiverType = user ? CometChat.RECEIVER_TYPE.USER : group ? CometChat.RECEIVER_TYPE.GROUP : undefined
|
|
180
179
|
if (!receiverID || !receiverType)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { AvatarStyleInterface, CometChatDetailsTemplate, ImageType } from "../../shared"
|
|
2
|
+
import { CometChat } from '@cometchat/chat-sdk-react-native'
|
|
3
|
+
import { CallLogDetailsStyleInterface } from "./CallLogDetailsStyle"
|
|
4
|
+
import { CallLogHistoryConfiguration } from "../CometChatCallLogHistory";
|
|
5
|
+
import { CallLogParticipantsConfiguration } from "../CometChatCallLogParticipants";
|
|
6
|
+
import { CallLogRecordingsConfiguration } from "../CometChatCallLogRecordings/CallLogRecordingsConfiguration";
|
|
7
|
+
|
|
8
|
+
export interface CallLogDetailsConfigurationInterface {
|
|
9
|
+
/**
|
|
10
|
+
* toggle visibility of close button
|
|
11
|
+
*/
|
|
12
|
+
showCloseButton?: boolean,
|
|
13
|
+
/**
|
|
14
|
+
* This will change the close button icon
|
|
15
|
+
*/
|
|
16
|
+
closeButtonIconImage?: ImageType,
|
|
17
|
+
/**
|
|
18
|
+
* toggle the profile view
|
|
19
|
+
*/
|
|
20
|
+
hideProfile?: boolean,
|
|
21
|
+
/**
|
|
22
|
+
* Pass the custom profile view here.
|
|
23
|
+
*/
|
|
24
|
+
CustomProfileView?: (props: { user?: CometChat.User }) => JSX.Element,
|
|
25
|
+
/**
|
|
26
|
+
* List of templates tobe shown
|
|
27
|
+
*/
|
|
28
|
+
data?: (props: { message: CometChat.BaseMessage, user?: CometChat.User, group?: CometChat.Group }) => CometChatDetailsTemplate[],
|
|
29
|
+
/**
|
|
30
|
+
* call back for error
|
|
31
|
+
*/
|
|
32
|
+
onError?: (e: CometChat.CometChatException) => void,
|
|
33
|
+
/**
|
|
34
|
+
* custom functionality on back press
|
|
35
|
+
*/
|
|
36
|
+
onBack?: () => void,
|
|
37
|
+
/**
|
|
38
|
+
* Style object for Avatar
|
|
39
|
+
*/
|
|
40
|
+
avatarStyle?: AvatarStyleInterface,
|
|
41
|
+
/**
|
|
42
|
+
* Style object for CallLogDetails
|
|
43
|
+
*/
|
|
44
|
+
callLogDetailsStyle?: CallLogDetailsStyleInterface,
|
|
45
|
+
/**
|
|
46
|
+
* Configuration for call history.
|
|
47
|
+
*/
|
|
48
|
+
callLogHistoryConfiguration?: CallLogHistoryConfiguration;
|
|
49
|
+
/**
|
|
50
|
+
* Configuration for call log participants.
|
|
51
|
+
*/
|
|
52
|
+
callLogParticipantsConfiguration?: CallLogParticipantsConfiguration;
|
|
53
|
+
/**
|
|
54
|
+
* Configuration for call log recordings.
|
|
55
|
+
*/
|
|
56
|
+
callLogRecordingsConfiguration?: CallLogRecordingsConfiguration;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class CallLogDetailsConfiguration implements CallLogDetailsConfigurationInterface {
|
|
60
|
+
/**
|
|
61
|
+
* toggle visibility of close button
|
|
62
|
+
*/
|
|
63
|
+
showCloseButton?: boolean
|
|
64
|
+
/**
|
|
65
|
+
* This will change the close button icon
|
|
66
|
+
*/
|
|
67
|
+
closeButtonIconImage?: ImageType
|
|
68
|
+
/**
|
|
69
|
+
* toggle the profile view
|
|
70
|
+
*/
|
|
71
|
+
hideProfile?: boolean
|
|
72
|
+
/**
|
|
73
|
+
* Pass the custom profile view here.
|
|
74
|
+
*/
|
|
75
|
+
CustomProfileView?: (props: { user?: CometChat.User }) => JSX.Element
|
|
76
|
+
/**
|
|
77
|
+
* List of templates tobe shown
|
|
78
|
+
*/
|
|
79
|
+
data?: (props: { message: CometChat.BaseMessage; user?: CometChat.User; group?: CometChat.Group }) => CometChatDetailsTemplate[]
|
|
80
|
+
/**
|
|
81
|
+
* call back for error
|
|
82
|
+
*/
|
|
83
|
+
onError?: (e: CometChat.CometChatException) => void
|
|
84
|
+
/**
|
|
85
|
+
* custom functionality on back press
|
|
86
|
+
*/
|
|
87
|
+
onBack?: () => void
|
|
88
|
+
/**
|
|
89
|
+
* Style object for Avatar
|
|
90
|
+
*/
|
|
91
|
+
avatarStyle?: AvatarStyleInterface
|
|
92
|
+
/**
|
|
93
|
+
* Style object for CallLogDetails
|
|
94
|
+
*/
|
|
95
|
+
callLogDetailsStyle?: CallLogDetailsStyleInterface
|
|
96
|
+
/**
|
|
97
|
+
* Configuration for call history.
|
|
98
|
+
*/
|
|
99
|
+
callLogHistoryConfiguration?: CallLogHistoryConfiguration
|
|
100
|
+
/**
|
|
101
|
+
* Configuration for call log participants.
|
|
102
|
+
*/
|
|
103
|
+
callLogParticipantsConfiguration?: CallLogParticipantsConfiguration
|
|
104
|
+
/**
|
|
105
|
+
* Configuration for call log recordings.
|
|
106
|
+
*/
|
|
107
|
+
callLogRecordingsConfiguration?: CallLogRecordingsConfiguration
|
|
108
|
+
|
|
109
|
+
constructor(props: CallLogDetailsConfigurationInterface) {
|
|
110
|
+
if (props) {
|
|
111
|
+
for (const [key, value] of Object.entries(props)) {
|
|
112
|
+
this[key] = value;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BaseStyle, BaseStyleInterface, FontStyleInterface } from "../../shared";
|
|
2
|
+
|
|
3
|
+
export interface CallLogDetailsStyleInterface extends BaseStyleInterface {
|
|
4
|
+
titleFont?: FontStyleInterface,
|
|
5
|
+
titleColor?: string,
|
|
6
|
+
closeIconTint?: string,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class CallLogDetailsStyle extends BaseStyle {
|
|
10
|
+
titleFont?: FontStyleInterface
|
|
11
|
+
titleColor?: string
|
|
12
|
+
closeIconTint?: string
|
|
13
|
+
|
|
14
|
+
constructor({
|
|
15
|
+
titleFont,
|
|
16
|
+
titleColor,
|
|
17
|
+
closeIconTint,
|
|
18
|
+
backgroundColor,
|
|
19
|
+
border,
|
|
20
|
+
borderRadius,
|
|
21
|
+
height,
|
|
22
|
+
width,
|
|
23
|
+
}: CallLogDetailsStyleInterface) {
|
|
24
|
+
super({
|
|
25
|
+
backgroundColor,
|
|
26
|
+
border,
|
|
27
|
+
borderRadius,
|
|
28
|
+
height,
|
|
29
|
+
width,
|
|
30
|
+
});
|
|
31
|
+
this.titleFont = titleFont;
|
|
32
|
+
this.titleColor = titleColor;
|
|
33
|
+
this.closeIconTint = closeIconTint;
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
}
|