sceyt-chat-react-uikit 1.7.3-beta.3 → 1.7.3

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.
@@ -47,6 +47,7 @@ interface IChannelProps {
47
47
  MessageText: any;
48
48
  }) => any;
49
49
  doNotShowMessageDeliveryTypes: string[];
50
+ showPhoneNumber?: boolean;
50
51
  }
51
52
  declare const Channel: React.FC<IChannelProps>;
52
53
  export default Channel;
@@ -79,6 +79,7 @@ interface IChannelListProps {
79
79
  [key: string]: IContact;
80
80
  }, getFromContacts: boolean, warningColor: string, user: IUser, MessageText: any) => any;
81
81
  doNotShowMessageDeliveryTypes?: string[];
82
+ showPhoneNumber?: boolean;
82
83
  }
83
84
  declare const ChannelList: React.FC<IChannelListProps>;
84
85
  export default ChannelList;
package/index.js CHANGED
@@ -21484,6 +21484,7 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
21484
21484
  }), channel.lastReactedMessage && '"')))));
21485
21485
  };
21486
21486
  var Channel = function Channel(_ref3) {
21487
+ var _channel$members, _channel$members$, _channel$members$2;
21487
21488
  var channel = _ref3.channel,
21488
21489
  theme = _ref3.theme,
21489
21490
  _ref3$showAvatar = _ref3.showAvatar,
@@ -21510,7 +21511,8 @@ var Channel = function Channel(_ref3) {
21510
21511
  channelAvatarTextSize = _ref3.channelAvatarTextSize,
21511
21512
  setSelectedChannel = _ref3.setSelectedChannel,
21512
21513
  getCustomLatestMessage = _ref3.getCustomLatestMessage,
21513
- doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes;
21514
+ doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes,
21515
+ showPhoneNumber = _ref3.showPhoneNumber;
21514
21516
  var _useColor = useColors(),
21515
21517
  accentColor = _useColor[THEME_COLORS.ACCENT],
21516
21518
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -21703,7 +21705,7 @@ var Channel = function Channel(_ref3) {
21703
21705
  subjectLineHeight: channelSubjectLineHeight,
21704
21706
  subjectColor: channelSubjectColor || textPrimary,
21705
21707
  avatarSize: channelAvatarSize
21706
- }, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
21708
+ }, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? showPhoneNumber && (_channel$members = channel.members) !== null && _channel$members !== void 0 && _channel$members.length && (_channel$members$ = channel.members[0]) !== null && _channel$members$ !== void 0 && _channel$members$.id ? "+" + ((_channel$members$2 = channel.members[0]) === null || _channel$members$2 === void 0 ? void 0 : _channel$members$2.id) + " (You)" : 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
21707
21709
  color: notificationsIsMutedIconColor || iconInactive
21708
21710
  }, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), getCustomLatestMessage ? getCustomLatestMessageComponent({
21709
21711
  lastMessage: lastMessage,
@@ -23767,7 +23769,9 @@ var ChannelList = function ChannelList(_ref) {
23767
23769
  searchChannelsPadding = _ref.searchChannelsPadding,
23768
23770
  getCustomLatestMessage = _ref.getCustomLatestMessage,
23769
23771
  _ref$doNotShowMessage = _ref.doNotShowMessageDeliveryTypes,
23770
- doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage;
23772
+ doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage,
23773
+ _ref$showPhoneNumber = _ref.showPhoneNumber,
23774
+ showPhoneNumber = _ref$showPhoneNumber === void 0 ? false : _ref$showPhoneNumber;
23771
23775
  var _useColor = useColors(),
23772
23776
  background = _useColor[THEME_COLORS.BACKGROUND],
23773
23777
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -24078,7 +24082,8 @@ var ChannelList = function ChannelList(_ref) {
24078
24082
  contactsMap: contactsMap,
24079
24083
  setSelectedChannel: setSelectedChannel,
24080
24084
  getCustomLatestMessage: getCustomLatestMessage,
24081
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24085
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24086
+ showPhoneNumber: showPhoneNumber
24082
24087
  }));
24083
24088
  }))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
24084
24089
  color: textSecondary,
@@ -24115,7 +24120,8 @@ var ChannelList = function ChannelList(_ref) {
24115
24120
  contactsMap: contactsMap,
24116
24121
  setSelectedChannel: setSelectedChannel,
24117
24122
  getCustomLatestMessage: getCustomLatestMessage,
24118
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24123
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24124
+ showPhoneNumber: showPhoneNumber
24119
24125
  }));
