@messenger-box/platform-mobile 0.0.1-alpha.365 → 0.0.1-alpha.367
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 +4 -0
- package/lib/index.js +16 -9
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/src/screens/inbox/containers/ConversationView.tsx +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.367](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.366...v0.0.1-alpha.367) (2023-07-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @messenger-box/platform-mobile
|
|
9
|
+
|
|
6
10
|
## [0.0.1-alpha.365](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.364...v0.0.1-alpha.365) (2023-07-11)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @messenger-box/platform-mobile
|
package/lib/index.js
CHANGED
|
@@ -2356,23 +2356,30 @@ const ConversationViewComponent = ({ channelId }) => {
|
|
|
2356
2356
|
react_1.default.createElement(vector_icons_1.MaterialCommunityIcons, { name: "send-circle", style: { marginBottom: 5, marginRight: 5 }, size: 32, color: "#2e64e5" }))));
|
|
2357
2357
|
};
|
|
2358
2358
|
const renderMessageText = (props) => {
|
|
2359
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
2359
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
2360
2360
|
const { currentMessage } = props;
|
|
2361
2361
|
const lastReply = ((_b = (_a = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (_d = (_c = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d[0] : null;
|
|
2362
2362
|
if (currentMessage.type === 'ALERT') {
|
|
2363
2363
|
const attachment = (_f = (_e = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.propsConfiguration) === null || _e === void 0 ? void 0 : _e.contents) === null || _f === void 0 ? void 0 : _f.attachment;
|
|
2364
2364
|
let action = '';
|
|
2365
2365
|
let actionId = '';
|
|
2366
|
-
|
|
2366
|
+
let params = {};
|
|
2367
|
+
if ((_g = attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) === null || _g === void 0 ? void 0 : _g.route) {
|
|
2368
|
+
const { path, params: routeParams } = (_h = attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) === null || _h === void 0 ? void 0 : _h.route;
|
|
2369
|
+
action = path;
|
|
2370
|
+
params = Object.assign({}, routeParams);
|
|
2371
|
+
}
|
|
2372
|
+
else if ((_j = attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) === null || _j === void 0 ? void 0 : _j.link) {
|
|
2367
2373
|
action = CALL_TO_ACTION_PATH;
|
|
2368
|
-
actionId = (
|
|
2374
|
+
actionId = (_k = attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) === null || _k === void 0 ? void 0 : _k.link.split('/').pop();
|
|
2375
|
+
params = { reservationId: actionId };
|
|
2369
2376
|
}
|
|
2370
2377
|
// if (attachment?.callToAction?.link?.includes('my-reservation-details')) {
|
|
2371
2378
|
// action = 'm-reservation-detail';
|
|
2372
2379
|
// actionId = attachment?.callToAction?.link.split('/').pop();
|
|
2373
2380
|
// }
|
|
2374
2381
|
return (react_1.default.createElement(native_base_1.Box, { bg: CALL_TO_ACTION_BOX_BGCOLOR, borderRadius: 15, pb: 2 },
|
|
2375
|
-
(attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) ? (react_1.default.createElement(native_base_1.Button, { variant: 'outline', size: 'sm', borderColor: CALL_TO_ACTION_BUTTON_BORDERCOLOR, onPress: () => navigation.navigate(action,
|
|
2382
|
+
(attachment === null || attachment === void 0 ? void 0 : attachment.callToAction) ? (react_1.default.createElement(native_base_1.Button, { variant: 'outline', size: 'sm', borderColor: CALL_TO_ACTION_BUTTON_BORDERCOLOR, onPress: () => navigation.navigate(action, params) },
|
|
2376
2383
|
react_1.default.createElement(native_base_1.Text, { color: CALL_TO_ACTION_TEXT_COLOR }, attachment.callToAction.title))) : null,
|
|
2377
2384
|
react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props, { textStyle: { left: { marginLeft: 5, color: CALL_TO_ACTION_TEXT_COLOR, paddingHorizontal: 2 } } }))));
|
|
2378
2385
|
}
|
|
@@ -2385,8 +2392,8 @@ const ConversationViewComponent = ({ channelId }) => {
|
|
|
2385
2392
|
}) },
|
|
2386
2393
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
2387
2394
|
react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props, { textStyle: { left: { marginLeft: 5 } } })),
|
|
2388
|
-
((
|
|
2389
|
-
react_1.default.createElement(native_base_1.HStack, null, (_r = (_q = (_p = (_o =
|
|
2395
|
+
((_m = (_l = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.length) > 0 && (react_1.default.createElement(native_base_1.HStack, { space: 1, px: 1, alignItems: 'center' },
|
|
2396
|
+
react_1.default.createElement(native_base_1.HStack, null, (_s = (_r = (_q = (_p = (_o = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.filter((v, i, a) => a.findIndex((t) => { var _a, _b; return ((_a = t === null || t === void 0 ? void 0 : t.author) === null || _a === void 0 ? void 0 : _a.id) === ((_b = v === null || v === void 0 ? void 0 : v.author) === null || _b === void 0 ? void 0 : _b.id); }) === i)) === null || _q === void 0 ? void 0 : _q.slice(0, 2)) === null || _r === void 0 ? void 0 : _r.reverse()) === null || _s === void 0 ? void 0 : _s.map((p, i) => {
|
|
2390
2397
|
var _a, _b, _c;
|
|
2391
2398
|
return (react_1.default.createElement(native_base_1.Avatar, { key: 'key' + i, bg: 'transparent', size: 6,
|
|
2392
2399
|
// top={i == 1 ? 4 : 0}
|
|
@@ -2396,10 +2403,10 @@ const ConversationViewComponent = ({ channelId }) => {
|
|
|
2396
2403
|
uri: (_a = p === null || p === void 0 ? void 0 : p.author) === null || _a === void 0 ? void 0 : _a.picture,
|
|
2397
2404
|
} }, (0, lodash_1.startCase)((_c = (_b = p === null || p === void 0 ? void 0 : p.author) === null || _b === void 0 ? void 0 : _b.username) === null || _c === void 0 ? void 0 : _c.charAt(0))));
|
|
2398
2405
|
})),
|
|
2399
|
-
react_1.default.createElement(native_base_1.Text, { fontSize: 12, fontWeight: 'bold', color: 'blue.800' }, (
|
|
2400
|
-
|
|
2406
|
+
react_1.default.createElement(native_base_1.Text, { fontSize: 12, fontWeight: 'bold', color: 'blue.800' }, (_t = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _t === void 0 ? void 0 :
|
|
2407
|
+
_t.totalCount,
|
|
2401
2408
|
' ',
|
|
2402
|
-
((
|
|
2409
|
+
((_u = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _u === void 0 ? void 0 : _u.totalCount) == 1 ? 'reply' : 'replies'),
|
|
2403
2410
|
react_1.default.createElement(native_base_1.Text, { fontSize: 12, fontWeight: 'bold', color: 'gray.500' }, lastReply ? createdAtText(lastReply === null || lastReply === void 0 ? void 0 : lastReply.createdAt) : ''))))));
|
|
2404
2411
|
}
|
|
2405
2412
|
};
|