rn-erxes-sdk 0.1.22 → 0.1.24
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 +40 -2
- package/lib/commonjs/App.js +41 -21
- package/lib/commonjs/App.js.map +1 -1
- package/lib/commonjs/Widget.js +158 -31
- package/lib/commonjs/Widget.js.map +1 -1
- package/lib/commonjs/components/Avatar.js +24 -27
- package/lib/commonjs/components/Avatar.js.map +1 -1
- package/lib/commonjs/components/AvatarWithStatus.js +56 -0
- package/lib/commonjs/components/AvatarWithStatus.js.map +1 -0
- package/lib/commonjs/components/ConversationItem.js +161 -0
- package/lib/commonjs/components/ConversationItem.js.map +1 -0
- package/lib/commonjs/components/Icons.js +558 -0
- package/lib/commonjs/components/Icons.js.map +1 -0
- package/lib/commonjs/components/InputTools.js +329 -38
- package/lib/commonjs/components/InputTools.js.map +1 -1
- package/lib/commonjs/components/MessengerShell.js +64 -0
- package/lib/commonjs/components/MessengerShell.js.map +1 -0
- package/lib/commonjs/components/conversation/DateSeparator.js +47 -0
- package/lib/commonjs/components/conversation/DateSeparator.js.map +1 -0
- package/lib/commonjs/components/conversation/EmojiPicker.js +62 -0
- package/lib/commonjs/components/conversation/EmojiPicker.js.map +1 -0
- package/lib/commonjs/components/conversation/PersistentMenu.js +64 -0
- package/lib/commonjs/components/conversation/PersistentMenu.js.map +1 -0
- package/lib/commonjs/components/conversation/TypingStatus.js +122 -0
- package/lib/commonjs/components/conversation/TypingStatus.js.map +1 -0
- package/lib/commonjs/components/conversation/WelcomeMessage.js +85 -0
- package/lib/commonjs/components/conversation/WelcomeMessage.js.map +1 -0
- package/lib/commonjs/components/nav/Navigation.js +130 -0
- package/lib/commonjs/components/nav/Navigation.js.map +1 -0
- package/lib/commonjs/components/nav/constants.js +23 -0
- package/lib/commonjs/components/nav/constants.js.map +1 -0
- package/lib/commonjs/graphql/ApolloContainer.js +1 -2
- package/lib/commonjs/graphql/ApolloContainer.js.map +1 -1
- package/lib/commonjs/graphql/mutation.js +58 -23
- package/lib/commonjs/graphql/mutation.js.map +1 -1
- package/lib/commonjs/graphql/query.js +85 -55
- package/lib/commonjs/graphql/query.js.map +1 -1
- package/lib/commonjs/graphql/subscription.js +32 -28
- package/lib/commonjs/graphql/subscription.js.map +1 -1
- package/lib/commonjs/screen/conversation/Attachment.js +77 -12
- package/lib/commonjs/screen/conversation/Attachment.js.map +1 -1
- package/lib/commonjs/screen/conversation/ConversationDetail.js +307 -136
- package/lib/commonjs/screen/conversation/ConversationDetail.js.map +1 -1
- package/lib/commonjs/screen/conversation/Message.js +145 -82
- package/lib/commonjs/screen/conversation/Message.js.map +1 -1
- package/lib/commonjs/screen/faq/Faq.js +373 -0
- package/lib/commonjs/screen/faq/Faq.js.map +1 -0
- package/lib/commonjs/screen/greetings/Social.js +19 -9
- package/lib/commonjs/screen/greetings/Social.js.map +1 -1
- package/lib/commonjs/screen/greetings/Supporters.js +49 -46
- package/lib/commonjs/screen/greetings/Supporters.js.map +1 -1
- package/lib/commonjs/screen/home/Home.js +246 -0
- package/lib/commonjs/screen/home/Home.js.map +1 -0
- package/lib/commonjs/screen/messages/Messages.js +312 -0
- package/lib/commonjs/screen/messages/Messages.js.map +1 -0
- package/lib/commonjs/theme.js +132 -0
- package/lib/commonjs/theme.js.map +1 -0
- package/lib/commonjs/utils/messages.js +93 -0
- package/lib/commonjs/utils/messages.js.map +1 -0
- package/lib/commonjs/utils/onlineHours.js +127 -0
- package/lib/commonjs/utils/onlineHours.js.map +1 -0
- package/lib/commonjs/utils/upload.js +245 -0
- package/lib/commonjs/utils/upload.js.map +1 -0
- package/lib/module/App.js +41 -21
- package/lib/module/App.js.map +1 -1
- package/lib/module/Widget.js +161 -34
- package/lib/module/Widget.js.map +1 -1
- package/lib/module/components/Avatar.js +25 -28
- package/lib/module/components/Avatar.js.map +1 -1
- package/lib/module/components/AvatarWithStatus.js +47 -0
- package/lib/module/components/AvatarWithStatus.js.map +1 -0
- package/lib/module/components/ConversationItem.js +153 -0
- package/lib/module/components/ConversationItem.js.map +1 -0
- package/lib/module/components/Icons.js +537 -0
- package/lib/module/components/Icons.js.map +1 -0
- package/lib/module/components/InputTools.js +331 -39
- package/lib/module/components/InputTools.js.map +1 -1
- package/lib/module/components/MessengerShell.js +55 -0
- package/lib/module/components/MessengerShell.js.map +1 -0
- package/lib/module/components/conversation/DateSeparator.js +40 -0
- package/lib/module/components/conversation/DateSeparator.js.map +1 -0
- package/lib/module/components/conversation/EmojiPicker.js +55 -0
- package/lib/module/components/conversation/EmojiPicker.js.map +1 -0
- package/lib/module/components/conversation/PersistentMenu.js +57 -0
- package/lib/module/components/conversation/PersistentMenu.js.map +1 -0
- package/lib/module/components/conversation/TypingStatus.js +113 -0
- package/lib/module/components/conversation/TypingStatus.js.map +1 -0
- package/lib/module/components/conversation/WelcomeMessage.js +76 -0
- package/lib/module/components/conversation/WelcomeMessage.js.map +1 -0
- package/lib/module/components/nav/Navigation.js +121 -0
- package/lib/module/components/nav/Navigation.js.map +1 -0
- package/lib/module/components/nav/constants.js +16 -0
- package/lib/module/components/nav/constants.js.map +1 -0
- package/lib/module/graphql/ApolloContainer.js +1 -2
- package/lib/module/graphql/ApolloContainer.js.map +1 -1
- package/lib/module/graphql/mutation.js +57 -23
- package/lib/module/graphql/mutation.js.map +1 -1
- package/lib/module/graphql/query.js +83 -52
- package/lib/module/graphql/query.js.map +1 -1
- package/lib/module/graphql/subscription.js +31 -28
- package/lib/module/graphql/subscription.js.map +1 -1
- package/lib/module/screen/conversation/Attachment.js +79 -14
- package/lib/module/screen/conversation/Attachment.js.map +1 -1
- package/lib/module/screen/conversation/ConversationDetail.js +311 -139
- package/lib/module/screen/conversation/ConversationDetail.js.map +1 -1
- package/lib/module/screen/conversation/Message.js +145 -82
- package/lib/module/screen/conversation/Message.js.map +1 -1
- package/lib/module/screen/faq/Faq.js +363 -0
- package/lib/module/screen/faq/Faq.js.map +1 -0
- package/lib/module/screen/greetings/Social.js +19 -9
- package/lib/module/screen/greetings/Social.js.map +1 -1
- package/lib/module/screen/greetings/Supporters.js +50 -46
- package/lib/module/screen/greetings/Supporters.js.map +1 -1
- package/lib/module/screen/home/Home.js +236 -0
- package/lib/module/screen/home/Home.js.map +1 -0
- package/lib/module/screen/messages/Messages.js +303 -0
- package/lib/module/screen/messages/Messages.js.map +1 -0
- package/lib/module/theme.js +122 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/utils/messages.js +81 -0
- package/lib/module/utils/messages.js.map +1 -0
- package/lib/module/utils/onlineHours.js +118 -0
- package/lib/module/utils/onlineHours.js.map +1 -0
- package/lib/module/utils/upload.js +233 -0
- package/lib/module/utils/upload.js.map +1 -0
- package/lib/typescript/App.d.ts +2 -1
- package/lib/typescript/App.d.ts.map +1 -1
- package/lib/typescript/Widget.d.ts.map +1 -1
- package/lib/typescript/components/Avatar.d.ts +7 -1
- package/lib/typescript/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/AvatarWithStatus.d.ts +11 -0
- package/lib/typescript/components/AvatarWithStatus.d.ts.map +1 -0
- package/lib/typescript/components/ConversationItem.d.ts +9 -0
- package/lib/typescript/components/ConversationItem.d.ts.map +1 -0
- package/lib/typescript/components/Icons.d.ts +33 -0
- package/lib/typescript/components/Icons.d.ts.map +1 -0
- package/lib/typescript/components/InputTools.d.ts.map +1 -1
- package/lib/typescript/components/MessengerShell.d.ts +4 -0
- package/lib/typescript/components/MessengerShell.d.ts.map +1 -0
- package/lib/typescript/components/conversation/DateSeparator.d.ts +6 -0
- package/lib/typescript/components/conversation/DateSeparator.d.ts.map +1 -0
- package/lib/typescript/components/conversation/EmojiPicker.d.ts +7 -0
- package/lib/typescript/components/conversation/EmojiPicker.d.ts.map +1 -0
- package/lib/typescript/components/conversation/PersistentMenu.d.ts +13 -0
- package/lib/typescript/components/conversation/PersistentMenu.d.ts.map +1 -0
- package/lib/typescript/components/conversation/TypingStatus.d.ts +4 -0
- package/lib/typescript/components/conversation/TypingStatus.d.ts.map +1 -0
- package/lib/typescript/components/conversation/WelcomeMessage.d.ts +6 -0
- package/lib/typescript/components/conversation/WelcomeMessage.d.ts.map +1 -0
- package/lib/typescript/components/nav/Navigation.d.ts +12 -0
- package/lib/typescript/components/nav/Navigation.d.ts.map +1 -0
- package/lib/typescript/components/nav/constants.d.ts +7 -0
- package/lib/typescript/components/nav/constants.d.ts.map +1 -0
- package/lib/typescript/graphql/ApolloContainer.d.ts.map +1 -1
- package/lib/typescript/graphql/mutation.d.ts +2 -1
- package/lib/typescript/graphql/mutation.d.ts.map +1 -1
- package/lib/typescript/graphql/query.d.ts +2 -3
- package/lib/typescript/graphql/query.d.ts.map +1 -1
- package/lib/typescript/graphql/subscription.d.ts +2 -1
- package/lib/typescript/graphql/subscription.d.ts.map +1 -1
- package/lib/typescript/screen/conversation/Attachment.d.ts.map +1 -1
- package/lib/typescript/screen/conversation/ConversationDetail.d.ts.map +1 -1
- package/lib/typescript/screen/conversation/Message.d.ts.map +1 -1
- package/lib/typescript/screen/faq/Faq.d.ts +4 -0
- package/lib/typescript/screen/faq/Faq.d.ts.map +1 -0
- package/lib/typescript/screen/greetings/Social.d.ts +1 -1
- package/lib/typescript/screen/greetings/Social.d.ts.map +1 -1
- package/lib/typescript/screen/greetings/Supporters.d.ts.map +1 -1
- package/lib/typescript/screen/home/Home.d.ts +4 -0
- package/lib/typescript/screen/home/Home.d.ts.map +1 -0
- package/lib/typescript/screen/messages/Messages.d.ts +4 -0
- package/lib/typescript/screen/messages/Messages.d.ts.map +1 -0
- package/lib/typescript/theme.d.ts +93 -0
- package/lib/typescript/theme.d.ts.map +1 -0
- package/lib/typescript/utils/messages.d.ts +27 -0
- package/lib/typescript/utils/messages.d.ts.map +1 -0
- package/lib/typescript/utils/onlineHours.d.ts +19 -0
- package/lib/typescript/utils/onlineHours.d.ts.map +1 -0
- package/lib/typescript/utils/upload.d.ts +32 -0
- package/lib/typescript/utils/upload.d.ts.map +1 -0
- package/package.json +25 -21
- package/src/App.tsx +48 -24
- package/src/Widget.tsx +214 -40
- package/src/components/Avatar.tsx +30 -30
- package/src/components/AvatarWithStatus.tsx +63 -0
- package/src/components/ConversationItem.tsx +199 -0
- package/src/components/Icons.tsx +532 -0
- package/src/components/InputTools.tsx +387 -48
- package/src/components/MessengerShell.tsx +58 -0
- package/src/components/conversation/DateSeparator.tsx +36 -0
- package/src/components/conversation/EmojiPicker.tsx +111 -0
- package/src/components/conversation/PersistentMenu.tsx +74 -0
- package/src/components/conversation/TypingStatus.tsx +112 -0
- package/src/components/conversation/WelcomeMessage.tsx +70 -0
- package/src/components/nav/Navigation.tsx +137 -0
- package/src/components/nav/constants.ts +16 -0
- package/src/graphql/ApolloContainer.tsx +0 -1
- package/src/graphql/mutation.ts +58 -22
- package/src/graphql/query.ts +83 -55
- package/src/graphql/subscription.ts +31 -27
- package/src/screen/conversation/Attachment.tsx +123 -33
- package/src/screen/conversation/ConversationDetail.tsx +367 -134
- package/src/screen/conversation/Message.tsx +160 -98
- package/src/screen/faq/Faq.tsx +425 -0
- package/src/screen/greetings/Social.tsx +18 -4
- package/src/screen/greetings/Supporters.tsx +56 -41
- package/src/screen/home/Home.tsx +276 -0
- package/src/screen/messages/Messages.tsx +331 -0
- package/src/theme.ts +104 -0
- package/src/utils/messages.ts +105 -0
- package/src/utils/onlineHours.ts +167 -0
- package/src/utils/upload.ts +326 -0
- package/lib/commonjs/components/FAB.js +0 -51
- package/lib/commonjs/components/FAB.js.map +0 -1
- package/lib/commonjs/screen/conversation/Conversations.js +0 -158
- package/lib/commonjs/screen/conversation/Conversations.js.map +0 -1
- package/lib/commonjs/screen/greetings/Greetings.js +0 -96
- package/lib/commonjs/screen/greetings/Greetings.js.map +0 -1
- package/lib/module/components/FAB.js +0 -42
- package/lib/module/components/FAB.js.map +0 -1
- package/lib/module/screen/conversation/Conversations.js +0 -147
- package/lib/module/screen/conversation/Conversations.js.map +0 -1
- package/lib/module/screen/greetings/Greetings.js +0 -85
- package/lib/module/screen/greetings/Greetings.js.map +0 -1
- package/lib/typescript/components/FAB.d.ts +0 -16
- package/lib/typescript/components/FAB.d.ts.map +0 -1
- package/lib/typescript/screen/conversation/Conversations.d.ts +0 -4
- package/lib/typescript/screen/conversation/Conversations.d.ts.map +0 -1
- package/lib/typescript/screen/greetings/Greetings.d.ts +0 -4
- package/lib/typescript/screen/greetings/Greetings.d.ts.map +0 -1
- package/src/components/FAB.tsx +0 -69
- package/src/screen/conversation/Conversations.tsx +0 -148
- package/src/screen/greetings/Greetings.tsx +0 -98
|
@@ -13,14 +13,66 @@ var _InputTools = _interopRequireDefault(require("../../components/InputTools"))
|
|
|
13
13
|
var _mutation = require("../../graphql/mutation");
|
|
14
14
|
var _subscription = require("../../graphql/subscription");
|
|
15
15
|
var _utils = require("../../utils/utils");
|
|
16
|
+
var _messages = require("../../utils/messages");
|
|
16
17
|
var _Context = _interopRequireDefault(require("../../context/Context"));
|
|
18
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
19
|
+
var _theme = require("../../theme");
|
|
20
|
+
var _Icons = require("../../components/Icons");
|
|
21
|
+
var _DateSeparator = _interopRequireDefault(require("../../components/conversation/DateSeparator"));
|
|
22
|
+
var _WelcomeMessage = _interopRequireDefault(require("../../components/conversation/WelcomeMessage"));
|
|
23
|
+
var _TypingStatus = _interopRequireDefault(require("../../components/conversation/TypingStatus"));
|
|
17
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
25
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
const hasUserDetails = user => {
|
|
28
|
+
var _user$details, _user$details2;
|
|
29
|
+
return Boolean((user === null || user === void 0 ? void 0 : (_user$details = user.details) === null || _user$details === void 0 ? void 0 : _user$details.fullName) || (user === null || user === void 0 ? void 0 : (_user$details2 = user.details) === null || _user$details2 === void 0 ? void 0 : _user$details2.avatar));
|
|
30
|
+
};
|
|
31
|
+
const mergeUserDetails = (baseUser, incomingUser) => {
|
|
32
|
+
if (!baseUser && !incomingUser) {
|
|
33
|
+
return incomingUser;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
...(baseUser || {}),
|
|
37
|
+
...(incomingUser || {}),
|
|
38
|
+
details: {
|
|
39
|
+
...((baseUser === null || baseUser === void 0 ? void 0 : baseUser.details) || {}),
|
|
40
|
+
...((incomingUser === null || incomingUser === void 0 ? void 0 : incomingUser.details) || {})
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const hydrateIncomingMessageUser = (message, participants) => {
|
|
45
|
+
if (message !== null && message !== void 0 && message.customerId || hasUserDetails(message === null || message === void 0 ? void 0 : message.user)) {
|
|
46
|
+
return message;
|
|
47
|
+
}
|
|
48
|
+
const participant = participants.find(user => {
|
|
49
|
+
var _message$user;
|
|
50
|
+
return (user === null || user === void 0 ? void 0 : user._id) === (message === null || message === void 0 ? void 0 : (_message$user = message.user) === null || _message$user === void 0 ? void 0 : _message$user._id);
|
|
51
|
+
}) || (participants.length === 1 ? participants[0] : null);
|
|
52
|
+
if (!participant) {
|
|
53
|
+
return message;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...message,
|
|
57
|
+
user: mergeUserDetails(participant, message === null || message === void 0 ? void 0 : message.user)
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const mergeParticipantFromMessage = (participants, message) => {
|
|
61
|
+
if (message !== null && message !== void 0 && message.customerId) {
|
|
62
|
+
return participants;
|
|
63
|
+
}
|
|
64
|
+
const incomingUser = message === null || message === void 0 ? void 0 : message.user;
|
|
65
|
+
if (!(incomingUser !== null && incomingUser !== void 0 && incomingUser._id) || !hasUserDetails(incomingUser)) {
|
|
66
|
+
return participants;
|
|
67
|
+
}
|
|
68
|
+
const existingParticipant = participants.find(user => (user === null || user === void 0 ? void 0 : user._id) === incomingUser._id);
|
|
69
|
+
if (!existingParticipant) {
|
|
70
|
+
return [...participants, incomingUser];
|
|
71
|
+
}
|
|
72
|
+
return participants.map(user => (user === null || user === void 0 ? void 0 : user._id) === incomingUser._id ? mergeUserDetails(user, incomingUser) : user);
|
|
73
|
+
};
|
|
22
74
|
const ConversationDetail = () => {
|
|
23
|
-
var _data$
|
|
75
|
+
var _data$widgetsConversa7, _data$widgetsConversa8, _data$widgetsConversa9;
|
|
24
76
|
const value = (0, _react.useContext)(_Context.default);
|
|
25
77
|
const {
|
|
26
78
|
brand,
|
|
@@ -29,16 +81,23 @@ const ConversationDetail = () => {
|
|
|
29
81
|
integrationId,
|
|
30
82
|
customerId,
|
|
31
83
|
visitorId,
|
|
84
|
+
greetings,
|
|
85
|
+
setConversationId,
|
|
86
|
+
markConversationRead,
|
|
32
87
|
//
|
|
33
|
-
backIcon,
|
|
34
88
|
sendIcon,
|
|
35
89
|
//
|
|
36
90
|
subDomain
|
|
37
91
|
} = value;
|
|
38
92
|
const [messages, setMessages] = _react.default.useState([]);
|
|
93
|
+
const [isBotTyping, setIsBotTyping] = (0, _react.useState)(false);
|
|
94
|
+
const [sending, setSending] = (0, _react.useState)(false);
|
|
95
|
+
const sendingRef = _react.default.useRef(false);
|
|
96
|
+
const client = (0, _client.useApolloClient)();
|
|
39
97
|
const {
|
|
40
98
|
data,
|
|
41
99
|
loading,
|
|
100
|
+
refetch,
|
|
42
101
|
subscribeToMore
|
|
43
102
|
} = (0, _client.useQuery)(_query.widgetsConversationDetail, {
|
|
44
103
|
variables: {
|
|
@@ -49,6 +108,9 @@ const ConversationDetail = () => {
|
|
|
49
108
|
skip: !conversationId
|
|
50
109
|
});
|
|
51
110
|
(0, _react.useEffect)(() => {
|
|
111
|
+
if (!conversationId) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
52
114
|
const unSubsToMore = subscribeToMore({
|
|
53
115
|
document: _subscription.conversationMessageInserted,
|
|
54
116
|
variables: {
|
|
@@ -58,248 +120,357 @@ const ConversationDetail = () => {
|
|
|
58
120
|
let {
|
|
59
121
|
subscriptionData
|
|
60
122
|
} = _ref;
|
|
123
|
+
if (!prev || !subscriptionData.data) {
|
|
124
|
+
return prev;
|
|
125
|
+
}
|
|
61
126
|
const message = subscriptionData.data.conversationMessageInserted;
|
|
127
|
+
if (!message) {
|
|
128
|
+
return prev;
|
|
129
|
+
}
|
|
62
130
|
const tempWidgetsConversationDetail = prev.widgetsConversationDetail || {};
|
|
63
131
|
const tempMessages = (tempWidgetsConversationDetail === null || tempWidgetsConversationDetail === void 0 ? void 0 : tempWidgetsConversationDetail.messages) || [];
|
|
132
|
+
const tempParticipants = (tempWidgetsConversationDetail === null || tempWidgetsConversationDetail === void 0 ? void 0 : tempWidgetsConversationDetail.participatedUsers) || [];
|
|
133
|
+
const existingParticipant = tempParticipants.find(user => {
|
|
134
|
+
var _message$user2;
|
|
135
|
+
return (user === null || user === void 0 ? void 0 : user._id) === (message === null || message === void 0 ? void 0 : (_message$user2 = message.user) === null || _message$user2 === void 0 ? void 0 : _message$user2._id);
|
|
136
|
+
});
|
|
137
|
+
const messageUser = mergeUserDetails(existingParticipant, message === null || message === void 0 ? void 0 : message.user);
|
|
138
|
+
const hydratedMessage = {
|
|
139
|
+
...message,
|
|
140
|
+
user: messageUser
|
|
141
|
+
};
|
|
142
|
+
if (!message.customerId && !hasUserDetails(messageUser)) {
|
|
143
|
+
setTimeout(() => refetch(), 0);
|
|
144
|
+
}
|
|
145
|
+
const nextParticipants = mergeParticipantFromMessage(tempParticipants, hydratedMessage);
|
|
64
146
|
|
|
65
147
|
// check whether or not already inserted
|
|
66
|
-
const prevEntry = tempMessages.find(m => m._id === (
|
|
148
|
+
const prevEntry = tempMessages.find(m => m._id === (hydratedMessage === null || hydratedMessage === void 0 ? void 0 : hydratedMessage._id));
|
|
67
149
|
if (prevEntry) {
|
|
68
|
-
return
|
|
150
|
+
return {
|
|
151
|
+
...prev,
|
|
152
|
+
widgetsConversationDetail: {
|
|
153
|
+
...tempWidgetsConversationDetail,
|
|
154
|
+
participatedUsers: nextParticipants
|
|
155
|
+
}
|
|
156
|
+
};
|
|
69
157
|
}
|
|
70
158
|
|
|
71
159
|
// do not show internal or bot messages
|
|
72
|
-
if (
|
|
160
|
+
if (hydratedMessage.internal || hydratedMessage.fromBot) {
|
|
73
161
|
return prev;
|
|
74
162
|
}
|
|
163
|
+
if (!hydratedMessage.customerId) {
|
|
164
|
+
setTimeout(() => markConversationRead === null || markConversationRead === void 0 ? void 0 : markConversationRead(conversationId), 0);
|
|
165
|
+
}
|
|
75
166
|
|
|
76
167
|
// add new message to messages list
|
|
77
168
|
const next = {
|
|
78
169
|
...prev,
|
|
79
170
|
widgetsConversationDetail: {
|
|
80
171
|
...tempWidgetsConversationDetail,
|
|
81
|
-
messages: [...tempMessages,
|
|
172
|
+
messages: [...tempMessages, hydratedMessage],
|
|
173
|
+
participatedUsers: nextParticipants
|
|
82
174
|
}
|
|
83
175
|
};
|
|
84
176
|
return next;
|
|
85
177
|
}
|
|
86
178
|
});
|
|
87
179
|
return () => {
|
|
88
|
-
unSubsToMore;
|
|
180
|
+
unSubsToMore();
|
|
89
181
|
};
|
|
90
|
-
}, [conversationId, subscribeToMore]);
|
|
182
|
+
}, [conversationId, markConversationRead, refetch, subscribeToMore]);
|
|
91
183
|
(0, _react.useEffect)(() => {
|
|
92
184
|
var _data$widgetsConversa;
|
|
93
185
|
if (data !== null && data !== void 0 && (_data$widgetsConversa = data.widgetsConversationDetail) !== null && _data$widgetsConversa !== void 0 && _data$widgetsConversa.messages) {
|
|
94
|
-
var _data$widgetsConversa2, _data$widgetsConversa3, _data$widgetsConversa4;
|
|
95
|
-
|
|
186
|
+
var _data$widgetsConversa2, _data$widgetsConversa3, _data$widgetsConversa4, _data$widgetsConversa5, _data$widgetsConversa6;
|
|
187
|
+
const participants = (data === null || data === void 0 ? void 0 : (_data$widgetsConversa2 = data.widgetsConversationDetail) === null || _data$widgetsConversa2 === void 0 ? void 0 : _data$widgetsConversa2.participatedUsers) || [];
|
|
188
|
+
let reversed = data === null || data === void 0 ? void 0 : (_data$widgetsConversa3 = data.widgetsConversationDetail) === null || _data$widgetsConversa3 === void 0 ? void 0 : (_data$widgetsConversa4 = _data$widgetsConversa3.messages) === null || _data$widgetsConversa4 === void 0 ? void 0 : (_data$widgetsConversa5 = _data$widgetsConversa4.slice()) === null || _data$widgetsConversa5 === void 0 ? void 0 : (_data$widgetsConversa6 = _data$widgetsConversa5.reverse()) === null || _data$widgetsConversa6 === void 0 ? void 0 : _data$widgetsConversa6.map(message => hydrateIncomingMessageUser(message, participants));
|
|
96
189
|
setMessages(reversed);
|
|
97
190
|
}
|
|
98
191
|
}, [data]);
|
|
192
|
+
|
|
193
|
+
// Bot typing indicator — ported from the web messenger useConversationDetail.
|
|
194
|
+
(0, _react.useEffect)(() => {
|
|
195
|
+
if (!conversationId) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const subscription = client.subscribe({
|
|
199
|
+
query: _subscription.conversationBotTypingStatus,
|
|
200
|
+
variables: {
|
|
201
|
+
_id: conversationId
|
|
202
|
+
},
|
|
203
|
+
fetchPolicy: 'network-only'
|
|
204
|
+
}).subscribe({
|
|
205
|
+
next(_ref2) {
|
|
206
|
+
let {
|
|
207
|
+
data: typing
|
|
208
|
+
} = _ref2;
|
|
209
|
+
const status = typing === null || typing === void 0 ? void 0 : typing.conversationBotTypingStatus;
|
|
210
|
+
setIsBotTyping(typeof status === 'object' && status !== null ? Boolean(status.typing) : Boolean(status));
|
|
211
|
+
},
|
|
212
|
+
error() {
|
|
213
|
+
setIsBotTyping(false);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return () => subscription.unsubscribe();
|
|
217
|
+
}, [conversationId, client]);
|
|
218
|
+
|
|
219
|
+
// Build grouped rows (welcome → date separators → grouped messages) in
|
|
220
|
+
// chronological order, then reverse for the inverted FlatList.
|
|
221
|
+
const invertedRows = (0, _react.useMemo)(() => {
|
|
222
|
+
var _greetings$messages;
|
|
223
|
+
const chronological = [...messages].reverse();
|
|
224
|
+
const rows = (0, _messages.buildChatRows)(chronological, greetings === null || greetings === void 0 ? void 0 : (_greetings$messages = greetings.messages) === null || _greetings$messages === void 0 ? void 0 : _greetings$messages.welcome);
|
|
225
|
+
return [...rows].reverse();
|
|
226
|
+
}, [messages, greetings]);
|
|
99
227
|
const [sendMutation] = (0, _client.useMutation)(_mutation.widgetsInsertMessage);
|
|
100
|
-
|
|
228
|
+
(0, _react.useEffect)(() => {
|
|
229
|
+
if (!conversationId) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
markConversationRead === null || markConversationRead === void 0 ? void 0 : markConversationRead(conversationId);
|
|
233
|
+
}, [conversationId, markConversationRead]);
|
|
234
|
+
const onSend = (text, attachments) => {
|
|
235
|
+
if (sendingRef.current) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
sendingRef.current = true;
|
|
239
|
+
setSending(true);
|
|
101
240
|
sendMutation({
|
|
102
241
|
variables: {
|
|
103
242
|
integrationId,
|
|
104
243
|
customerId,
|
|
105
244
|
visitorId,
|
|
106
|
-
conversationId,
|
|
245
|
+
conversationId: conversationId || null,
|
|
107
246
|
contentType: 'text',
|
|
108
|
-
message: text
|
|
247
|
+
message: text,
|
|
248
|
+
attachments: attachments && attachments.length > 0 ? attachments : undefined
|
|
109
249
|
}
|
|
110
250
|
}).then(res => {
|
|
111
251
|
if (res.errors) {
|
|
112
252
|
return console.log(res.errors);
|
|
113
253
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const newArray = [res.data.widgetsInsertMessage, ...messages];
|
|
121
|
-
setMessages(newArray);
|
|
254
|
+
const insertedMessage = res.data.widgetsInsertMessage;
|
|
255
|
+
if (insertedMessage) {
|
|
256
|
+
const nextConversationId = insertedMessage.conversationId;
|
|
257
|
+
if (nextConversationId && nextConversationId !== conversationId) {
|
|
258
|
+
_asyncStorage.default.setItem('conversationId', nextConversationId);
|
|
259
|
+
setConversationId(nextConversationId);
|
|
122
260
|
}
|
|
261
|
+
setMessages(prevMessages => {
|
|
262
|
+
const alreadyExists = prevMessages.some(message => message._id === insertedMessage._id);
|
|
263
|
+
return alreadyExists ? prevMessages : [insertedMessage, ...prevMessages];
|
|
264
|
+
});
|
|
123
265
|
}
|
|
124
266
|
}).catch(err => {
|
|
125
267
|
console.log(err);
|
|
268
|
+
}).finally(() => {
|
|
269
|
+
sendingRef.current = false;
|
|
270
|
+
setSending(false);
|
|
126
271
|
});
|
|
127
272
|
};
|
|
128
273
|
if (loading) {
|
|
129
274
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
130
|
-
style:
|
|
131
|
-
flex: 1,
|
|
132
|
-
alignItems: 'center',
|
|
133
|
-
justifyContent: 'center'
|
|
134
|
-
}
|
|
275
|
+
style: styles.fullCenter
|
|
135
276
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
136
|
-
color:
|
|
277
|
+
color: bgColor,
|
|
137
278
|
size: 'large'
|
|
138
279
|
}));
|
|
139
280
|
}
|
|
140
|
-
const renderItem =
|
|
281
|
+
const renderItem = _ref3 => {
|
|
141
282
|
let {
|
|
142
283
|
item
|
|
143
|
-
} =
|
|
284
|
+
} = _ref3;
|
|
285
|
+
if (item.type === 'welcome') {
|
|
286
|
+
return /*#__PURE__*/_react.default.createElement(_WelcomeMessage.default, {
|
|
287
|
+
content: item.content
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
if (item.type === 'date') {
|
|
291
|
+
return /*#__PURE__*/_react.default.createElement(_DateSeparator.default, {
|
|
292
|
+
label: item.label
|
|
293
|
+
});
|
|
294
|
+
}
|
|
144
295
|
return /*#__PURE__*/_react.default.createElement(_Message.default, {
|
|
145
|
-
item: item,
|
|
146
|
-
bgColor: bgColor
|
|
296
|
+
item: item.item,
|
|
297
|
+
bgColor: bgColor,
|
|
298
|
+
isFirstInGroup: item.isFirstInGroup,
|
|
299
|
+
isLastInGroup: item.isLastInGroup
|
|
147
300
|
});
|
|
148
301
|
};
|
|
149
302
|
const renderContent = () => {
|
|
150
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
151
|
-
|
|
152
|
-
flex: 1
|
|
153
|
-
}
|
|
303
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
304
|
+
onPress: () => _reactNative.Keyboard.dismiss()
|
|
154
305
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.FlatList, {
|
|
155
306
|
contentContainerStyle: styles.contentStyle,
|
|
156
307
|
showsVerticalScrollIndicator: false,
|
|
157
|
-
data:
|
|
158
|
-
keyExtractor: item => item.
|
|
308
|
+
data: invertedRows,
|
|
309
|
+
keyExtractor: item => item.id,
|
|
159
310
|
onEndReachedThreshold: 0.2,
|
|
160
311
|
renderItem: renderItem,
|
|
161
312
|
ItemSeparatorComponent: () => null,
|
|
313
|
+
keyboardShouldPersistTaps: "handled",
|
|
162
314
|
inverted: true
|
|
163
315
|
}));
|
|
164
316
|
};
|
|
165
317
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
166
|
-
style:
|
|
167
|
-
flex: 1
|
|
168
|
-
}
|
|
318
|
+
style: styles.root
|
|
169
319
|
}, /*#__PURE__*/_react.default.createElement(Header, {
|
|
170
320
|
brand: brand,
|
|
171
321
|
bgColor: bgColor,
|
|
172
|
-
users: data === null || data === void 0 ? void 0 : (_data$
|
|
173
|
-
|
|
322
|
+
users: data === null || data === void 0 ? void 0 : (_data$widgetsConversa7 = data.widgetsConversationDetail) === null || _data$widgetsConversa7 === void 0 ? void 0 : _data$widgetsConversa7.participatedUsers,
|
|
323
|
+
isOnline: data === null || data === void 0 ? void 0 : (_data$widgetsConversa8 = data.widgetsConversationDetail) === null || _data$widgetsConversa8 === void 0 ? void 0 : _data$widgetsConversa8.isOnline,
|
|
174
324
|
subDomain: subDomain
|
|
175
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
176
|
-
style:
|
|
177
|
-
backgroundColor: 'rgba(215,215,215,.7)',
|
|
178
|
-
flex: 1
|
|
179
|
-
}
|
|
180
|
-
}, renderContent(), /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
|
|
325
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
|
|
326
|
+
style: styles.chatArea,
|
|
181
327
|
behavior: _reactNative.Platform.OS === 'ios' ? 'padding' : undefined,
|
|
182
|
-
keyboardVerticalOffset:
|
|
183
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
184
|
-
|
|
185
|
-
}, /*#__PURE__*/_react.default.createElement(_InputTools.default, {
|
|
328
|
+
keyboardVerticalOffset: _reactNative.Platform.OS === 'ios' ? 0 : 0
|
|
329
|
+
}, renderContent(), isBotTyping ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
330
|
+
style: styles.typingWrap
|
|
331
|
+
}, /*#__PURE__*/_react.default.createElement(_TypingStatus.default, null)) : null, /*#__PURE__*/_react.default.createElement(_InputTools.default, {
|
|
186
332
|
onSend: onSend,
|
|
187
333
|
bgColor: bgColor,
|
|
188
|
-
sendIcon: sendIcon
|
|
189
|
-
|
|
334
|
+
sendIcon: sendIcon,
|
|
335
|
+
subDomain: subDomain,
|
|
336
|
+
sending: sending,
|
|
337
|
+
persistentMenus: (data === null || data === void 0 ? void 0 : (_data$widgetsConversa9 = data.widgetsConversationDetail) === null || _data$widgetsConversa9 === void 0 ? void 0 : _data$widgetsConversa9.persistentMenus) || (greetings === null || greetings === void 0 ? void 0 : greetings.persistentMenus)
|
|
338
|
+
})));
|
|
190
339
|
};
|
|
191
340
|
var _default = ConversationDetail;
|
|
192
341
|
exports.default = _default;
|
|
193
342
|
const Header = props => {
|
|
343
|
+
var _agent$details, _agent$details2;
|
|
194
344
|
const {
|
|
195
345
|
brand,
|
|
196
346
|
bgColor,
|
|
197
347
|
users,
|
|
198
|
-
|
|
348
|
+
isOnline,
|
|
199
349
|
subDomain
|
|
200
350
|
} = props;
|
|
201
351
|
const value = (0, _react.useContext)(_Context.default);
|
|
202
352
|
const {
|
|
203
353
|
setConversationId
|
|
204
354
|
} = value;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
};
|
|
213
|
-
} else {
|
|
214
|
-
source = require('../../assets/images/avatar.png');
|
|
215
|
-
}
|
|
216
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
217
|
-
style: {
|
|
218
|
-
backgroundColor: bgColor
|
|
219
|
-
}
|
|
220
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
221
|
-
style: {
|
|
222
|
-
flexDirection: 'row',
|
|
223
|
-
alignItems: 'center',
|
|
224
|
-
paddingBottom: 20
|
|
225
|
-
}
|
|
226
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
227
|
-
onPress: () => {
|
|
228
|
-
setConversationId(null);
|
|
229
|
-
},
|
|
230
|
-
style: [styles.backStyle, {
|
|
231
|
-
backgroundColor: '#2F1F69'
|
|
232
|
-
}]
|
|
233
|
-
}, backIcon), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
234
|
-
style: [styles.title, {
|
|
235
|
-
marginLeft: 10,
|
|
236
|
-
alignItems: 'center',
|
|
237
|
-
flex: 1
|
|
238
|
-
}]
|
|
239
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
240
|
-
source: source,
|
|
241
|
-
style: styles.avatar,
|
|
242
|
-
resizeMode: "stretch"
|
|
243
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
244
|
-
style: {
|
|
245
|
-
marginLeft: 10
|
|
246
|
-
}
|
|
247
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
248
|
-
style: {
|
|
249
|
-
fontWeight: '600'
|
|
250
|
-
}
|
|
251
|
-
}, (_users$3 = users[0]) === null || _users$3 === void 0 ? void 0 : (_users$3$details = _users$3.details) === null || _users$3$details === void 0 ? void 0 : _users$3$details.fullName)))));
|
|
252
|
-
}
|
|
355
|
+
const agent = (users === null || users === void 0 ? void 0 : users.length) > 0 ? users[0] : null;
|
|
356
|
+
const title = (agent === null || agent === void 0 ? void 0 : (_agent$details = agent.details) === null || _agent$details === void 0 ? void 0 : _agent$details.fullName) || (brand === null || brand === void 0 ? void 0 : brand.name) || 'Support';
|
|
357
|
+
const subtitle = agent ? 'usually replies in a few minutes' : null;
|
|
358
|
+
const avatarSource = agent !== null && agent !== void 0 && (_agent$details2 = agent.details) !== null && _agent$details2 !== void 0 && _agent$details2.avatar ? {
|
|
359
|
+
uri: (0, _utils.getAttachmentUrl)(agent.details.avatar, subDomain)
|
|
360
|
+
} : require('../../assets/images/avatar.png');
|
|
361
|
+
const androidTop = _reactNative.Platform.OS === 'android' ? _reactNative.StatusBar.currentHeight || 0 : 0;
|
|
253
362
|
return /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
254
363
|
style: {
|
|
255
364
|
backgroundColor: bgColor
|
|
256
365
|
}
|
|
257
366
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
258
|
-
style: {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
paddingBottom: 20
|
|
262
|
-
}
|
|
367
|
+
style: [styles.header, {
|
|
368
|
+
paddingTop: androidTop + 6
|
|
369
|
+
}]
|
|
263
370
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
264
371
|
onPress: () => {
|
|
372
|
+
_asyncStorage.default.removeItem('conversationId');
|
|
265
373
|
setConversationId(null);
|
|
266
374
|
},
|
|
267
|
-
style:
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
style: {
|
|
274
|
-
fontWeight: '600',
|
|
275
|
-
fontSize: 16
|
|
375
|
+
style: styles.backButton,
|
|
376
|
+
hitSlop: {
|
|
377
|
+
top: 8,
|
|
378
|
+
bottom: 8,
|
|
379
|
+
left: 8,
|
|
380
|
+
right: 8
|
|
276
381
|
}
|
|
277
|
-
},
|
|
382
|
+
}, /*#__PURE__*/_react.default.createElement(_Icons.BackIcon, {
|
|
383
|
+
color: _theme.messengerTheme.colors.primaryForeground,
|
|
384
|
+
size: 18
|
|
385
|
+
})), agent ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
386
|
+
style: styles.avatarWrap
|
|
387
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
388
|
+
source: avatarSource,
|
|
389
|
+
style: styles.avatar,
|
|
390
|
+
resizeMode: "cover"
|
|
391
|
+
}), isOnline ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
392
|
+
style: styles.onlineDot
|
|
393
|
+
}) : null) : null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
394
|
+
style: styles.headerTextWrap
|
|
395
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
396
|
+
numberOfLines: 1,
|
|
397
|
+
style: styles.headerTitle
|
|
398
|
+
}, title), subtitle ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
399
|
+
numberOfLines: 1,
|
|
400
|
+
style: styles.headerSubtitle
|
|
401
|
+
}, subtitle) : null)));
|
|
278
402
|
};
|
|
279
403
|
const styles = _reactNative.StyleSheet.create({
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
404
|
+
root: {
|
|
405
|
+
flex: 1,
|
|
406
|
+
backgroundColor: _theme.messengerTheme.colors.background
|
|
407
|
+
},
|
|
408
|
+
chatArea: {
|
|
409
|
+
flex: 1,
|
|
410
|
+
backgroundColor: _theme.messengerTheme.colors.background
|
|
287
411
|
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
flexDirection: 'row'
|
|
412
|
+
fullCenter: {
|
|
413
|
+
flex: 1,
|
|
414
|
+
alignItems: 'center',
|
|
415
|
+
justifyContent: 'center',
|
|
416
|
+
backgroundColor: _theme.messengerTheme.colors.background
|
|
294
417
|
},
|
|
295
418
|
contentStyle: {
|
|
296
419
|
flexGrow: 1,
|
|
297
|
-
|
|
420
|
+
paddingHorizontal: _theme.messengerTheme.spacing.lg,
|
|
421
|
+
paddingVertical: _theme.messengerTheme.spacing.md
|
|
298
422
|
},
|
|
299
|
-
|
|
423
|
+
typingWrap: {
|
|
424
|
+
paddingHorizontal: _theme.messengerTheme.spacing.lg,
|
|
425
|
+
paddingBottom: _theme.messengerTheme.spacing.xs
|
|
426
|
+
},
|
|
427
|
+
header: {
|
|
428
|
+
flexDirection: 'row',
|
|
429
|
+
alignItems: 'center',
|
|
430
|
+
paddingHorizontal: _theme.messengerTheme.spacing.md,
|
|
431
|
+
paddingBottom: _theme.messengerTheme.spacing.md,
|
|
432
|
+
paddingTop: 6
|
|
433
|
+
},
|
|
434
|
+
backButton: {
|
|
300
435
|
width: 40,
|
|
301
436
|
height: 40,
|
|
302
|
-
borderRadius:
|
|
437
|
+
borderRadius: 20,
|
|
438
|
+
justifyContent: 'center',
|
|
439
|
+
alignItems: 'center',
|
|
440
|
+
backgroundColor: 'rgba(255,255,255,0.16)'
|
|
441
|
+
},
|
|
442
|
+
avatarWrap: {
|
|
443
|
+
marginLeft: _theme.messengerTheme.spacing.md
|
|
444
|
+
},
|
|
445
|
+
avatar: {
|
|
446
|
+
width: 36,
|
|
447
|
+
height: 36,
|
|
448
|
+
borderRadius: 18
|
|
449
|
+
},
|
|
450
|
+
onlineDot: {
|
|
451
|
+
position: 'absolute',
|
|
452
|
+
right: 0,
|
|
453
|
+
bottom: 0,
|
|
454
|
+
width: 11,
|
|
455
|
+
height: 11,
|
|
456
|
+
borderRadius: 6,
|
|
457
|
+
backgroundColor: _theme.messengerTheme.colors.online,
|
|
458
|
+
borderWidth: 2,
|
|
459
|
+
borderColor: _theme.messengerTheme.colors.primary
|
|
460
|
+
},
|
|
461
|
+
headerTextWrap: {
|
|
462
|
+
flex: 1,
|
|
463
|
+
marginLeft: _theme.messengerTheme.spacing.md
|
|
464
|
+
},
|
|
465
|
+
headerTitle: {
|
|
466
|
+
color: _theme.messengerTheme.colors.primaryForeground,
|
|
467
|
+
fontWeight: '600',
|
|
468
|
+
fontSize: 16
|
|
469
|
+
},
|
|
470
|
+
headerSubtitle: {
|
|
471
|
+
color: 'rgba(255,255,255,0.65)',
|
|
472
|
+
fontSize: 12,
|
|
473
|
+
marginTop: 1
|
|
303
474
|
}
|
|
304
475
|
});
|
|
305
476
|
//# sourceMappingURL=ConversationDetail.js.map
|