24120
24126
  }))), !!(searchedChannels.contacts && searchedChannels.contacts.length) && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
24121
24127
  color: textSecondary,
@@ -24184,7 +24190,8 @@ var ChannelList = function ChannelList(_ref) {
24184
24190
  contactsMap: contactsMap,
24185
24191
  setSelectedChannel: setSelectedChannel,
24186
24192
  getCustomLatestMessage: getCustomLatestMessage,
24187
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24193
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24194
+ showPhoneNumber: showPhoneNumber
24188
24195
  }));
24189
24196
  }))))) : (/*#__PURE__*/React__default.createElement(NoData, {
24190
24197
  color: textSecondary,
@@ -24234,7 +24241,8 @@ var ChannelList = function ChannelList(_ref) {
24234
24241
  contactsMap: contactsMap,
24235
24242
  setSelectedChannel: setSelectedChannel,
24236
24243
  getCustomLatestMessage: getCustomLatestMessage,
24237
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24244
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24245
+ showPhoneNumber: showPhoneNumber
24238
24246
  }));
24239
24247
  }))), !!searchValue && (channelsLoading === LOADING_STATE.LOADED ? !((_searchedChannels$cha4 = searchedChannels.chats_groups) !== null && _searchedChannels$cha4 !== void 0 && _searchedChannels$cha4.length) && !((_searchedChannels$cha5 = searchedChannels.chats_groups) !== null && _searchedChannels$cha5 !== void 0 && _searchedChannels$cha5.length) && !((_searchedChannels$cha6 = searchedChannels.channels) !== null && _searchedChannels$cha6 !== void 0 && _searchedChannels$cha6.length) ? (/*#__PURE__*/React__default.createElement(NoData, {
24240
24248
  color: textSecondary,
@@ -24274,7 +24282,8 @@ var ChannelList = function ChannelList(_ref) {
24274
24282
  key: channel.id,
24275
24283
  setSelectedChannel: setSelectedChannel,
24276
24284
  getCustomLatestMessage: getCustomLatestMessage,
24277
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24285
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24286
+ showPhoneNumber: showPhoneNumber
24278
24287
  }));
24279
24288
  }))), !!searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
24280
24289
  color: textSecondary,
@@ -24311,7 +24320,8 @@ var ChannelList = function ChannelList(_ref) {
24311
24320
  contactsMap: contactsMap,
24312
24321
  setSelectedChannel: setSelectedChannel,
24313
24322
  getCustomLatestMessage: getCustomLatestMessage,
24314
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24323
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24324
+ showPhoneNumber: showPhoneNumber
24315
24325
  }));
