@messenger-box/platform-mobile 0.0.1-alpha.236 → 0.0.1-alpha.239
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/CHANGELOG.md +8 -0
- package/package.json +4 -4
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -955
- package/lib/index.js.map +0 -1
- package/lib/module.d.ts +0 -3
- package/lib/navigation/InboxNavigation.d.ts +0 -4
- package/lib/navigation/index.d.ts +0 -1
- package/lib/screens/inbox/DialogMessages.d.ts +0 -4
- package/lib/screens/inbox/Inbox.d.ts +0 -1
- package/lib/screens/inbox/components/DialogsListItem.d.ts +0 -18
- package/lib/screens/inbox/config/config.d.ts +0 -4
- package/lib/screens/inbox/config/index.d.ts +0 -1
- package/lib/screens/inbox/containers/ConversationView.d.ts +0 -11
- package/lib/screens/inbox/containers/Dialogs.d.ts +0 -6
- package/lib/screens/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.0.1-alpha.239](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.238...v0.0.1-alpha.239) (2022-12-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
9
|
+
|
|
10
|
+
## [0.0.1-alpha.238](https://github.com/cdmbase/messenger-box/compare/v0.0.1-alpha.237...v0.0.1-alpha.238) (2022-11-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
13
|
+
|
|
6
14
|
## 0.0.1-alpha.236 (2022-11-18)
|
|
7
15
|
|
|
8
16
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/platform-mobile",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.239",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"watch": "yarn build:lib:watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@messenger-box/core": "0.0.1-alpha.
|
|
23
|
-
"@messenger-box/platform-client": "0.0.1-alpha.
|
|
22
|
+
"@messenger-box/core": "0.0.1-alpha.239",
|
|
23
|
+
"@messenger-box/platform-client": "0.0.1-alpha.239",
|
|
24
24
|
"base-64": "1.0.0",
|
|
25
25
|
"react-native-gifted-chat": "1.0.4"
|
|
26
26
|
},
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"typescript": {
|
|
41
41
|
"definition": "lib/index.d.ts"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "40a47b144e87e9878d71b1596247bf888e3e7bc0"
|
|
44
44
|
}
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,955 +0,0 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
|
-
/******/ var __webpack_modules__ = ({
|
|
4
|
-
|
|
5
|
-
/***/ "./src/index.ts":
|
|
6
|
-
/*!**********************!*\
|
|
7
|
-
!*** ./src/index.ts ***!
|
|
8
|
-
\**********************/
|
|
9
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
-
}
|
|
18
|
-
Object.defineProperty(o, k2, desc);
|
|
19
|
-
}) : (function(o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
}));
|
|
23
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
24
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
25
|
-
};
|
|
26
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
30
|
-
const module_1 = __importDefault(__webpack_require__(/*! ./module */ "./src/module.ts"));
|
|
31
|
-
const client_react_1 = __webpack_require__(/*! @common-stack/client-react */ "@common-stack/client-react");
|
|
32
|
-
exports["default"] = new client_react_1.Feature(module_1.default);
|
|
33
|
-
__exportStar(__webpack_require__(/*! ./navigation */ "./src/navigation/index.ts"), exports);
|
|
34
|
-
__exportStar(__webpack_require__(/*! ./screens */ "./src/screens/index.ts"), exports);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/***/ }),
|
|
38
|
-
|
|
39
|
-
/***/ "./src/module.ts":
|
|
40
|
-
/*!***********************!*\
|
|
41
|
-
!*** ./src/module.ts ***!
|
|
42
|
-
\***********************/
|
|
43
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
47
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
48
|
-
const client_react_1 = __webpack_require__(/*! @common-stack/client-react */ "@common-stack/client-react");
|
|
49
|
-
const platform_client_1 = __webpack_require__(/*! @messenger-box/platform-client */ "@messenger-box/platform-client");
|
|
50
|
-
exports["default"] = new client_react_1.Feature({
|
|
51
|
-
dataIdFromObject: platform_client_1.dataIdFromObject,
|
|
52
|
-
clientStateParams: { typeDefs: platform_client_1.schema, typePolicies: platform_client_1.typePolicies },
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/***/ }),
|
|
57
|
-
|
|
58
|
-
/***/ "./src/navigation/InboxNavigation.tsx":
|
|
59
|
-
/*!********************************************!*\
|
|
60
|
-
!*** ./src/navigation/InboxNavigation.tsx ***!
|
|
61
|
-
\********************************************/
|
|
62
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
66
|
-
if (k2 === undefined) k2 = k;
|
|
67
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
68
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
69
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
70
|
-
}
|
|
71
|
-
Object.defineProperty(o, k2, desc);
|
|
72
|
-
}) : (function(o, m, k, k2) {
|
|
73
|
-
if (k2 === undefined) k2 = k;
|
|
74
|
-
o[k2] = m[k];
|
|
75
|
-
}));
|
|
76
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
77
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
78
|
-
}) : function(o, v) {
|
|
79
|
-
o["default"] = v;
|
|
80
|
-
});
|
|
81
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
82
|
-
if (mod && mod.__esModule) return mod;
|
|
83
|
-
var result = {};
|
|
84
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
85
|
-
__setModuleDefault(result, mod);
|
|
86
|
-
return result;
|
|
87
|
-
};
|
|
88
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89
|
-
exports.InboxNavigation = void 0;
|
|
90
|
-
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
91
|
-
const stack_1 = __webpack_require__(/*! @react-navigation/stack */ "@react-navigation/stack");
|
|
92
|
-
const DialogMessages_1 = __webpack_require__(/*! ../screens/inbox/DialogMessages */ "./src/screens/inbox/DialogMessages.tsx");
|
|
93
|
-
const InboxStack = (0, stack_1.createStackNavigator)();
|
|
94
|
-
function InboxNavigation({ route }) {
|
|
95
|
-
return (React.createElement(InboxStack.Navigator, { initialRouteName: "DialogMessages" },
|
|
96
|
-
React.createElement(InboxStack.Screen, { name: "DialogMessages", options: { header: () => null } }, (props) => { var _a; return React.createElement(DialogMessages_1.DialogMessages, { channelId: (_a = route === null || route === void 0 ? void 0 : route.params) === null || _a === void 0 ? void 0 : _a.channelId }); })));
|
|
97
|
-
}
|
|
98
|
-
exports.InboxNavigation = InboxNavigation;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/***/ }),
|
|
102
|
-
|
|
103
|
-
/***/ "./src/navigation/index.ts":
|
|
104
|
-
/*!*********************************!*\
|
|
105
|
-
!*** ./src/navigation/index.ts ***!
|
|
106
|
-
\*********************************/
|
|
107
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
111
|
-
if (k2 === undefined) k2 = k;
|
|
112
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
113
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
114
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
115
|
-
}
|
|
116
|
-
Object.defineProperty(o, k2, desc);
|
|
117
|
-
}) : (function(o, m, k, k2) {
|
|
118
|
-
if (k2 === undefined) k2 = k;
|
|
119
|
-
o[k2] = m[k];
|
|
120
|
-
}));
|
|
121
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
122
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
123
|
-
};
|
|
124
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
125
|
-
__exportStar(__webpack_require__(/*! ./InboxNavigation */ "./src/navigation/InboxNavigation.tsx"), exports);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
/***/ }),
|
|
129
|
-
|
|
130
|
-
/***/ "./src/screens/inbox/DialogMessages.tsx":
|
|
131
|
-
/*!**********************************************!*\
|
|
132
|
-
!*** ./src/screens/inbox/DialogMessages.tsx ***!
|
|
133
|
-
\**********************************************/
|
|
134
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
138
|
-
if (k2 === undefined) k2 = k;
|
|
139
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
140
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
141
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
142
|
-
}
|
|
143
|
-
Object.defineProperty(o, k2, desc);
|
|
144
|
-
}) : (function(o, m, k, k2) {
|
|
145
|
-
if (k2 === undefined) k2 = k;
|
|
146
|
-
o[k2] = m[k];
|
|
147
|
-
}));
|
|
148
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
149
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
150
|
-
}) : function(o, v) {
|
|
151
|
-
o["default"] = v;
|
|
152
|
-
});
|
|
153
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
154
|
-
if (mod && mod.__esModule) return mod;
|
|
155
|
-
var result = {};
|
|
156
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
157
|
-
__setModuleDefault(result, mod);
|
|
158
|
-
return result;
|
|
159
|
-
};
|
|
160
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
161
|
-
exports.DialogMessages = void 0;
|
|
162
|
-
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
163
|
-
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
164
|
-
const ConversationView_1 = __webpack_require__(/*! ./containers/ConversationView */ "./src/screens/inbox/containers/ConversationView.tsx");
|
|
165
|
-
function DialogMessages({ channelId }) {
|
|
166
|
-
return (React.createElement(native_base_1.Box, { bg: 'white', flex: 1 },
|
|
167
|
-
React.createElement(ConversationView_1.ConversationView, { channelId: channelId })));
|
|
168
|
-
}
|
|
169
|
-
exports.DialogMessages = DialogMessages;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/***/ }),
|
|
173
|
-
|
|
174
|
-
/***/ "./src/screens/inbox/Inbox.tsx":
|
|
175
|
-
/*!*************************************!*\
|
|
176
|
-
!*** ./src/screens/inbox/Inbox.tsx ***!
|
|
177
|
-
\*************************************/
|
|
178
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
182
|
-
if (k2 === undefined) k2 = k;
|
|
183
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
184
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
185
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
186
|
-
}
|
|
187
|
-
Object.defineProperty(o, k2, desc);
|
|
188
|
-
}) : (function(o, m, k, k2) {
|
|
189
|
-
if (k2 === undefined) k2 = k;
|
|
190
|
-
o[k2] = m[k];
|
|
191
|
-
}));
|
|
192
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
193
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
194
|
-
}) : function(o, v) {
|
|
195
|
-
o["default"] = v;
|
|
196
|
-
});
|
|
197
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
198
|
-
if (mod && mod.__esModule) return mod;
|
|
199
|
-
var result = {};
|
|
200
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
201
|
-
__setModuleDefault(result, mod);
|
|
202
|
-
return result;
|
|
203
|
-
};
|
|
204
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
205
|
-
exports.Inbox = void 0;
|
|
206
|
-
const React = __importStar(__webpack_require__(/*! react */ "react"));
|
|
207
|
-
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
208
|
-
const Dialogs_1 = __webpack_require__(/*! ./containers/Dialogs */ "./src/screens/inbox/containers/Dialogs.tsx");
|
|
209
|
-
const Inbox = (props) => {
|
|
210
|
-
const { channelFilters, channelRole } = props;
|
|
211
|
-
return (React.createElement(native_base_1.Box, { bg: 'white', flex: 1 },
|
|
212
|
-
React.createElement(Dialogs_1.Dialogs, { channelFilters: channelFilters, channelRole: channelRole })));
|
|
213
|
-
};
|
|
214
|
-
exports.Inbox = Inbox;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
/***/ }),
|
|
218
|
-
|
|
219
|
-
/***/ "./src/screens/inbox/components/DialogsListItem.tsx":
|
|
220
|
-
/*!**********************************************************!*\
|
|
221
|
-
!*** ./src/screens/inbox/components/DialogsListItem.tsx ***!
|
|
222
|
-
\**********************************************************/
|
|
223
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
227
|
-
if (k2 === undefined) k2 = k;
|
|
228
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
229
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
230
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
231
|
-
}
|
|
232
|
-
Object.defineProperty(o, k2, desc);
|
|
233
|
-
}) : (function(o, m, k, k2) {
|
|
234
|
-
if (k2 === undefined) k2 = k;
|
|
235
|
-
o[k2] = m[k];
|
|
236
|
-
}));
|
|
237
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
238
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
239
|
-
}) : function(o, v) {
|
|
240
|
-
o["default"] = v;
|
|
241
|
-
});
|
|
242
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
243
|
-
if (mod && mod.__esModule) return mod;
|
|
244
|
-
var result = {};
|
|
245
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
246
|
-
__setModuleDefault(result, mod);
|
|
247
|
-
return result;
|
|
248
|
-
};
|
|
249
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
250
|
-
exports.DialogsListItem = void 0;
|
|
251
|
-
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
252
|
-
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
253
|
-
const date_fns_1 = __webpack_require__(/*! date-fns */ "date-fns");
|
|
254
|
-
const platform_client_1 = __webpack_require__(/*! @messenger-box/platform-client */ "@messenger-box/platform-client");
|
|
255
|
-
const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
|
|
256
|
-
const createdAtText = (value) => {
|
|
257
|
-
if (!value)
|
|
258
|
-
return '';
|
|
259
|
-
let date = new Date(value);
|
|
260
|
-
if ((0, date_fns_1.isToday)(date))
|
|
261
|
-
return 'Today';
|
|
262
|
-
if ((0, date_fns_1.isYesterday)(date))
|
|
263
|
-
return 'Yesterday';
|
|
264
|
-
return (0, date_fns_1.format)(new Date(value), 'MMM dd, yyyy');
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* TODO:
|
|
268
|
-
* - Get Reservation info: reservation date, status
|
|
269
|
-
* - Add ability to get property information: name, logo
|
|
270
|
-
*/
|
|
271
|
-
const DialogsListItem = function DialogsListItem({ currentUser, users, selectedChannelId, channel, onOpen, }) {
|
|
272
|
-
var _a;
|
|
273
|
-
const { data: messagesQuery, loading: messageLoading } = (0, platform_client_1.useMessagesQuery)({
|
|
274
|
-
variables: {
|
|
275
|
-
channelId: (_a = channel === null || channel === void 0 ? void 0 : channel.id) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
276
|
-
limit: 1,
|
|
277
|
-
},
|
|
278
|
-
fetchPolicy: 'cache-and-network',
|
|
279
|
-
});
|
|
280
|
-
const chatUser = (0, react_1.useMemo)(() => users === null || users === void 0 ? void 0 : users.find(({ id }) => {
|
|
281
|
-
var _a;
|
|
282
|
-
const isNotCurrentUser = id !== (currentUser === null || currentUser === void 0 ? void 0 : currentUser.id);
|
|
283
|
-
if (isNotCurrentUser) {
|
|
284
|
-
return (_a = channel === null || channel === void 0 ? void 0 : channel.members) === null || _a === void 0 ? void 0 : _a.find(({ user }) => user.id === id);
|
|
285
|
-
}
|
|
286
|
-
return isNotCurrentUser;
|
|
287
|
-
}), [users, currentUser, channel]);
|
|
288
|
-
const { data: userQuery } = (0, platform_client_1.useUserAccountQuery)({
|
|
289
|
-
variables: {
|
|
290
|
-
userId: chatUser === null || chatUser === void 0 ? void 0 : chatUser.id,
|
|
291
|
-
},
|
|
292
|
-
skip: !(chatUser === null || chatUser === void 0 ? void 0 : chatUser.id),
|
|
293
|
-
});
|
|
294
|
-
const lastMessage = (0, react_1.useMemo)(() => {
|
|
295
|
-
var _a, _b;
|
|
296
|
-
if (!((_b = (_a = messagesQuery === null || messagesQuery === void 0 ? void 0 : messagesQuery.messages) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
const { data } = messagesQuery.messages;
|
|
300
|
-
return data[data.length - 1];
|
|
301
|
-
}, [messagesQuery]);
|
|
302
|
-
const channelType = (0, react_1.useMemo)(() => {
|
|
303
|
-
return channel === null || channel === void 0 ? void 0 : channel.type;
|
|
304
|
-
}, [channel]);
|
|
305
|
-
return (react_1.default.createElement(native_base_1.Pressable, { onPress: () => (channel === null || channel === void 0 ? void 0 : channel.id) !== selectedChannelId && onOpen(channel === null || channel === void 0 ? void 0 : channel.id), borderWidth: '1', borderRadius: 10, borderColor: 'gray.200', _dark: {
|
|
306
|
-
borderColor: 'coolGray.600',
|
|
307
|
-
backgroundColor: 'gray.700',
|
|
308
|
-
}, _web: {
|
|
309
|
-
shadow: 2,
|
|
310
|
-
borderWidth: 0,
|
|
311
|
-
}, _light: {
|
|
312
|
-
backgroundColor: 'gray.50',
|
|
313
|
-
} },
|
|
314
|
-
react_1.default.createElement(native_base_1.HStack, { m: 3, space: 2 },
|
|
315
|
-
react_1.default.createElement(native_base_1.Avatar, { size: 'lg', source: {
|
|
316
|
-
uri: userQuery === null || userQuery === void 0 ? void 0 : userQuery.getUserAccount.picture,
|
|
317
|
-
} }, (0, lodash_1.startCase)(userQuery === null || userQuery === void 0 ? void 0 : userQuery.getUserAccount.username.charAt(0))),
|
|
318
|
-
react_1.default.createElement(native_base_1.Box, { width: '80%' },
|
|
319
|
-
react_1.default.createElement(native_base_1.HStack, { alignItems: "center", justifyContent: "space-between" },
|
|
320
|
-
react_1.default.createElement(native_base_1.Text, { fontSize: "xs", color: "red.500" }, channelType),
|
|
321
|
-
react_1.default.createElement(native_base_1.Text, { color: "gray.500" }, lastMessage ? createdAtText(lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.createdAt) : '')),
|
|
322
|
-
react_1.default.createElement(native_base_1.Text, { color: "gray.600", fontSize: "lg", fontWeight: "semibold" }, (chatUser === null || chatUser === void 0 ? void 0 : chatUser.givenName) + ' ' + (chatUser === null || chatUser === void 0 ? void 0 : chatUser.familyName)),
|
|
323
|
-
react_1.default.createElement(native_base_1.Text, { color: "gray.600" }, lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.message)))));
|
|
324
|
-
};
|
|
325
|
-
exports.DialogsListItem = DialogsListItem;
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
/***/ }),
|
|
329
|
-
|
|
330
|
-
/***/ "./src/screens/inbox/config/config.ts":
|
|
331
|
-
/*!********************************************!*\
|
|
332
|
-
!*** ./src/screens/inbox/config/config.ts ***!
|
|
333
|
-
\********************************************/
|
|
334
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
338
|
-
exports.config = void 0;
|
|
339
|
-
const envalid_1 = __webpack_require__(/*! envalid */ "envalid");
|
|
340
|
-
exports.config = (0, envalid_1.cleanEnv)(process.env, {
|
|
341
|
-
MESSAGES_PER_PAGE: (0, envalid_1.num)({ devDefault: 10, default: 20 }),
|
|
342
|
-
FILES_PER_MESSAGE: (0, envalid_1.num)({ default: 10 }),
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
/***/ }),
|
|
347
|
-
|
|
348
|
-
/***/ "./src/screens/inbox/config/index.ts":
|
|
349
|
-
/*!*******************************************!*\
|
|
350
|
-
!*** ./src/screens/inbox/config/index.ts ***!
|
|
351
|
-
\*******************************************/
|
|
352
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
356
|
-
exports.config = void 0;
|
|
357
|
-
var config_1 = __webpack_require__(/*! ./config */ "./src/screens/inbox/config/config.ts");
|
|
358
|
-
Object.defineProperty(exports, "config", ({ enumerable: true, get: function () { return config_1.config; } }));
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
/***/ }),
|
|
362
|
-
|
|
363
|
-
/***/ "./src/screens/inbox/containers/ConversationView.tsx":
|
|
364
|
-
/*!***********************************************************!*\
|
|
365
|
-
!*** ./src/screens/inbox/containers/ConversationView.tsx ***!
|
|
366
|
-
\***********************************************************/
|
|
367
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
371
|
-
if (k2 === undefined) k2 = k;
|
|
372
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
373
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
374
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
375
|
-
}
|
|
376
|
-
Object.defineProperty(o, k2, desc);
|
|
377
|
-
}) : (function(o, m, k, k2) {
|
|
378
|
-
if (k2 === undefined) k2 = k;
|
|
379
|
-
o[k2] = m[k];
|
|
380
|
-
}));
|
|
381
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
382
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
383
|
-
}) : function(o, v) {
|
|
384
|
-
o["default"] = v;
|
|
385
|
-
});
|
|
386
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
387
|
-
if (mod && mod.__esModule) return mod;
|
|
388
|
-
var result = {};
|
|
389
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
390
|
-
__setModuleDefault(result, mod);
|
|
391
|
-
return result;
|
|
392
|
-
};
|
|
393
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
394
|
-
exports.ConversationView = void 0;
|
|
395
|
-
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
396
|
-
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
397
|
-
const native_1 = __webpack_require__(/*! @react-navigation/native */ "@react-navigation/native");
|
|
398
|
-
const react_redux_1 = __webpack_require__(/*! react-redux */ "react-redux");
|
|
399
|
-
const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
|
|
400
|
-
const ImagePicker = __importStar(__webpack_require__(/*! expo-image-picker */ "expo-image-picker"));
|
|
401
|
-
const base_64_1 = __webpack_require__(/*! base-64 */ "base-64");
|
|
402
|
-
const vector_icons_1 = __webpack_require__(/*! @expo/vector-icons */ "@expo/vector-icons");
|
|
403
|
-
const react_native_gifted_chat_1 = __webpack_require__(/*! react-native-gifted-chat */ "react-native-gifted-chat");
|
|
404
|
-
const platform_client_1 = __webpack_require__(/*! @messenger-box/platform-client */ "@messenger-box/platform-client");
|
|
405
|
-
const config_1 = __webpack_require__(/*! ../config */ "./src/screens/inbox/config/index.ts");
|
|
406
|
-
const user_auth0_client_1 = __webpack_require__(/*! @adminide-stack/user-auth0-client */ "@adminide-stack/user-auth0-client");
|
|
407
|
-
const { MESSAGES_PER_PAGE } = config_1.config;
|
|
408
|
-
function ConversationView({ channelId }) {
|
|
409
|
-
var _a;
|
|
410
|
-
const [channelToTop, setChannelToTop] = (0, react_1.useState)(0);
|
|
411
|
-
const [channelMessages, setChannelMessages] = (0, react_1.useState)([]);
|
|
412
|
-
const auth = (0, react_redux_1.useSelector)(user_auth0_client_1.userSelector);
|
|
413
|
-
const [totalCount, setTotalCount] = (0, react_1.useState)(0);
|
|
414
|
-
const [selectedImage, setImage] = (0, react_1.useState)('');
|
|
415
|
-
const [loadingOldMessages, setLoadingOldMessages] = (0, react_1.useState)(false);
|
|
416
|
-
const color = (0, native_base_1.useColorModeValue)('white', 'black');
|
|
417
|
-
const navigation = (0, native_1.useNavigation)();
|
|
418
|
-
const [files, setFiles] = (0, react_1.useState)([]);
|
|
419
|
-
const [images, setImages] = (0, react_1.useState)([]);
|
|
420
|
-
const { startUpload } = (0, platform_client_1.useUploadFiles)();
|
|
421
|
-
const [sendMsg] = (0, platform_client_1.useSendMessagesMutation)();
|
|
422
|
-
const { data, loading: messageLoading, refetch, } = (0, platform_client_1.useMessagesQuery)({
|
|
423
|
-
variables: {
|
|
424
|
-
channelId: channelId === null || channelId === void 0 ? void 0 : channelId.toString(),
|
|
425
|
-
limit: MESSAGES_PER_PAGE,
|
|
426
|
-
},
|
|
427
|
-
skip: !channelId,
|
|
428
|
-
fetchPolicy: 'cache-and-network',
|
|
429
|
-
});
|
|
430
|
-
const { data: users } = (0, platform_client_1.useGetAllUsersQuery)();
|
|
431
|
-
const currentUser = (0, react_1.useMemo)(() => { var _a; return (_a = users === null || users === void 0 ? void 0 : users.getUsers) === null || _a === void 0 ? void 0 : _a.find(({ alias }) => alias.includes(auth === null || auth === void 0 ? void 0 : auth.auth0UserId)); }, [users, auth]);
|
|
432
|
-
const { data: checkForMessages } = (0, platform_client_1.useCheckForNewMessagesQuery)({
|
|
433
|
-
variables: {
|
|
434
|
-
channelId: channelId === null || channelId === void 0 ? void 0 : channelId.toString(),
|
|
435
|
-
},
|
|
436
|
-
skip: !channelId,
|
|
437
|
-
fetchPolicy: 'network-only',
|
|
438
|
-
pollInterval: 5000,
|
|
439
|
-
});
|
|
440
|
-
(0, react_1.useEffect)(() => {
|
|
441
|
-
var _a;
|
|
442
|
-
if (((_a = data === null || data === void 0 ? void 0 : data.messages) === null || _a === void 0 ? void 0 : _a.data) && (loadingOldMessages || channelMessages.length === 0)) {
|
|
443
|
-
const { data: messages, totalCount } = data.messages;
|
|
444
|
-
setChannelMessages((oldMessages) => (0, lodash_1.uniqBy)([...messages, ...oldMessages], ({ id }) => id));
|
|
445
|
-
setTotalCount(totalCount);
|
|
446
|
-
}
|
|
447
|
-
}, [data, loadingOldMessages, channelMessages]);
|
|
448
|
-
(0, react_1.useEffect)(() => {
|
|
449
|
-
var _a, _b;
|
|
450
|
-
if (((_a = checkForMessages === null || checkForMessages === void 0 ? void 0 : checkForMessages.messages) === null || _a === void 0 ? void 0 : _a.totalCount) > totalCount) {
|
|
451
|
-
const numberOfNewMessages = ((_b = checkForMessages === null || checkForMessages === void 0 ? void 0 : checkForMessages.messages) === null || _b === void 0 ? void 0 : _b.totalCount) - totalCount;
|
|
452
|
-
refetch({
|
|
453
|
-
limit: numberOfNewMessages,
|
|
454
|
-
}).then(({ data }) => {
|
|
455
|
-
if (!(data === null || data === void 0 ? void 0 : data.messages)) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
const { data: messages, totalCount } = data.messages;
|
|
459
|
-
setTotalCount(totalCount);
|
|
460
|
-
setChannelMessages((oldMessages) => (0, lodash_1.uniqBy)([
|
|
461
|
-
...oldMessages,
|
|
462
|
-
...messages
|
|
463
|
-
], ({ id }) => id));
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
}, [checkForMessages, totalCount, refetch]);
|
|
467
|
-
const onFetchOld = (0, react_1.useCallback)(() => {
|
|
468
|
-
var _a;
|
|
469
|
-
if (((_a = data === null || data === void 0 ? void 0 : data.messages) === null || _a === void 0 ? void 0 : _a.totalCount) > channelMessages.length) {
|
|
470
|
-
setLoadingOldMessages(true);
|
|
471
|
-
refetch({ skip: channelMessages.length });
|
|
472
|
-
}
|
|
473
|
-
}, [data, channelMessages]);
|
|
474
|
-
const isCloseToTop = ({ layoutMeasurement, contentOffset, contentSize }) => {
|
|
475
|
-
return contentOffset.y <= 100; // 100px from top
|
|
476
|
-
};
|
|
477
|
-
const dataURLtoFile = (dataurl, filename) => {
|
|
478
|
-
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1], bstr = (0, base_64_1.encode)(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
|
479
|
-
while (n--) {
|
|
480
|
-
u8arr[n] = bstr.charCodeAt(n);
|
|
481
|
-
}
|
|
482
|
-
return new File([u8arr], filename, { type: mime });
|
|
483
|
-
};
|
|
484
|
-
const onSelectImages = async () => {
|
|
485
|
-
let imageSource = await ImagePicker.launchImageLibraryAsync({
|
|
486
|
-
mediaTypes: ImagePicker.MediaTypeOptions.Images,
|
|
487
|
-
allowsEditing: true,
|
|
488
|
-
aspect: [4, 3],
|
|
489
|
-
quality: 1,
|
|
490
|
-
base64: true,
|
|
491
|
-
});
|
|
492
|
-
if (!imageSource.cancelled) {
|
|
493
|
-
const image = 'data:image/jpeg;base64,' + (imageSource === null || imageSource === void 0 ? void 0 : imageSource.base64);
|
|
494
|
-
setImage(image);
|
|
495
|
-
const file = dataURLtoFile(image, 'inputImage.jpg');
|
|
496
|
-
setFiles((files) => files.concat(file));
|
|
497
|
-
setImages((images) => images.concat(imageSource));
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
const handleSend = (0, react_1.useCallback)(async (message) => {
|
|
501
|
-
var _a;
|
|
502
|
-
if (!(message && channelId)) {
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
const { data } = await sendMsg({
|
|
506
|
-
variables: {
|
|
507
|
-
channelId,
|
|
508
|
-
content: message,
|
|
509
|
-
},
|
|
510
|
-
update: (cache, { data, errors }) => {
|
|
511
|
-
if (!data || errors) {
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
setChannelMessages((messages) => [...messages, data === null || data === void 0 ? void 0 : data.sendMessage]);
|
|
515
|
-
setTotalCount((t) => t + 1);
|
|
516
|
-
setChannelToTop(channelToTop + 1);
|
|
517
|
-
},
|
|
518
|
-
});
|
|
519
|
-
if (images && ((_a = data === null || data === void 0 ? void 0 : data.sendMessage) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
520
|
-
const { id: postId } = data.sendMessage;
|
|
521
|
-
const uploadResponse = await startUpload({
|
|
522
|
-
file: images,
|
|
523
|
-
saveUploadedFile: {
|
|
524
|
-
variables: {
|
|
525
|
-
postId,
|
|
526
|
-
},
|
|
527
|
-
},
|
|
528
|
-
createUploadLink: {
|
|
529
|
-
variables: {
|
|
530
|
-
postId,
|
|
531
|
-
},
|
|
532
|
-
},
|
|
533
|
-
});
|
|
534
|
-
const uploadedFiles = uploadResponse.data;
|
|
535
|
-
if (uploadResponse.data) {
|
|
536
|
-
setFiles([]);
|
|
537
|
-
setImage('');
|
|
538
|
-
}
|
|
539
|
-
setChannelMessages((messages) => messages.map((message) => {
|
|
540
|
-
if (message.id === postId) {
|
|
541
|
-
return Object.assign(Object.assign({}, message), { files: {
|
|
542
|
-
totalCount: uploadedFiles.length,
|
|
543
|
-
data: uploadedFiles,
|
|
544
|
-
} });
|
|
545
|
-
}
|
|
546
|
-
return message;
|
|
547
|
-
}));
|
|
548
|
-
}
|
|
549
|
-
}, [setChannelMessages, currentUser, channelId, images]);
|
|
550
|
-
const messageList = (0, react_1.useMemo)(() => {
|
|
551
|
-
let currentDate = '';
|
|
552
|
-
let res = [];
|
|
553
|
-
if (channelMessages.length) {
|
|
554
|
-
(0, lodash_1.orderBy)(channelMessages, ['createdAt'], ['desc']).map((msg) => {
|
|
555
|
-
var _a, _b, _c;
|
|
556
|
-
let message = {
|
|
557
|
-
_id: '',
|
|
558
|
-
text: '',
|
|
559
|
-
createdAt: 0,
|
|
560
|
-
user: {
|
|
561
|
-
_id: '',
|
|
562
|
-
name: '',
|
|
563
|
-
avatar: '',
|
|
564
|
-
},
|
|
565
|
-
type: '',
|
|
566
|
-
};
|
|
567
|
-
const date = new Date(msg.createdAt);
|
|
568
|
-
message._id = msg.id;
|
|
569
|
-
message.text = msg.message;
|
|
570
|
-
message.createdAt = date;
|
|
571
|
-
(message.user = {
|
|
572
|
-
_id: msg.author.id,
|
|
573
|
-
name: msg.author.givenName + msg.author.familyName,
|
|
574
|
-
avatar: (_a = msg.author) === null || _a === void 0 ? void 0 : _a.picture,
|
|
575
|
-
}),
|
|
576
|
-
(message.image = (_c = (_b = msg.files) === null || _b === void 0 ? void 0 : _b.data[0]) === null || _c === void 0 ? void 0 : _c.url),
|
|
577
|
-
(message.sent = msg === null || msg === void 0 ? void 0 : msg.isDelivered),
|
|
578
|
-
(message.received = msg === null || msg === void 0 ? void 0 : msg.isRead);
|
|
579
|
-
message.type = msg === null || msg === void 0 ? void 0 : msg.type;
|
|
580
|
-
message.propsConfiguration = msg === null || msg === void 0 ? void 0 : msg.propsConfiguration;
|
|
581
|
-
res.push(message);
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
return res;
|
|
585
|
-
}, [channelMessages]);
|
|
586
|
-
const renderSend = (props) => {
|
|
587
|
-
return (react_1.default.createElement(react_native_gifted_chat_1.Send, Object.assign({}, props),
|
|
588
|
-
react_1.default.createElement(native_base_1.Box, null,
|
|
589
|
-
react_1.default.createElement(vector_icons_1.MaterialCommunityIcons, { name: "send-circle", style: { marginBottom: 5, marginRight: 5 }, size: 32, color: "#2e64e5" }))));
|
|
590
|
-
};
|
|
591
|
-
const renderMessageText = (props) => {
|
|
592
|
-
var _a, _b, _c, _d, _e;
|
|
593
|
-
const { currentMessage } = props;
|
|
594
|
-
if (currentMessage.type === 'ALERT') {
|
|
595
|
-
const attachment = (_b = (_a = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.propsConfiguration) === null || _a === void 0 ? void 0 : _a.contents) === null || _b === void 0 ? void 0 : _b.attachment;
|
|
596
|
-
let action = '';
|
|
597
|
-
let actionId = '';
|
|
598
|
-
if ((_d = (_c = attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) === null || _c === void 0 ? void 0 : _c.link) === null || _d === void 0 ? void 0 : _d.includes('my-reservation-details')) {
|
|
599
|
-
action = 'm-reservation-detail';
|
|
600
|
-
actionId = (_e = attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) === null || _e === void 0 ? void 0 : _e.link.split('/').pop();
|
|
601
|
-
}
|
|
602
|
-
return (react_1.default.createElement(native_base_1.Box, null,
|
|
603
|
-
(attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) ? (react_1.default.createElement(native_base_1.Button, { variant: 'outline', size: 'sm', borderColor: color, onPress: () => navigation.navigate(action, { reservationId: actionId }) },
|
|
604
|
-
react_1.default.createElement(native_base_1.Text, { color: color }, attachment.callToAction.title))) : null,
|
|
605
|
-
react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props))));
|
|
606
|
-
}
|
|
607
|
-
else {
|
|
608
|
-
return react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props));
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
const renderActions = (props) => {
|
|
612
|
-
return (react_1.default.createElement(react_native_gifted_chat_1.Actions, Object.assign({}, props, { icon: () => react_1.default.createElement(native_base_1.Icon, { as: vector_icons_1.Ionicons, name: 'image', size: 'lg', color: 'black', onPress: onSelectImages }) })));
|
|
613
|
-
};
|
|
614
|
-
const renderAccessory = (props) => {
|
|
615
|
-
return (react_1.default.createElement(native_base_1.Box, null, selectedImage !== '' ? (react_1.default.createElement(native_base_1.HStack, { alignItems: 'center' },
|
|
616
|
-
react_1.default.createElement(native_base_1.Image, { ml: 3, key: selectedImage, alt: 'image', source: { uri: selectedImage }, size: 'xs' }),
|
|
617
|
-
react_1.default.createElement(native_base_1.Button, { variant: 'ghost', colorScheme: 'secondary', onPress: () => {
|
|
618
|
-
setFiles([]);
|
|
619
|
-
setImage('');
|
|
620
|
-
setImages([]);
|
|
621
|
-
} }, "Cancel"))) : null));
|
|
622
|
-
};
|
|
623
|
-
return (react_1.default.createElement(react_native_gifted_chat_1.GiftedChat, { wrapInSafeArea: false, renderLoading: () => react_1.default.createElement(native_base_1.Spinner, null), messages: messageList, onSend: (messages) => {
|
|
624
|
-
handleSend(messages[0].text);
|
|
625
|
-
}, scrollToBottom: true, user: {
|
|
626
|
-
_id: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.id) || '',
|
|
627
|
-
}, isTyping: true, alwaysShowSend: true, onLoadEarlier: onFetchOld, infiniteScroll: true, renderSend: renderSend, loadEarlier: channelMessages.length !== ((_a = data === null || data === void 0 ? void 0 : data.messages) === null || _a === void 0 ? void 0 : _a.totalCount), renderMessageText: renderMessageText, minInputToolbarHeight: 50, renderActions: renderActions, renderAccessory: renderAccessory }));
|
|
628
|
-
}
|
|
629
|
-
exports.ConversationView = ConversationView;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
/***/ }),
|
|
633
|
-
|
|
634
|
-
/***/ "./src/screens/inbox/containers/Dialogs.tsx":
|
|
635
|
-
/*!**************************************************!*\
|
|
636
|
-
!*** ./src/screens/inbox/containers/Dialogs.tsx ***!
|
|
637
|
-
\**************************************************/
|
|
638
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
642
|
-
if (k2 === undefined) k2 = k;
|
|
643
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
644
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
645
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
646
|
-
}
|
|
647
|
-
Object.defineProperty(o, k2, desc);
|
|
648
|
-
}) : (function(o, m, k, k2) {
|
|
649
|
-
if (k2 === undefined) k2 = k;
|
|
650
|
-
o[k2] = m[k];
|
|
651
|
-
}));
|
|
652
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
653
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
654
|
-
}) : function(o, v) {
|
|
655
|
-
o["default"] = v;
|
|
656
|
-
});
|
|
657
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
658
|
-
if (mod && mod.__esModule) return mod;
|
|
659
|
-
var result = {};
|
|
660
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
661
|
-
__setModuleDefault(result, mod);
|
|
662
|
-
return result;
|
|
663
|
-
};
|
|
664
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
665
|
-
exports.Dialogs = void 0;
|
|
666
|
-
const react_1 = __importStar(__webpack_require__(/*! react */ "react"));
|
|
667
|
-
const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
|
|
668
|
-
const vector_icons_1 = __webpack_require__(/*! @expo/vector-icons */ "@expo/vector-icons");
|
|
669
|
-
const react_redux_1 = __webpack_require__(/*! react-redux */ "react-redux");
|
|
670
|
-
const native_1 = __webpack_require__(/*! @react-navigation/native */ "@react-navigation/native");
|
|
671
|
-
const DialogsListItem_1 = __webpack_require__(/*! ../components/DialogsListItem */ "./src/screens/inbox/components/DialogsListItem.tsx");
|
|
672
|
-
const platform_client_1 = __webpack_require__(/*! @messenger-box/platform-client */ "@messenger-box/platform-client");
|
|
673
|
-
const user_auth0_client_1 = __webpack_require__(/*! @adminide-stack/user-auth0-client */ "@adminide-stack/user-auth0-client");
|
|
674
|
-
const client_1 = __webpack_require__(/*! @admin-layout/client */ "@admin-layout/client");
|
|
675
|
-
function Dialogs(props) {
|
|
676
|
-
var _a;
|
|
677
|
-
const { channelFilters, channelRole } = props;
|
|
678
|
-
const { params } = (0, native_1.useRoute)();
|
|
679
|
-
const auth = (0, react_redux_1.useSelector)(user_auth0_client_1.userSelector);
|
|
680
|
-
const dispatch = (0, react_redux_1.useDispatch)();
|
|
681
|
-
const navigation = (0, native_1.useNavigation)();
|
|
682
|
-
const { data: userChannels, loading: userChannelsLoading, refetch: getChannelsRefetch, } = (0, platform_client_1.useGetChannelsByUserQuery)({
|
|
683
|
-
variables: {
|
|
684
|
-
role: channelRole,
|
|
685
|
-
criteria: channelFilters,
|
|
686
|
-
},
|
|
687
|
-
});
|
|
688
|
-
const { data: users } = (0, platform_client_1.useGetAllUsersQuery)();
|
|
689
|
-
const currentUser = (0, react_1.useMemo)(() => { var _a; return (_a = users === null || users === void 0 ? void 0 : users.getUsers) === null || _a === void 0 ? void 0 : _a.find(({ alias }) => alias.includes(auth === null || auth === void 0 ? void 0 : auth.auth0UserId)); }, [users, auth]);
|
|
690
|
-
(0, react_1.useEffect)(() => {
|
|
691
|
-
getChannelsRefetch();
|
|
692
|
-
}, []);
|
|
693
|
-
(0, react_1.useEffect)(() => {
|
|
694
|
-
setTimeout(() => {
|
|
695
|
-
dispatch({
|
|
696
|
-
type: client_1.CHANGE_SETTINGS_ACTION,
|
|
697
|
-
payload: {
|
|
698
|
-
footerRender: false,
|
|
699
|
-
},
|
|
700
|
-
});
|
|
701
|
-
}, 0);
|
|
702
|
-
return () => {
|
|
703
|
-
dispatch({
|
|
704
|
-
type: client_1.CHANGE_SETTINGS_ACTION,
|
|
705
|
-
payload: {
|
|
706
|
-
footerRender: true,
|
|
707
|
-
},
|
|
708
|
-
});
|
|
709
|
-
};
|
|
710
|
-
}, []);
|
|
711
|
-
const handleSelectChannel = (0, react_1.useCallback)((id) => {
|
|
712
|
-
if (params === null || params === void 0 ? void 0 : params.channelId) {
|
|
713
|
-
navigation.navigate('Inbox.DialogMessages', { channelId: params === null || params === void 0 ? void 0 : params.channelId, hideTabBar: true });
|
|
714
|
-
}
|
|
715
|
-
else {
|
|
716
|
-
navigation.navigate('Inbox.DialogMessages', { channelId: id, hideTabBar: true });
|
|
717
|
-
}
|
|
718
|
-
}, []);
|
|
719
|
-
return (react_1.default.createElement(native_base_1.Box, { p: 2 }, !((_a = userChannels === null || userChannels === void 0 ? void 0 : userChannels.channelsByUser) === null || _a === void 0 ? void 0 : _a.length) ? (react_1.default.createElement(native_base_1.Box, { p: 5 },
|
|
720
|
-
react_1.default.createElement(native_base_1.Heading, null, "Chat"),
|
|
721
|
-
react_1.default.createElement(native_base_1.Input, { height: 50, mt: 3, placeholder: "Search", borderRadius: 50, borderColor: 'gray.200', borderWidth: 2 }),
|
|
722
|
-
react_1.default.createElement(native_base_1.Center, { mt: 6 },
|
|
723
|
-
react_1.default.createElement(native_base_1.Icon, { as: vector_icons_1.Ionicons, name: "chatbubbles", size: 'xl' }),
|
|
724
|
-
react_1.default.createElement(native_base_1.Text, null, "You don't have any messages yet!")))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
725
|
-
react_1.default.createElement(native_base_1.FlatList, { data: userChannels === null || userChannels === void 0 ? void 0 : userChannels.channelsByUser, onRefresh: getChannelsRefetch, refreshing: userChannelsLoading, contentContainerStyle: { minHeight: '100%' }, ItemSeparatorComponent: () => react_1.default.createElement(native_base_1.Box, { height: "0.5", backgroundColor: "gray.200" }), renderItem: ({ item: channel }) => (react_1.default.createElement(DialogsListItem_1.DialogsListItem, { users: users === null || users === void 0 ? void 0 : users.getUsers, onOpen: handleSelectChannel, currentUser: currentUser, channel: channel, selectedChannelId: params === null || params === void 0 ? void 0 : params.channelId })) })))));
|
|
726
|
-
}
|
|
727
|
-
exports.Dialogs = Dialogs;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
/***/ }),
|
|
731
|
-
|
|
732
|
-
/***/ "./src/screens/index.ts":
|
|
733
|
-
/*!******************************!*\
|
|
734
|
-
!*** ./src/screens/index.ts ***!
|
|
735
|
-
\******************************/
|
|
736
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
740
|
-
if (k2 === undefined) k2 = k;
|
|
741
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
742
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
743
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
744
|
-
}
|
|
745
|
-
Object.defineProperty(o, k2, desc);
|
|
746
|
-
}) : (function(o, m, k, k2) {
|
|
747
|
-
if (k2 === undefined) k2 = k;
|
|
748
|
-
o[k2] = m[k];
|
|
749
|
-
}));
|
|
750
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
751
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
752
|
-
};
|
|
753
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
754
|
-
__exportStar(__webpack_require__(/*! ./inbox/Inbox */ "./src/screens/inbox/Inbox.tsx"), exports);
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
/***/ }),
|
|
758
|
-
|
|
759
|
-
/***/ "@admin-layout/client":
|
|
760
|
-
/*!***************************************!*\
|
|
761
|
-
!*** external "@admin-layout/client" ***!
|
|
762
|
-
\***************************************/
|
|
763
|
-
/***/ ((module) => {
|
|
764
|
-
|
|
765
|
-
module.exports = require("@admin-layout/client");
|
|
766
|
-
|
|
767
|
-
/***/ }),
|
|
768
|
-
|
|
769
|
-
/***/ "@adminide-stack/user-auth0-client":
|
|
770
|
-
/*!****************************************************!*\
|
|
771
|
-
!*** external "@adminide-stack/user-auth0-client" ***!
|
|
772
|
-
\****************************************************/
|
|
773
|
-
/***/ ((module) => {
|
|
774
|
-
|
|
775
|
-
module.exports = require("@adminide-stack/user-auth0-client");
|
|
776
|
-
|
|
777
|
-
/***/ }),
|
|
778
|
-
|
|
779
|
-
/***/ "@common-stack/client-react":
|
|
780
|
-
/*!*********************************************!*\
|
|
781
|
-
!*** external "@common-stack/client-react" ***!
|
|
782
|
-
\*********************************************/
|
|
783
|
-
/***/ ((module) => {
|
|
784
|
-
|
|
785
|
-
module.exports = require("@common-stack/client-react");
|
|
786
|
-
|
|
787
|
-
/***/ }),
|
|
788
|
-
|
|
789
|
-
/***/ "@expo/vector-icons":
|
|
790
|
-
/*!*************************************!*\
|
|
791
|
-
!*** external "@expo/vector-icons" ***!
|
|
792
|
-
\*************************************/
|
|
793
|
-
/***/ ((module) => {
|
|
794
|
-
|
|
795
|
-
module.exports = require("@expo/vector-icons");
|
|
796
|
-
|
|
797
|
-
/***/ }),
|
|
798
|
-
|
|
799
|
-
/***/ "@messenger-box/platform-client":
|
|
800
|
-
/*!*************************************************!*\
|
|
801
|
-
!*** external "@messenger-box/platform-client" ***!
|
|
802
|
-
\*************************************************/
|
|
803
|
-
/***/ ((module) => {
|
|
804
|
-
|
|
805
|
-
module.exports = require("@messenger-box/platform-client");
|
|
806
|
-
|
|
807
|
-
/***/ }),
|
|
808
|
-
|
|
809
|
-
/***/ "@react-navigation/native":
|
|
810
|
-
/*!*******************************************!*\
|
|
811
|
-
!*** external "@react-navigation/native" ***!
|
|
812
|
-
\*******************************************/
|
|
813
|
-
/***/ ((module) => {
|
|
814
|
-
|
|
815
|
-
module.exports = require("@react-navigation/native");
|
|
816
|
-
|
|
817
|
-
/***/ }),
|
|
818
|
-
|
|
819
|
-
/***/ "@react-navigation/stack":
|
|
820
|
-
/*!******************************************!*\
|
|
821
|
-
!*** external "@react-navigation/stack" ***!
|
|
822
|
-
\******************************************/
|
|
823
|
-
/***/ ((module) => {
|
|
824
|
-
|
|
825
|
-
module.exports = require("@react-navigation/stack");
|
|
826
|
-
|
|
827
|
-
/***/ }),
|
|
828
|
-
|
|
829
|
-
/***/ "base-64":
|
|
830
|
-
/*!**************************!*\
|
|
831
|
-
!*** external "base-64" ***!
|
|
832
|
-
\**************************/
|
|
833
|
-
/***/ ((module) => {
|
|
834
|
-
|
|
835
|
-
module.exports = require("base-64");
|
|
836
|
-
|
|
837
|
-
/***/ }),
|
|
838
|
-
|
|
839
|
-
/***/ "date-fns":
|
|
840
|
-
/*!***************************!*\
|
|
841
|
-
!*** external "date-fns" ***!
|
|
842
|
-
\***************************/
|
|
843
|
-
/***/ ((module) => {
|
|
844
|
-
|
|
845
|
-
module.exports = require("date-fns");
|
|
846
|
-
|
|
847
|
-
/***/ }),
|
|
848
|
-
|
|
849
|
-
/***/ "envalid":
|
|
850
|
-
/*!**************************!*\
|
|
851
|
-
!*** external "envalid" ***!
|
|
852
|
-
\**************************/
|
|
853
|
-
/***/ ((module) => {
|
|
854
|
-
|
|
855
|
-
module.exports = require("envalid");
|
|
856
|
-
|
|
857
|
-
/***/ }),
|
|
858
|
-
|
|
859
|
-
/***/ "expo-image-picker":
|
|
860
|
-
/*!************************************!*\
|
|
861
|
-
!*** external "expo-image-picker" ***!
|
|
862
|
-
\************************************/
|
|
863
|
-
/***/ ((module) => {
|
|
864
|
-
|
|
865
|
-
module.exports = require("expo-image-picker");
|
|
866
|
-
|
|
867
|
-
/***/ }),
|
|
868
|
-
|
|
869
|
-
/***/ "lodash":
|
|
870
|
-
/*!*************************!*\
|
|
871
|
-
!*** external "lodash" ***!
|
|
872
|
-
\*************************/
|
|
873
|
-
/***/ ((module) => {
|
|
874
|
-
|
|
875
|
-
module.exports = require("lodash");
|
|
876
|
-
|
|
877
|
-
/***/ }),
|
|
878
|
-
|
|
879
|
-
/***/ "native-base":
|
|
880
|
-
/*!******************************!*\
|
|
881
|
-
!*** external "native-base" ***!
|
|
882
|
-
\******************************/
|
|
883
|
-
/***/ ((module) => {
|
|
884
|
-
|
|
885
|
-
module.exports = require("native-base");
|
|
886
|
-
|
|
887
|
-
/***/ }),
|
|
888
|
-
|
|
889
|
-
/***/ "react":
|
|
890
|
-
/*!************************!*\
|
|
891
|
-
!*** external "react" ***!
|
|
892
|
-
\************************/
|
|
893
|
-
/***/ ((module) => {
|
|
894
|
-
|
|
895
|
-
module.exports = require("react");
|
|
896
|
-
|
|
897
|
-
/***/ }),
|
|
898
|
-
|
|
899
|
-
/***/ "react-native-gifted-chat":
|
|
900
|
-
/*!*******************************************!*\
|
|
901
|
-
!*** external "react-native-gifted-chat" ***!
|
|
902
|
-
\*******************************************/
|
|
903
|
-
/***/ ((module) => {
|
|
904
|
-
|
|
905
|
-
module.exports = require("react-native-gifted-chat");
|
|
906
|
-
|
|
907
|
-
/***/ }),
|
|
908
|
-
|
|
909
|
-
/***/ "react-redux":
|
|
910
|
-
/*!******************************!*\
|
|
911
|
-
!*** external "react-redux" ***!
|
|
912
|
-
\******************************/
|
|
913
|
-
/***/ ((module) => {
|
|
914
|
-
|
|
915
|
-
module.exports = require("react-redux");
|
|
916
|
-
|
|
917
|
-
/***/ })
|
|
918
|
-
|
|
919
|
-
/******/ });
|
|
920
|
-
/************************************************************************/
|
|
921
|
-
/******/ // The module cache
|
|
922
|
-
/******/ var __webpack_module_cache__ = {};
|
|
923
|
-
/******/
|
|
924
|
-
/******/ // The require function
|
|
925
|
-
/******/ function __webpack_require__(moduleId) {
|
|
926
|
-
/******/ // Check if module is in cache
|
|
927
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
928
|
-
/******/ if (cachedModule !== undefined) {
|
|
929
|
-
/******/ return cachedModule.exports;
|
|
930
|
-
/******/ }
|
|
931
|
-
/******/ // Create a new module (and put it into the cache)
|
|
932
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
933
|
-
/******/ // no module.id needed
|
|
934
|
-
/******/ // no module.loaded needed
|
|
935
|
-
/******/ exports: {}
|
|
936
|
-
/******/ };
|
|
937
|
-
/******/
|
|
938
|
-
/******/ // Execute the module function
|
|
939
|
-
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
940
|
-
/******/
|
|
941
|
-
/******/ // Return the exports of the module
|
|
942
|
-
/******/ return module.exports;
|
|
943
|
-
/******/ }
|
|
944
|
-
/******/
|
|
945
|
-
/************************************************************************/
|
|
946
|
-
/******/
|
|
947
|
-
/******/ // startup
|
|
948
|
-
/******/ // Load entry module and return exports
|
|
949
|
-
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
950
|
-
/******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
|
|
951
|
-
/******/ module.exports = __webpack_exports__;
|
|
952
|
-
/******/
|
|
953
|
-
/******/ })()
|
|
954
|
-
;
|
|
955
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yFAAsC;AAEtC,2GAAqD;AAErD,qBAAe,IAAI,sBAAO,CAAC,gBAAc,CAAC,CAAC;AAC3C,4FAA6B;AAC7B,sFAA0B;;;;;;;;;;;;;ACN1B,sDAAsD;AACtD,2GAAqD;AACrD,sHAAyF;AAEzF,qBAAe,IAAI,sBAAO,CAAC;IACvB,gBAAgB,EAAhB,kCAAgB;IAChB,iBAAiB,EAAE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AY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,cAAc,EAClC,SAAS,EAAE,kBAAkB,EAC7B,UAAU,EAAE,mBAAmB,EAC/B,qBAAqB,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAC5C,sBAAsB,EAAE,GAAG,EAAE,CAAC,8BAAC,iBAAG,IAAC,MAAM,EAAC,KAAK,EAAC,eAAe,EAAC,UAAU,GAAG,EAC7E,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC/B,8BAAC,iCAAe,IACZ,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EACtB,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,GACtC,CACL,GACH,CACH,CACN,CACC,CACT,CAAC;AACN,CAAC;AAhGD,0BAgGC;;;;;;;;;;;;;;;;;;;;;;;;;;;AChHD,iGAA8B;;;;;;;;;;;ACA9B;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;UEtBA;UACA;UACA;UACA","sources":["webpack://@messenger-box/platform-mobile/./src/index.ts","webpack://@messenger-box/platform-mobile/./src/module.ts","webpack://@messenger-box/platform-mobile/./src/navigation/InboxNavigation.tsx","webpack://@messenger-box/platform-mobile/./src/navigation/index.ts","webpack://@messenger-box/platform-mobile/./src/screens/inbox/DialogMessages.tsx","webpack://@messenger-box/platform-mobile/./src/screens/inbox/Inbox.tsx","webpack://@messenger-box/platform-mobile/./src/screens/inbox/components/DialogsListItem.tsx","webpack://@messenger-box/platform-mobile/./src/screens/inbox/config/config.ts","webpack://@messenger-box/platform-mobile/./src/screens/inbox/config/index.ts","webpack://@messenger-box/platform-mobile/./src/screens/inbox/containers/ConversationView.tsx","webpack://@messenger-box/platform-mobile/./src/screens/inbox/containers/Dialogs.tsx","webpack://@messenger-box/platform-mobile/./src/screens/index.ts","webpack://@messenger-box/platform-mobile/external commonjs \"@admin-layout/client\"","webpack://@messenger-box/platform-mobile/external commonjs \"@adminide-stack/user-auth0-client\"","webpack://@messenger-box/platform-mobile/external commonjs \"@common-stack/client-react\"","webpack://@messenger-box/platform-mobile/external commonjs \"@expo/vector-icons\"","webpack://@messenger-box/platform-mobile/external commonjs \"@messenger-box/platform-client\"","webpack://@messenger-box/platform-mobile/external commonjs \"@react-navigation/native\"","webpack://@messenger-box/platform-mobile/external commonjs \"@react-navigation/stack\"","webpack://@messenger-box/platform-mobile/external commonjs \"base-64\"","webpack://@messenger-box/platform-mobile/external commonjs \"date-fns\"","webpack://@messenger-box/platform-mobile/external commonjs \"envalid\"","webpack://@messenger-box/platform-mobile/external commonjs \"expo-image-picker\"","webpack://@messenger-box/platform-mobile/external commonjs \"lodash\"","webpack://@messenger-box/platform-mobile/external commonjs \"native-base\"","webpack://@messenger-box/platform-mobile/external commonjs \"react\"","webpack://@messenger-box/platform-mobile/external commonjs \"react-native-gifted-chat\"","webpack://@messenger-box/platform-mobile/external commonjs \"react-redux\"","webpack://@messenger-box/platform-mobile/webpack/bootstrap","webpack://@messenger-box/platform-mobile/webpack/before-startup","webpack://@messenger-box/platform-mobile/webpack/startup","webpack://@messenger-box/platform-mobile/webpack/after-startup"],"sourcesContent":["import PlatformModule from './module';\n\nimport { Feature } from '@common-stack/client-react';\n\nexport default new Feature(PlatformModule);\nexport * from './navigation';\nexport * from './screens';\n","/* eslint-disable import/no-extraneous-dependencies */\nimport { Feature } from '@common-stack/client-react';\nimport { schema, typePolicies, dataIdFromObject } from '@messenger-box/platform-client';\n\nexport default new Feature({\n dataIdFromObject,\n clientStateParams: { typeDefs: schema, typePolicies },\n});\n","import * as React from 'react';\nimport { createStackNavigator } from '@react-navigation/stack';\nimport { DialogMessages } from '../screens/inbox/DialogMessages';\n\nconst InboxStack = createStackNavigator();\n\nexport function InboxNavigation({ route }) {\n return (\n <InboxStack.Navigator initialRouteName=\"DialogMessages\">\n <InboxStack.Screen name=\"DialogMessages\" options={{ header: () => null }}>\n {(props) => <DialogMessages channelId={route?.params?.channelId} />}\n </InboxStack.Screen>\n </InboxStack.Navigator>\n );\n}\n","export * from './InboxNavigation';\n","import * as React from 'react';\nimport { Box } from 'native-base';\nimport { ConversationView } from './containers/ConversationView';\n\nexport function DialogMessages({ channelId }) {\n return (\n <Box bg={'white'} flex={1}>\n <ConversationView channelId={channelId} />\n </Box>\n );\n}\n","import * as React from 'react';\nimport { Box } from 'native-base';\n\nimport { Dialogs } from './containers/Dialogs';\n\nexport const Inbox = (props) => {\n const { channelFilters, channelRole } = props;\n return (\n <Box bg={'white'} flex={1}>\n <Dialogs channelFilters={channelFilters} channelRole={channelRole} />\n </Box>\n );\n};\n","import React, { useMemo } from 'react';\nimport { Text, Image, Pressable, HStack, Box, Avatar } from 'native-base';\nimport { format, isToday, isYesterday } from 'date-fns';\n\nimport { IChannel, IUserAccount, useMessagesQuery, useUserAccountQuery } from '@messenger-box/platform-client';\nimport { startCase } from 'lodash';\n\nconst createdAtText = (value: string) => {\n if (!value) return '';\n let date = new Date(value);\n if (isToday(date)) return 'Today';\n if (isYesterday(date)) return 'Yesterday';\n return format(new Date(value), 'MMM dd, yyyy');\n};\n\nexport interface IDialogListChannel extends IChannel {\n users: IUserAccount[];\n}\n\nexport interface IDialogListItemProps {\n currentUser?: any;\n users?: any;\n selectedChannelId?: any;\n channel?: any;\n onOpen: (id: any) => void;\n}\n\n/**\n * TODO:\n * - Get Reservation info: reservation date, status\n * - Add ability to get property information: name, logo\n */\nexport const DialogsListItem: React.FC<IDialogListItemProps> = function DialogsListItem({\n currentUser,\n users,\n selectedChannelId,\n channel,\n onOpen,\n}) {\n const { data: messagesQuery, loading: messageLoading } = useMessagesQuery({\n variables: {\n channelId: channel?.id?.toString(),\n limit: 1,\n },\n fetchPolicy: 'cache-and-network',\n });\n\n const chatUser = useMemo(\n () =>\n users?.find(({ id }) => {\n const isNotCurrentUser = id !== currentUser?.id;\n if (isNotCurrentUser) {\n return channel?.members?.find(({ user }: any) => user.id === id);\n }\n return isNotCurrentUser;\n }),\n [users, currentUser, channel],\n );\n\n const { data: userQuery } = useUserAccountQuery({\n variables: {\n userId: chatUser?.id,\n },\n skip: !chatUser?.id,\n });\n\n const lastMessage = useMemo(() => {\n if (!messagesQuery?.messages?.data?.length) {\n return null;\n }\n const { data } = messagesQuery.messages;\n return data[data.length - 1];\n }, [messagesQuery]);\n\n const channelType = useMemo(() => {\n return channel?.type;\n }, [channel]);\n\n return (\n <Pressable\n onPress={() => channel?.id !== selectedChannelId && onOpen(channel?.id)}\n borderWidth={'1'}\n borderRadius={10}\n borderColor={'gray.200'}\n _dark={{\n borderColor: 'coolGray.600',\n backgroundColor: 'gray.700',\n }}\n _web={{\n shadow: 2,\n borderWidth: 0,\n }}\n _light={{\n backgroundColor: 'gray.50',\n }}\n >\n <HStack m={3} space={2}>\n <Avatar\n size={'lg'}\n source={{\n uri: userQuery?.getUserAccount.picture,\n }}\n >\n {startCase(userQuery?.getUserAccount.username.charAt(0))}\n </Avatar>\n <Box width={'80%'}>\n <HStack alignItems=\"center\" justifyContent=\"space-between\">\n <Text fontSize=\"xs\" color=\"red.500\">\n {channelType}\n </Text>\n <Text color=\"gray.500\">{lastMessage ? createdAtText(lastMessage?.createdAt) : ''}</Text>\n </HStack>\n <Text color=\"gray.600\" fontSize=\"lg\" fontWeight=\"semibold\">\n {chatUser?.givenName + ' ' + chatUser?.familyName}\n </Text>\n <Text color=\"gray.600\">{lastMessage?.message}</Text>\n </Box>\n </HStack>\n </Pressable>\n );\n};\n","import { cleanEnv, num } from 'envalid';\n\nexport const config = cleanEnv(process.env, {\n MESSAGES_PER_PAGE: num({ devDefault: 10, default: 20 }),\n FILES_PER_MESSAGE: num({ default: 10 }),\n});\n","export { config } from './config';\n","import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Box, Button, HStack, Icon, Image, Spinner, Text, useColorModeValue } from 'native-base';\nimport { useNavigation } from '@react-navigation/native';\nimport { useSelector } from 'react-redux';\nimport { orderBy, uniqBy } from 'lodash';\nimport * as ImagePicker from 'expo-image-picker';\nimport { encode as atob } from 'base-64';\nimport { Ionicons, MaterialCommunityIcons } from '@expo/vector-icons';\nimport { Actions, GiftedChat, IMessage, MessageText, Send } from 'react-native-gifted-chat';\nimport {\n useCheckForNewMessagesQuery,\n useGetAllUsersQuery,\n useMessagesQuery,\n useSendMessagesMutation,\n useUploadFiles,\n} from '@messenger-box/platform-client';\nimport { IFileInfo } from '@messenger-box/core';\nimport { config } from '../config';\nimport { userSelector } from '@adminide-stack/user-auth0-client';\n\nconst { MESSAGES_PER_PAGE } = config;\n\ninterface IMessageProps extends IMessage {\n type: string;\n propsConfiguration?: any;\n}\n\nexport interface AlertMessageAttachmentsInterface {\n title: string;\n isTitleHtml: boolean;\n icon: string;\n callToAction: {\n title: string;\n link: string;\n };\n}\n\nexport function ConversationView({ channelId }: any) {\n const [channelToTop, setChannelToTop] = useState(0);\n const [channelMessages, setChannelMessages] = useState<any>([]);\n const auth = useSelector(userSelector);\n const [totalCount, setTotalCount] = useState<any>(0);\n const [selectedImage, setImage] = useState<string>('');\n const [loadingOldMessages, setLoadingOldMessages] = useState(false);\n const color = useColorModeValue('white', 'black');\n const navigation = useNavigation<any>();\n const [files, setFiles] = useState<File[]>([]);\n const [images, setImages] = useState<ImagePicker.ImageInfo[]>([]);\n\n const { startUpload } = useUploadFiles();\n\n const [sendMsg] = useSendMessagesMutation();\n\n const {\n data,\n loading: messageLoading,\n refetch,\n } = useMessagesQuery({\n variables: {\n channelId: channelId?.toString(),\n limit: MESSAGES_PER_PAGE,\n },\n skip: !channelId,\n fetchPolicy: 'cache-and-network',\n });\n\n const { data: users } = useGetAllUsersQuery();\n\n const currentUser = useMemo(\n () => users?.getUsers?.find(({ alias }: any) => alias.includes(auth?.auth0UserId)),\n [users, auth],\n );\n\n const { data: checkForMessages } = useCheckForNewMessagesQuery({\n variables: {\n channelId: channelId?.toString(),\n },\n skip: !channelId,\n fetchPolicy: 'network-only',\n pollInterval: 5000,\n });\n\n useEffect(() => {\n if (data?.messages?.data && (loadingOldMessages || channelMessages.length === 0)) {\n const { data: messages, totalCount } = data.messages;\n setChannelMessages((oldMessages) => uniqBy\n ([...messages, ...oldMessages], ({ id }) => id));\n setTotalCount(totalCount);\n }\n }, [data, loadingOldMessages, channelMessages]);\n\n useEffect(() => {\n if (checkForMessages?.messages?.totalCount > totalCount) {\n const numberOfNewMessages = checkForMessages?.messages?.totalCount - totalCount;\n refetch({\n limit: numberOfNewMessages,\n }).then(({ data }) => {\n if (!data?.messages) {\n return;\n }\n const { data: messages, totalCount } = data.messages;\n setTotalCount(totalCount);\n setChannelMessages((oldMessages) => uniqBy([\n ...oldMessages,\n ...messages\n ], ({ id }) => id));\n });\n }\n }, [checkForMessages, totalCount, refetch]);\n\n const onFetchOld = useCallback(() => {\n if (data?.messages?.totalCount > channelMessages.length) {\n setLoadingOldMessages(true);\n refetch({ skip: channelMessages.length });\n }\n }, [data, channelMessages]);\n\n const isCloseToTop = ({ layoutMeasurement, contentOffset, contentSize }) => {\n return contentOffset.y <= 100; // 100px from top\n };\n\n const dataURLtoFile = (dataurl, filename) => {\n var arr = dataurl.split(','),\n mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]),\n n = bstr.length,\n u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n return new File([u8arr], filename, { type: mime });\n };\n\n const onSelectImages = async () => {\n let imageSource: any = await ImagePicker.launchImageLibraryAsync({\n mediaTypes: ImagePicker.MediaTypeOptions.Images,\n allowsEditing: true,\n aspect: [4, 3],\n quality: 1,\n base64: true,\n });\n if (!imageSource.cancelled) {\n const image = 'data:image/jpeg;base64,' + imageSource?.base64;\n setImage(image);\n const file = dataURLtoFile(image, 'inputImage.jpg');\n setFiles((files) => files.concat(file));\n setImages((images) => images.concat(imageSource as ImagePicker.ImageInfo));\n }\n };\n\n const handleSend = useCallback(\n async (message: string) => {\n if (!(message && channelId)) {\n return;\n }\n const { data } = await sendMsg({\n variables: {\n channelId,\n content: message,\n },\n update: (cache, { data, errors }) => {\n if (!data || errors) {\n return;\n }\n setChannelMessages((messages) => [...messages, data?.sendMessage]);\n setTotalCount((t) => t + 1);\n setChannelToTop(channelToTop + 1);\n },\n });\n if (images && data?.sendMessage?.id) {\n const { id: postId } = data.sendMessage;\n const uploadResponse = await startUpload({\n file: images,\n saveUploadedFile: {\n variables: {\n postId,\n },\n },\n createUploadLink: {\n variables: {\n postId,\n },\n },\n });\n const uploadedFiles = uploadResponse.data as unknown as IFileInfo[];\n if (uploadResponse.data) {\n setFiles([]);\n setImage('');\n }\n setChannelMessages((messages) =>\n messages.map((message) => {\n if (message.id === postId) {\n return {\n ...message,\n files: {\n totalCount: uploadedFiles.length,\n data: uploadedFiles,\n },\n };\n }\n return message;\n }),\n );\n }\n },\n [setChannelMessages, currentUser, channelId, images],\n );\n\n const messageList = useMemo(() => {\n let currentDate = '';\n let res: any = [];\n if (channelMessages.length) {\n orderBy(channelMessages, ['createdAt'], ['desc']).map((msg) => {\n let message: IMessageProps = {\n _id: '',\n text: '',\n createdAt: 0,\n user: {\n _id: '',\n name: '',\n avatar: '',\n },\n type: '',\n };\n const date = new Date(msg.createdAt);\n message._id = msg.id;\n message.text = msg.message;\n message.createdAt = date;\n (message.user = {\n _id: msg.author.id,\n name: msg.author.givenName + msg.author.familyName,\n avatar: msg.author?.picture,\n }),\n (message.image = msg.files?.data[0]?.url),\n (message.sent = msg?.isDelivered),\n (message.received = msg?.isRead);\n message.type = msg?.type;\n message.propsConfiguration = msg?.propsConfiguration;\n res.push(message);\n });\n }\n return res;\n }, [channelMessages]);\n\n const renderSend = (props) => {\n return (\n <Send {...props}>\n <Box>\n <MaterialCommunityIcons\n name=\"send-circle\"\n style={{ marginBottom: 5, marginRight: 5 }}\n size={32}\n color=\"#2e64e5\"\n />\n </Box>\n </Send>\n );\n };\n\n const renderMessageText = (props) => {\n const { currentMessage } = props;\n if (currentMessage.type === 'ALERT') {\n const attachment = currentMessage?.propsConfiguration?.contents?.attachment;\n let action: string = '';\n let actionId: any = '';\n if (attachment?.callToAction?.link?.includes('my-reservation-details')) {\n action = 'm-reservation-detail';\n actionId = attachment?.callToAction?.link.split('/').pop();\n }\n return (\n <Box>\n {attachment?.callToAction ? (\n <Button\n variant={'outline'}\n size={'sm'}\n borderColor={color}\n onPress={() => navigation.navigate(action, { reservationId: actionId })}\n >\n <Text color={color}>{attachment.callToAction.title}</Text>\n </Button>\n ) : null}\n <MessageText {...props} />\n </Box>\n );\n } else {\n return <MessageText {...props} />;\n }\n };\n\n const renderActions = (props) => {\n return (\n <Actions\n {...props}\n icon={() => <Icon as={Ionicons} name={'image'} size={'lg'} color={'black'} onPress={onSelectImages} />}\n />\n );\n };\n\n const renderAccessory = (props) => {\n return (\n <Box>\n {selectedImage !== '' ? (\n <HStack alignItems={'center'}>\n <Image ml={3} key={selectedImage} alt={'image'} source={{ uri: selectedImage }} size={'xs'} />\n <Button\n variant={'ghost'}\n colorScheme={'secondary'}\n onPress={() => {\n setFiles([]);\n setImage('');\n setImages([]);\n }}\n >\n Cancel\n </Button>\n </HStack>\n ) : null}\n </Box>\n );\n };\n\n return (\n <GiftedChat\n wrapInSafeArea={false}\n renderLoading={() => <Spinner />}\n messages={messageList}\n onSend={(messages) => {\n handleSend(messages[0].text);\n }}\n scrollToBottom\n user={{\n _id: currentUser?.id || '',\n }}\n isTyping\n alwaysShowSend\n onLoadEarlier={onFetchOld}\n infiniteScroll={true}\n renderSend={renderSend}\n loadEarlier={channelMessages.length !== data?.messages?.totalCount}\n renderMessageText={renderMessageText}\n minInputToolbarHeight={50}\n renderActions={renderActions}\n renderAccessory={renderAccessory}\n />\n );\n}\n","import React, { useCallback, useMemo, useEffect } from 'react';\nimport { FlatList, Box, Heading, Input, Text, Icon, Center } from 'native-base';\nimport { Ionicons } from '@expo/vector-icons';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { useNavigation, useRoute } from '@react-navigation/native';\n\nimport { DialogsListItem } from '../components/DialogsListItem';\nimport { useGetAllUsersQuery, useGetChannelsByUserQuery } from '@messenger-box/platform-client';\nimport { userSelector } from '@adminide-stack/user-auth0-client';\nimport { CHANGE_SETTINGS_ACTION } from '@admin-layout/client';\n\nexport interface InboxProps {\n channelFilters?: Record<string, unknown>;\n channelRole?: string;\n}\n\nexport function Dialogs(props: InboxProps) {\n const { channelFilters, channelRole } = props;\n const { params } = useRoute<any>();\n const auth = useSelector(userSelector);\n const dispatch = useDispatch();\n const navigation = useNavigation<any>();\n\n const {\n data: userChannels,\n loading: userChannelsLoading,\n refetch: getChannelsRefetch,\n } = useGetChannelsByUserQuery({\n variables: {\n role: channelRole,\n criteria: channelFilters,\n },\n });\n\n const { data: users } = useGetAllUsersQuery();\n\n const currentUser = useMemo(\n () => users?.getUsers?.find(({ alias }: any) => alias.includes(auth?.auth0UserId)),\n [users, auth],\n );\n\n useEffect(() => {\n getChannelsRefetch();\n }, []);\n\n useEffect(() => {\n setTimeout(() => {\n dispatch({\n type: CHANGE_SETTINGS_ACTION,\n payload: {\n footerRender: false,\n },\n } as any);\n }, 0);\n return () => {\n dispatch({\n type: CHANGE_SETTINGS_ACTION,\n payload: {\n footerRender: true,\n },\n } as any);\n };\n }, []);\n\n const handleSelectChannel = useCallback((id: any) => {\n if (params?.channelId) {\n navigation.navigate('Inbox.DialogMessages' as any, { channelId: params?.channelId, hideTabBar: true });\n } else {\n navigation.navigate('Inbox.DialogMessages' as any, { channelId: id, hideTabBar: true });\n }\n }, []);\n\n return (\n <Box p={2}>\n {!userChannels?.channelsByUser?.length ? (\n <Box p={5}>\n <Heading>Chat</Heading>\n <Input\n height={50}\n mt={3}\n placeholder=\"Search\"\n borderRadius={50}\n borderColor={'gray.200'}\n borderWidth={2}\n />\n <Center mt={6}>\n <Icon as={Ionicons} name=\"chatbubbles\" size={'xl'} />\n <Text>You don't have any messages yet!</Text>\n </Center>\n </Box>\n ) : (\n <>\n <FlatList\n data={userChannels?.channelsByUser}\n onRefresh={getChannelsRefetch}\n refreshing={userChannelsLoading}\n contentContainerStyle={{ minHeight: '100%' }}\n ItemSeparatorComponent={() => <Box height=\"0.5\" backgroundColor=\"gray.200\" />}\n renderItem={({ item: channel }) => (\n <DialogsListItem\n users={users?.getUsers}\n onOpen={handleSelectChannel}\n currentUser={currentUser}\n channel={channel}\n selectedChannelId={params?.channelId}\n />\n )}\n />\n </>\n )}\n </Box>\n );\n}\n","export * from './inbox/Inbox';\n","module.exports = require(\"@admin-layout/client\");","module.exports = require(\"@adminide-stack/user-auth0-client\");","module.exports = require(\"@common-stack/client-react\");","module.exports = require(\"@expo/vector-icons\");","module.exports = require(\"@messenger-box/platform-client\");","module.exports = require(\"@react-navigation/native\");","module.exports = require(\"@react-navigation/stack\");","module.exports = require(\"base-64\");","module.exports = require(\"date-fns\");","module.exports = require(\"envalid\");","module.exports = require(\"expo-image-picker\");","module.exports = require(\"lodash\");","module.exports = require(\"native-base\");","module.exports = require(\"react\");","module.exports = require(\"react-native-gifted-chat\");","module.exports = require(\"react-redux\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/index.ts\");\n",""],"names":[],"sourceRoot":""}
|
package/lib/module.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './InboxNavigation';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Inbox: (props: any) => JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { IChannel, IUserAccount } from '@messenger-box/platform-client';
|
|
3
|
-
export interface IDialogListChannel extends IChannel {
|
|
4
|
-
users: IUserAccount[];
|
|
5
|
-
}
|
|
6
|
-
export interface IDialogListItemProps {
|
|
7
|
-
currentUser?: any;
|
|
8
|
-
users?: any;
|
|
9
|
-
selectedChannelId?: any;
|
|
10
|
-
channel?: any;
|
|
11
|
-
onOpen: (id: any) => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* TODO:
|
|
15
|
-
* - Get Reservation info: reservation date, status
|
|
16
|
-
* - Add ability to get property information: name, logo
|
|
17
|
-
*/
|
|
18
|
-
export declare const DialogsListItem: React.FC<IDialogListItemProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { config } from './config';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface AlertMessageAttachmentsInterface {
|
|
3
|
-
title: string;
|
|
4
|
-
isTitleHtml: boolean;
|
|
5
|
-
icon: string;
|
|
6
|
-
callToAction: {
|
|
7
|
-
title: string;
|
|
8
|
-
link: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare function ConversationView({ channelId }: any): JSX.Element;
|
package/lib/screens/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './inbox/Inbox';
|