@messenger-box/platform-mobile 0.0.1-alpha.481 → 0.0.1-alpha.482

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 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.482](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.481...v0.0.1-alpha.482) (2024-03-04)
7
+
8
+ **Note:** Version bump only for package @messenger-box/platform-mobile
9
+
6
10
  ## [0.0.1-alpha.481](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.480...v0.0.1-alpha.481) (2024-03-02)
7
11
 
8
12
  **Note:** Version bump only for package @messenger-box/platform-mobile
package/lib/index.js CHANGED
@@ -99,10 +99,10 @@ const inboxConfig = {
99
99
  exact: true,
100
100
  name: 'Message',
101
101
  props: {
102
- initialParams: { channelId: null, role: null },
102
+ initialParams: { channelId: null, role: null, isShowThreadMessage: true },
103
103
  component: (props) => {
104
- var _a, _b, _c, _d;
105
- return (React.createElement(DialogMessages_1.DialogMessages, Object.assign({}, props, { channelId: (_b = (_a = props === null || props === void 0 ? void 0 : props.route) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.channelId, role: (_d = (_c = props === null || props === void 0 ? void 0 : props.route) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.role })));
104
+ var _a, _b, _c, _d, _e, _f;
105
+ return (React.createElement(DialogMessages_1.DialogMessages, Object.assign({}, props, { channelId: (_b = (_a = props === null || props === void 0 ? void 0 : props.route) === null || _a === void 0 ? void 0 : _a.params) === null || _b === void 0 ? void 0 : _b.channelId, role: (_d = (_c = props === null || props === void 0 ? void 0 : props.route) === null || _c === void 0 ? void 0 : _c.params) === null || _d === void 0 ? void 0 : _d.role, isShowThreadMessage: (_f = (_e = props === null || props === void 0 ? void 0 : props.route) === null || _e === void 0 ? void 0 : _e.params) === null || _f === void 0 ? void 0 : _f.isShowThreadMessage })));
106
106
  },
107
107
  options: ({ navigation }) => {
108
108
  return {
@@ -240,11 +240,11 @@ const React = __importStar(__webpack_require__(/*! react */ "react"));
240
240
  const native_base_1 = __webpack_require__(/*! native-base */ "native-base");
241
241
  const ConversationView_1 = __webpack_require__(/*! ./containers/ConversationView */ "./src/screens/inbox/containers/ConversationView.tsx");
242
242
  function DialogMessages(_a) {
243
- var { channelId, role } = _a, rest = __rest(_a, ["channelId", "role"]);
243
+ var { channelId, role, isShowThreadMessage = true } = _a, rest = __rest(_a, ["channelId", "role", "isShowThreadMessage"]);
244
244
  return (
245
245
  // <Box bg={'white'} flex={1} pt={5}>
246
246
  React.createElement(native_base_1.Box, { bg: 'white', flex: 1 },
247
- React.createElement(ConversationView_1.ConversationView, Object.assign({}, rest, { channelId: channelId, role: role }))));
247
+ React.createElement(ConversationView_1.ConversationView, Object.assign({}, rest, { channelId: channelId, role: role, isShowThreadMessage: isShowThreadMessage }))));
248
248
  }
249
249
  exports.DialogMessages = DialogMessages;
250
250
 
@@ -1801,7 +1801,7 @@ const createdAtText = (value) => {
1801
1801
  };
1802
1802
  const ConversationViewComponent = (_a) => {
1803
1803
  var _b, _c;
1804
- var { channelId: ChannelId, role } = _a, rest = __rest(_a, ["channelId", "role"]);
1804
+ var { channelId: ChannelId, role, isShowThreadMessage } = _a, rest = __rest(_a, ["channelId", "role", "isShowThreadMessage"]);
1805
1805
  const [channelToTop, setChannelToTop] = (0, react_1.useState)(0);
1806
1806
  const [channelMessages, setChannelMessages] = (0, react_1.useState)([]);
1807
1807
  const auth = (0, react_redux_1.useSelector)(user_auth0_client_1.userSelector);
@@ -2106,6 +2106,7 @@ const ConversationViewComponent = (_a) => {
2106
2106
  message.type = msg === null || msg === void 0 ? void 0 : msg.type;
2107
2107
  message.propsConfiguration = msg === null || msg === void 0 ? void 0 : msg.propsConfiguration;
2108
2108
  message.replies = (_d = msg === null || msg === void 0 ? void 0 : msg.replies) !== null && _d !== void 0 ? _d : [];
2109
+ message.isShowThreadMessage = isShowThreadMessage;
2109
2110
  res.push(message);
2110
2111
  });
2111
2112
  }
@@ -2156,12 +2157,15 @@ const ConversationViewComponent = (_a) => {
2156
2157
  react_1.default.createElement(native_base_1.Text, { color: CALL_TO_ACTION_TEXT_COLOR }, attachment.callToAction.title)),
2157
2158
  react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props, { textStyle: {
2158
2159
  left: { marginLeft: 5, color: CALL_TO_ACTION_TEXT_COLOR, paddingHorizontal: 2 },
2159
- } })))) : (react_1.default.createElement(react_native_1.TouchableHighlight, { underlayColor: '#c0c0c0', style: { width: '100%' }, onPress: () => navigation.navigate(config_1.config.THREAD_MESSEGE_PATH, {
2160
- channelId: channelId,
2161
- title: 'Message',
2162
- postParentId: currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage._id,
2163
- isPostParentIdThread: true,
2164
- }) },
2160
+ } })))) : (react_1.default.createElement(react_native_1.TouchableHighlight, { underlayColor: '#c0c0c0', style: { width: '100%' }, onPress: () => {
2161
+ if (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.isShowThreadMessage)
2162
+ navigation.navigate(config_1.config.THREAD_MESSEGE_PATH, {
2163
+ channelId: channelId,
2164
+ title: 'Message',
2165
+ postParentId: currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage._id,
2166
+ isPostParentIdThread: true,
2167
+ });
2168
+ } },
2165
2169
  react_1.default.createElement(react_1.default.Fragment, null,
2166
2170
  react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props, { textStyle: { left: { marginLeft: 5 } } })),
2167
2171
  ((_6 = (_5 = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _5 === void 0 ? void 0 : _5.data) === null || _6 === void 0 ? void 0 : _6.length) > 0 && (react_1.default.createElement(native_base_1.HStack, { space: 1, px: 1, alignItems: 'center' },
@@ -2186,12 +2190,15 @@ const ConversationViewComponent = (_a) => {
2186
2190
  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) : ''))))))));