24316
24326
  }))))) : (/*#__PURE__*/React__default.createElement(LoadingWrapper, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
24317
24327
  color: textFootnote
@@ -25374,6 +25384,7 @@ function ForwardMessagePopup(_ref) {
25374
25384
  var _useState4 = React.useState(false),
25375
25385
  isScrolling = _useState4[0],
25376
25386
  setIsScrolling = _useState4[1];
25387
+ var loadingRef = React.useRef(false);
25377
25388
  var handleForwardMessage = function handleForwardMessage() {
25378
25389
  handleForward(selectedChannels.map(function (channel) {
25379
25390
  return channel.id;
@@ -25382,11 +25393,21 @@ function ForwardMessagePopup(_ref) {
25382
25393
  };
25383
25394
  var handleChannelListScroll = function handleChannelListScroll(event) {
25384
25395
  if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
25385
- if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext) {
25396
+ if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext && !loadingRef.current) {
25397
+ loadingRef.current = true;
25386
25398
  dispatch(loadMoreChannelsForForward(15));
25399
+ var timeout = setTimeout(function () {
25400
+ loadingRef.current = false;
25401
+ clearTimeout(timeout);
25402
+ }, 100);
25387
25403
  }
25388
25404
  }
25389
25405
  };
25406
+ React.useEffect(function () {
25407
+ if (channelsLoading === LOADING_STATE.LOADED) {
25408
+ loadingRef.current = false;
25409
+ }
25410
+ }, [channelsLoading]);
25390
25411
  var handleSearchValueChange = function handleSearchValueChange(e) {
25391
25412
  var value = e.target.value;
25392
25413
  setSearchValue(value);
@@ -26571,7 +26592,8 @@ function ReactionsPopup(_ref) {
26571
26592
  reactionTotals = _ref.reactionTotals,
26572
26593
  reactionsDetailsPopupBorderRadius = _ref.reactionsDetailsPopupBorderRadius,
26573
26594
  reactionsDetailsPopupHeaderItemsStyle = _ref.reactionsDetailsPopupHeaderItemsStyle,
26574
- rtlDirection = _ref.rtlDirection;
26595
+ rtlDirection = _ref.rtlDirection,
26596
+ openUserProfile = _ref.openUserProfile;
26575
26597
  var _useColor = useColors(),
26576
26598
  accentColor = _useColor[THEME_COLORS.ACCENT],
26577
26599
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -26645,7 +26667,7 @@ function ReactionsPopup(_ref) {
26645
26667
  return scoresElem.offsetHeight;
26646
26668
  }
26647
26669
  return 0;
26648
- }, [scoresRef]);
26670
+ }, [scoresRef, reactionTotals === null || reactionTotals === void 0 ? void 0 : reactionTotals.length]);
26649
26671
  React.useEffect(function () {
26650
26672
  if (!reactionTotals || !reactionTotals.length) {
26651
26673
  handleReactionsPopupClose();
@@ -26655,19 +26677,18 @@ function ReactionsPopup(_ref) {
26655
26677
  return reactions.length * 50 + 45;
26656
26678
  }, [reactions]);
26657
26679
  React.useEffect(function () {
26658
- if (reactions && reactionsPrevLength < reactions.length) {
26659
- if (reactionsHeight > popupHeight) {
26680
+ if (reactions) {
26681
+ if (reactionsPrevLength !== reactions.length) {
26660
26682
  setPopupHeight(reactionsHeight);
26683
+ reactionsPrevLength = reactions.length;
26661
26684
  }
26662
- reactionsPrevLength = reactions.length;
26663
26685
  } else {
26664
- reactionsPrevLength = !reactions ? 0 : reactions.length;
26686
+ reactionsPrevLength = 0;
26687
+ setPopupHeight(0);
26665
26688
  }
26666
- if (reactions && reactions.length) {
26667
- if (calculateSizes) {
26668
- setPopupHeight(reactionsHeight);
26669
- setCalculateSizes(false);
26670
- }
26689
+ if (reactions && reactions.length && calculateSizes) {
26690
+ setPopupHeight(reactionsHeight);
26691
+ setCalculateSizes(false);
26671
26692
  }
26672
26693
  }, [reactions, reactionsHeight]);
26673
26694
  var popupVerticalPosition = React.useMemo(function () {
@@ -26733,7 +26754,12 @@ function ReactionsPopup(_ref) {
26733
26754
  key: reaction.id,
26734
26755
  hoverBackgroundColor: backgroundHovered,
26735
26756
  onClick: function onClick() {
26736
- return handleAddDeleteEmoji(reaction.key);
26757
+ if (reaction.user.id === user.id) {
26758
+ handleAddDeleteEmoji(reaction.key);
26759
+ } else {
26760
+ openUserProfile(reaction.user);
26761
+ handleReactionsPopupClose();
26762
+ }
26737
26763
  }
26738
26764
  }, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
26739
26765
  name: reaction.user.firstName || reaction.user.id,
@@ -33471,6 +33497,7 @@ var Message$1 = function Message(_ref) {
33471
33497
  return handleReplyMessage(true);
33472
33498
  }
33473
33499
  }, message.replyCount + " replies")), reactionsPopupOpen && (/*#__PURE__*/React__default.createElement(ReactionsPopup, {
33500
+ openUserProfile: handleOpenUserProfile,
33474
33501
  bottomPosition: reactionsPopupPosition,
33475
33502
  horizontalPositions: reactionsPopupHorizontalPosition,
33476
33503
  reactionTotals: message.reactionTotals || [],
package/index.modern.js CHANGED
@@ -21482,6 +21482,7 @@ var ChannelMessageText = function ChannelMessageText(_ref2) {
21482
21482
  }), channel.lastReactedMessage && '"')))));
21483
21483
  };
21484
21484
  var Channel = function Channel(_ref3) {
21485
+ var _channel$members, _channel$members$, _channel$members$2;
21485
21486
  var channel = _ref3.channel,
21486
21487
  theme = _ref3.theme,
21487
21488
  _ref3$showAvatar = _ref3.showAvatar,
@@ -21508,7 +21509,8 @@ var Channel = function Channel(_ref3) {
21508
21509
  channelAvatarTextSize = _ref3.channelAvatarTextSize,
21509
21510
  setSelectedChannel = _ref3.setSelectedChannel,
21510
21511
  getCustomLatestMessage = _ref3.getCustomLatestMessage,
21511
- doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes;
21512
+ doNotShowMessageDeliveryTypes = _ref3.doNotShowMessageDeliveryTypes,
21513
+ showPhoneNumber = _ref3.showPhoneNumber;
21512
21514
  var _useColor = useColors(),
21513
21515
  accentColor = _useColor[THEME_COLORS.ACCENT],
21514
21516
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -21701,7 +21703,7 @@ var Channel = function Channel(_ref3) {
21701
21703
  subjectLineHeight: channelSubjectLineHeight,
21702
21704
  subjectColor: channelSubjectColor || textPrimary,
21703
21705
  avatarSize: channelAvatarSize
21704
- }, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
21706
+ }, /*#__PURE__*/React__default.createElement("h3", null, channel.subject || (isDirectChannel && directChannelUser ? makeUsername(contactsMap && contactsMap[directChannelUser.id], directChannelUser, getFromContacts) : isSelfChannel ? showPhoneNumber && (_channel$members = channel.members) !== null && _channel$members !== void 0 && _channel$members.length && (_channel$members$ = channel.members[0]) !== null && _channel$members$ !== void 0 && _channel$members$.id ? "+" + ((_channel$members$2 = channel.members[0]) === null || _channel$members$2 === void 0 ? void 0 : _channel$members$2.id) + " (You)" : 'Me' : '')), channel.muted && (/*#__PURE__*/React__default.createElement(MutedIcon, {
21705
21707
  color: notificationsIsMutedIconColor || iconInactive
21706
21708
  }, notificationsIsMutedIcon || /*#__PURE__*/React__default.createElement(SvgUnmuteNotifications, null))), getCustomLatestMessage ? getCustomLatestMessageComponent({
21707
21709
  lastMessage: lastMessage,
@@ -23765,7 +23767,9 @@ var ChannelList = function ChannelList(_ref) {
23765
23767
  searchChannelsPadding = _ref.searchChannelsPadding,
23766
23768
  getCustomLatestMessage = _ref.getCustomLatestMessage,
23767
23769
  _ref$doNotShowMessage = _ref.doNotShowMessageDeliveryTypes,
23768
- doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage;
23770
+ doNotShowMessageDeliveryTypes = _ref$doNotShowMessage === void 0 ? ['system'] : _ref$doNotShowMessage,
23771
+ _ref$showPhoneNumber = _ref.showPhoneNumber,
23772
+ showPhoneNumber = _ref$showPhoneNumber === void 0 ? false : _ref$showPhoneNumber;
23769
23773
  var _useColor = useColors(),
23770
23774
  background = _useColor[THEME_COLORS.BACKGROUND],
23771
23775
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -24076,7 +24080,8 @@ var ChannelList = function ChannelList(_ref) {
24076
24080
  contactsMap: contactsMap,
24077
24081
  setSelectedChannel: setSelectedChannel,
24078
24082
  getCustomLatestMessage: getCustomLatestMessage,
24079
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24083
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24084
+ showPhoneNumber: showPhoneNumber
24080
24085
  }));
24081
24086
  }))) : channelsLoading === LOADING_STATE.LOADED && searchValue ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha = searchedChannels.chats_groups) !== null && _searchedChannels$cha !== void 0 && _searchedChannels$cha.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$cha2 = searchedChannels.channels) !== null && _searchedChannels$cha2 !== void 0 && _searchedChannels$cha2.length || searchedChannels !== null && searchedChannels !== void 0 && (_searchedChannels$con = searchedChannels.contacts) !== null && _searchedChannels$con !== void 0 && _searchedChannels$con.length ? (/*#__PURE__*/React__default.createElement(React__default.Fragment, null, !!(searchedChannels.chats_groups && searchedChannels.chats_groups.length) && (/*#__PURE__*/React__default.createElement(DirectChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
24082
24087
  color: textSecondary,
@@ -24113,7 +24118,8 @@ var ChannelList = function ChannelList(_ref) {
24113
24118
  contactsMap: contactsMap,
24114
24119
  setSelectedChannel: setSelectedChannel,
24115
24120
  getCustomLatestMessage: getCustomLatestMessage,
24116
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24121
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24122
+ showPhoneNumber: showPhoneNumber
24117
24123
  }));
24118
24124
  }))), !!(searchedChannels.contacts && searchedChannels.contacts.length) && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
24119
24125
  color: textSecondary,
@@ -24182,7 +24188,8 @@ var ChannelList = function ChannelList(_ref) {
24182
24188
  contactsMap: contactsMap,
24183
24189
  setSelectedChannel: setSelectedChannel,
24184
24190
  getCustomLatestMessage: getCustomLatestMessage,
24185
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24191
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24192
+ showPhoneNumber: showPhoneNumber
24186
24193
  }));
24187
24194
  }))))) : (/*#__PURE__*/React__default.createElement(NoData, {
24188
24195
  color: textSecondary,
@@ -24232,7 +24239,8 @@ var ChannelList = function ChannelList(_ref) {
24232
24239
  contactsMap: contactsMap,
24233
24240
  setSelectedChannel: setSelectedChannel,
24234
24241
  getCustomLatestMessage: getCustomLatestMessage,
24235
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24242
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24243
+ showPhoneNumber: showPhoneNumber
24236
24244
  }));
24237
24245
  }))), !!searchValue && (channelsLoading === LOADING_STATE.LOADED ? !((_searchedChannels$cha4 = searchedChannels.chats_groups) !== null && _searchedChannels$cha4 !== void 0 && _searchedChannels$cha4.length) && !((_searchedChannels$cha5 = searchedChannels.chats_groups) !== null && _searchedChannels$cha5 !== void 0 && _searchedChannels$cha5.length) && !((_searchedChannels$cha6 = searchedChannels.channels) !== null && _searchedChannels$cha6 !== void 0 && _searchedChannels$cha6.length) ? (/*#__PURE__*/React__default.createElement(NoData, {
24238
24246
  color: textSecondary,
@@ -24272,7 +24280,8 @@ var ChannelList = function ChannelList(_ref) {
24272
24280
  key: channel.id,
24273
24281
  setSelectedChannel: setSelectedChannel,
24274
24282
  getCustomLatestMessage: getCustomLatestMessage,
24275
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24283
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24284
+ showPhoneNumber: showPhoneNumber
24276
24285
  }));
24277
24286
  }))), !!searchedChannels.channels.length && (/*#__PURE__*/React__default.createElement(GroupChannels, null, /*#__PURE__*/React__default.createElement(SearchedChannelsHeader, {
24278
24287
  color: textSecondary,
@@ -24309,7 +24318,8 @@ var ChannelList = function ChannelList(_ref) {
24309
24318
  contactsMap: contactsMap,
24310
24319
  setSelectedChannel: setSelectedChannel,
24311
24320
  getCustomLatestMessage: getCustomLatestMessage,
24312
- doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes
24321
+ doNotShowMessageDeliveryTypes: doNotShowMessageDeliveryTypes,
24322
+ showPhoneNumber: showPhoneNumber
24313
24323
  }));
24314
24324
  }))))) : (/*#__PURE__*/React__default.createElement(LoadingWrapper, null, /*#__PURE__*/React__default.createElement(UploadingIcon, {
24315
24325
  color: textFootnote
@@ -25372,6 +25382,7 @@ function ForwardMessagePopup(_ref) {
25372
25382
  var _useState4 = useState(false),
25373
25383
  isScrolling = _useState4[0],
25374
25384
  setIsScrolling = _useState4[1];
25385
+ var loadingRef = useRef(false);
25375
25386
  var handleForwardMessage = function handleForwardMessage() {
25376
25387
  handleForward(selectedChannels.map(function (channel) {
25377
25388
  return channel.id;
@@ -25380,11 +25391,21 @@ function ForwardMessagePopup(_ref) {
25380
25391
  };
25381
25392
  var handleChannelListScroll = function handleChannelListScroll(event) {
25382
25393
  if (event.target.scrollTop >= event.target.scrollHeight - event.target.offsetHeight - 100) {
25383
- if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext) {
25394
+ if (channelsLoading === LOADING_STATE.LOADED && channelsHasNext && !loadingRef.current) {
25395
+ loadingRef.current = true;
25384
25396
  dispatch(loadMoreChannelsForForward(15));
25397
+ var timeout = setTimeout(function () {
25398
+ loadingRef.current = false;
25399
+ clearTimeout(timeout);
25400
+ }, 100);
25385
25401
  }
25386
25402
  }
25387
25403
  };
25404
+ useEffect(function () {
25405
+ if (channelsLoading === LOADING_STATE.LOADED) {
25406
+ loadingRef.current = false;
25407
+ }
25408
+ }, [channelsLoading]);
25388
25409
  var handleSearchValueChange = function handleSearchValueChange(e) {
25389
25410
  var value = e.target.value;
25390
25411
  setSearchValue(value);
@@ -26569,7 +26590,8 @@ function ReactionsPopup(_ref) {
26569
26590
  reactionTotals = _ref.reactionTotals,
26570
26591
  reactionsDetailsPopupBorderRadius = _ref.reactionsDetailsPopupBorderRadius,
26571
26592
  reactionsDetailsPopupHeaderItemsStyle = _ref.reactionsDetailsPopupHeaderItemsStyle,
26572
- rtlDirection = _ref.rtlDirection;
26593
+ rtlDirection = _ref.rtlDirection,
26594
+ openUserProfile = _ref.openUserProfile;
26573
26595
  var _useColor = useColors(),
26574
26596
  accentColor = _useColor[THEME_COLORS.ACCENT],
26575
26597
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
@@ -26643,7 +26665,7 @@ function ReactionsPopup(_ref) {
26643
26665
  return scoresElem.offsetHeight;
26644
26666
  }
26645
26667
  return 0;
26646
- }, [scoresRef]);
26668
+ }, [scoresRef, reactionTotals === null || reactionTotals === void 0 ? void 0 : reactionTotals.length]);
26647
26669
  useEffect(function () {
26648
26670
  if (!reactionTotals || !reactionTotals.length) {
26649
26671
  handleReactionsPopupClose();
@@ -26653,19 +26675,18 @@ function ReactionsPopup(_ref) {
26653
26675
  return reactions.length * 50 + 45;
26654
26676
  }, [reactions]);
26655
26677
  useEffect(function () {
26656
- if (reactions && reactionsPrevLength < reactions.length) {
26657
- if (reactionsHeight > popupHeight) {
26678
+ if (reactions) {
26679
+ if (reactionsPrevLength !== reactions.length) {
26658
26680
  setPopupHeight(reactionsHeight);
26681
+ reactionsPrevLength = reactions.length;
26659
26682
  }
26660
- reactionsPrevLength = reactions.length;
26661
26683
  } else {
26662
- reactionsPrevLength = !reactions ? 0 : reactions.length;
26684
+ reactionsPrevLength = 0;
26685
+ setPopupHeight(0);
26663
26686
  }
26664
- if (reactions && reactions.length) {
26665
- if (calculateSizes) {
26666
- setPopupHeight(reactionsHeight);
26667
- setCalculateSizes(false);
26668
- }
26687
+ if (reactions && reactions.length && calculateSizes) {
26688
+ setPopupHeight(reactionsHeight);
26689
+ setCalculateSizes(false);
26669
26690
  }
26670
26691
  }, [reactions, reactionsHeight]);
26671
26692
  var popupVerticalPosition = useMemo(function () {
@@ -26731,7 +26752,12 @@ function ReactionsPopup(_ref) {
26731
26752
  key: reaction.id,
26732
26753
  hoverBackgroundColor: backgroundHovered,
26733
26754
  onClick: function onClick() {
26734
- return handleAddDeleteEmoji(reaction.key);
26755
+ if (reaction.user.id === user.id) {
26756
+ handleAddDeleteEmoji(reaction.key);
26757
+ } else {
26758
+ openUserProfile(reaction.user);
26759
+ handleReactionsPopupClose();
26760
+ }
26735
26761
  }
26736
26762
  }, /*#__PURE__*/React__default.createElement(AvatarWrapper, null, /*#__PURE__*/React__default.createElement(Avatar, {
26737
26763
  name: reaction.user.firstName || reaction.user.id,
@@ -33469,6 +33495,7 @@ var Message$1 = function Message(_ref) {
33469
33495
  return handleReplyMessage(true);
33470
33496
  }
33471
33497
  }, message.replyCount + " replies")), reactionsPopupOpen && (/*#__PURE__*/React__default.createElement(ReactionsPopup, {
33498
+ openUserProfile: handleOpenUserProfile,
33472
33499
  bottomPosition: reactionsPopupPosition,
33473
33500
  horizontalPositions: reactionsPopupHorizontalPosition,
33474
33501
  reactionTotals: message.reactionTotals || [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sceyt-chat-react-uikit",
3
- "version": "1.7.3-beta.3",
3
+ "version": "1.7.3",
4
4
  "description": "Interactive React UI Components for Sceyt Chat.",
5
5
  "author": "Sceyt",
6
6
  "license": "MIT",