2187
2191
  }
2188
2192
  else {
2189
- return (react_1.default.createElement(react_native_1.TouchableHighlight, { underlayColor: '#c0c0c0', style: { width: '100%' }, onPress: () => navigation.navigate(config_1.config.THREAD_MESSEGE_PATH, {
2190
- channelId: channelId,
2191
- title: 'Message',
2192
- postParentId: currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage._id,
2193
- isPostParentIdThread: true,
2194
- }) },
2193
+ return (react_1.default.createElement(react_native_1.TouchableHighlight, { underlayColor: '#c0c0c0', style: { width: '100%' }, onPress: () => {
2194
+ if (currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.isShowThreadMessage)
2195
+ navigation.navigate(config_1.config.THREAD_MESSEGE_PATH, {
2196
+ channelId: channelId,
2197
+ title: 'Message',
2198
+ postParentId: currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage._id,
2199
+ isPostParentIdThread: true,
2200
+ });
2201
+ } },
2195
2202
  react_1.default.createElement(react_1.default.Fragment, null,
2196
2203
  react_1.default.createElement(react_native_gifted_chat_1.MessageText, Object.assign({}, props, { textStyle: { left: { marginLeft: 5 } } })),
2197
2204
  ((_15 = (_14 = currentMessage === null || currentMessage === void 0 ? void 0 : currentMessage.replies) === null || _14 === void 0 ? void 0 : _14.data) === null || _15 === void 0 ? void 0 : _15.length) > 0 && (react_1.default.createElement(native_base_1.HStack, { space: 1, px: 1, alignItems: 'center' },
@@ -2501,11 +2508,13 @@ const DialogsComponent = (props) => {
2501
2508
  }
2502
2509
  }, []);
2503
2510
  const handleRefresh = (0, react_1.useCallback)(() => {
2511
+ var _a;
2504
2512
  //if(userChannels?.channelsByUser?.length != channels?.length)setRefresh(true);
2505
- getChannelsRefetch({ role: channelRole, criteria: channelFilters });
2513
+ setRefresh(true);
2514
+ (_a = getChannelsRefetch({ role: channelRole, criteria: channelFilters })) === null || _a === void 0 ? void 0 : _a.finally(() => setRefresh(false));
2506
2515
  }, []);
2507
2516
  return (react_1.default.createElement(native_base_1.Box, { p: 2, pt: (props === null || props === void 0 ? void 0 : props.supportServices) ? 0 : 2 },
2508
- react_1.default.createElement(native_base_1.FlatList, { data: channels && (channels === null || channels === void 0 ? void 0 : channels.length) > 0 ? channels : [], onRefresh: handleRefresh, 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, { onOpen: handleSelectChannel, currentUser: auth, channel: channel, selectedChannelId: params === null || params === void 0 ? void 0 : params.channelId })), ListEmptyComponent: () => (react_1.default.createElement(react_1.default.Fragment, null, userChannelsLoading ? (react_1.default.createElement(native_base_1.Spinner, null)) : (react_1.default.createElement(native_base_1.Box, { p: 5 },
2517
+ react_1.default.createElement(native_base_1.FlatList, { data: channels && (channels === null || channels === void 0 ? void 0 : channels.length) > 0 ? channels : [], onRefresh: handleRefresh, refreshing: refreshing, 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, { onOpen: handleSelectChannel, currentUser: auth, channel: channel, selectedChannelId: params === null || params === void 0 ? void 0 : params.channelId })), ListEmptyComponent: () => (react_1.default.createElement(react_1.default.Fragment, null, userChannelsLoading ? (react_1.default.createElement(native_base_1.Spinner, null)) : (react_1.default.createElement(native_base_1.Box, { p: 5 },
2509
2518
  react_1.default.createElement(native_base_1.Heading, null, "Chat"),
2510
2519
  react_1.default.createElement(native_base_1.Input, { height: 50, mt: 3, placeholder: "Search", borderRadius: 50, borderColor: 'gray.200', borderWidth: 2 }),
2511
2520
  react_1.default.createElement(native_base_1.Center, { mt: 6 },
@@ -2620,7 +2629,7 @@ const SupportServiceDialogsComponent = (props) => {
2620
2629
  (_a = getServiceChannelsRefetch({ criteria: { type: 'SERVICE' } })) === null || _a === void 0 ? void 0 : _a.then((res) => setRefresh(false));
2621
2630
  }, []);
2622
2631
  return (react_1.default.createElement(native_base_1.Box, { p: 2, pb: 0 },
2623
- react_1.default.createElement(native_base_1.FlatList, { data: channels && (channels === null || channels === void 0 ? void 0 : channels.length) > 0 ? channels : [], onRefresh: handleRefresh, refreshing: serviceChannelsLoading, contentContainerStyle: {}, ItemSeparatorComponent: () => react_1.default.createElement(native_base_1.Box, { height: "0.5", backgroundColor: "gray.200" }), renderItem: ({ item: channel }) => (react_1.default.createElement(SupportServiceDialogsListItem_1.SupportServiceDialogsListItem, { onOpen: handleSelectChannel, currentUser: auth, channel: channel, refreshing: refreshing, selectedChannelId: params === null || params === void 0 ? void 0 : params.channelId, role: channelRole })), keyExtractor: (item, index) => 'support-service-key' + index })));
2632
+ react_1.default.createElement(native_base_1.FlatList, { data: channels && (channels === null || channels === void 0 ? void 0 : channels.length) > 0 ? channels : [], onRefresh: handleRefresh, refreshing: refreshing, contentContainerStyle: {}, ItemSeparatorComponent: () => react_1.default.createElement(native_base_1.Box, { height: "0.5", backgroundColor: "gray.200" }), renderItem: ({ item: channel }) => (react_1.default.createElement(SupportServiceDialogsListItem_1.SupportServiceDialogsListItem, { onOpen: handleSelectChannel, currentUser: auth, channel: channel, refreshing: refreshing, selectedChannelId: params === null || params === void 0 ? void 0 : params.channelId, role: channelRole })), keyExtractor: (item, index) => 'support-service-key' + index })));
2624
2633
  };
2625
2634
  exports.SupportServiceDialogs = react_1.default.memo(SupportServiceDialogsComponent);
2626
2635