sceyt-chat-react-uikit 1.7.5-beta.15 → 1.7.5-beta.17

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.
Files changed (3) hide show
  1. package/index.js +67 -20
  2. package/index.modern.js +67 -20
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -13392,9 +13392,9 @@ var Button = styled__default.button(_templateObject12 || (_templateObject12 = _t
13392
13392
  }, function (props) {
13393
13393
  return props.margin || '0';
13394
13394
  }, function (props) {
13395
- return props.disabled ? 0.5 : 1;
13395
+ return props.disabled ? props.disabledOpacity || 0.5 : 1;
13396
13396
  }, function (props) {
13397
- return props.disabled ? 0.5 : 0.8;
13397
+ return props.disabled ? props.disabledOpacity || 0.5 : 0.8;
13398
13398
  });
13399
13399
  var PopupName = styled__default.h3(_templateObject13 || (_templateObject13 = _taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: 500;\n font-size: 20px;\n line-height: 23px;\n color: ", ";\n margin: 0;\n margin-top: ", ";\n margin-bottom: ", ";\n padding: ", ";\n word-break: break-word;\n\n ", "\n"])), function (props) {
13400
13400
  return props.color;
@@ -23821,7 +23821,7 @@ var Channel = function Channel(_ref3) {
23821
23821
  draftMessageText: draftMessageText,
23822
23822
  lastMessage: draftMessage || lastMessage,
23823
23823
  isDirectChannel: isDirectChannel,
23824
- unsupportedMessage: unsupportedMessage
23824
+ unsupportedMessage: unsupportedMessage && !getCustomLatestMessage
23825
23825
  });
23826
23826
  }, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel, unsupportedMessage]);
23827
23827
  var getCustomLatestMessageComponent = React.useCallback(function (_ref4) {
@@ -33994,6 +33994,9 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
33994
33994
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
33995
33995
  textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
33996
33996
  surface1 = _useColor[THEME_COLORS.SURFACE_1];
33997
+ var contactsMap = useSelector(contactsMapSelector);
33998
+ var getFromContacts = getShowOnlyContactUsers();
33999
+ var user = getClient().user;
33997
34000
  var dispatch = useDispatch();
33998
34001
  var key = poll.id + "_" + optionId;
33999
34002
  var pollVotesList = useSelector(pollVotesListSelector);
@@ -34010,7 +34013,7 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34010
34013
  }
34011
34014
  }, []);
34012
34015
  React.useEffect(function () {
34013
- if (allVotes.length > 0 && hasMore && !isLoading && allVotes.length < POLL_VOTES_LIMIT) {
34016
+ if (allVotes.length > 0 && hasMore && !isLoading && allVotes.length < POLL_VOTES_LIMIT - 1) {
34014
34017
  dispatch(loadMorePollVotesAC(poll.id, optionId, POLL_VOTES_LIMIT));
34015
34018
  }
34016
34019
  }, [allVotes.length, hasMore, isLoading, poll.id, optionId, dispatch]);
@@ -34034,6 +34037,12 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34034
34037
  return '';
34035
34038
  }
34036
34039
  };
34040
+ var ownVote = React.useMemo(function () {
34041
+ var _poll$ownVotes;
34042
+ return poll === null || poll === void 0 ? void 0 : (_poll$ownVotes = poll.ownVotes) === null || _poll$ownVotes === void 0 ? void 0 : _poll$ownVotes.find(function (vote) {
34043
+ return vote.optionId === optionId;
34044
+ });
34045
+ }, [poll === null || poll === void 0 ? void 0 : poll.ownVotes, optionId]);
34037
34046
  return /*#__PURE__*/React__default.createElement(PopupContainer, null, /*#__PURE__*/React__default.createElement(Popup, {
34038
34047
  backgroundColor: background,
34039
34048
  maxWidth: '560px',
@@ -34059,7 +34068,9 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34059
34068
  color: textSecondary
34060
34069
  }))) : (/*#__PURE__*/React__default.createElement(VotesList, {
34061
34070
  onScroll: handleScroll
34062
- }, allVotes.map(function (vote) {
34071
+ }, [].concat(ownVote ? [ownVote] : [], allVotes).map(function (vote) {
34072
+ var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4, _vote$user4$profile, _vote$user5, _vote$user5$presence, _vote$user6, _vote$user6$presence, _vote$user7, _vote$user7$presence, _vote$user8;
34073
+ var contact = contactsMap[vote.user.id];
34063
34074
  return /*#__PURE__*/React__default.createElement(VoterRow, {
34064
34075
  key: vote.optionId + "_" + vote.user.id
34065
34076
  }, /*#__PURE__*/React__default.createElement(Avatar, {
@@ -34070,14 +34081,26 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34070
34081
  setDefaultAvatar: true
34071
34082
  }), /*#__PURE__*/React__default.createElement(VoterInfo, null, /*#__PURE__*/React__default.createElement(VoterName, {
34072
34083
  color: textPrimary
34073
- }, vote.user.profile.firstName || vote.user.id, " ", vote.user.profile.lastName || ''), /*#__PURE__*/React__default.createElement(VotedAt, {
34084
+ }, user.id === vote.user.id ? 'You' : makeUsername(contact, {
34085
+ id: vote === null || vote === void 0 ? void 0 : (_vote$user = vote.user) === null || _vote$user === void 0 ? void 0 : _vote$user.id,
34086
+ firstName: vote === null || vote === void 0 ? void 0 : (_vote$user2 = vote.user) === null || _vote$user2 === void 0 ? void 0 : (_vote$user2$profile = _vote$user2.profile) === null || _vote$user2$profile === void 0 ? void 0 : _vote$user2$profile.firstName,
34087
+ lastName: vote === null || vote === void 0 ? void 0 : (_vote$user3 = vote.user) === null || _vote$user3 === void 0 ? void 0 : (_vote$user3$profile = _vote$user3.profile) === null || _vote$user3$profile === void 0 ? void 0 : _vote$user3$profile.lastName,
34088
+ avatarUrl: vote === null || vote === void 0 ? void 0 : (_vote$user4 = vote.user) === null || _vote$user4 === void 0 ? void 0 : (_vote$user4$profile = _vote$user4.profile) === null || _vote$user4$profile === void 0 ? void 0 : _vote$user4$profile.avatar,
34089
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user5 = vote.user) === null || _vote$user5 === void 0 ? void 0 : (_vote$user5$presence = _vote$user5.presence) === null || _vote$user5$presence === void 0 ? void 0 : _vote$user5$presence.status,
34090
+ blocked: false,
34091
+ presence: {
34092
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user6 = vote.user) === null || _vote$user6 === void 0 ? void 0 : (_vote$user6$presence = _vote$user6.presence) === null || _vote$user6$presence === void 0 ? void 0 : _vote$user6$presence.status,
34093
+ status: vote === null || vote === void 0 ? void 0 : (_vote$user7 = vote.user) === null || _vote$user7 === void 0 ? void 0 : (_vote$user7$presence = _vote$user7.presence) === null || _vote$user7$presence === void 0 ? void 0 : _vote$user7$presence.status,
34094
+ lastActiveAt: new Date((vote === null || vote === void 0 ? void 0 : (_vote$user8 = vote.user) === null || _vote$user8 === void 0 ? void 0 : _vote$user8.createdAt) || '')
34095
+ }
34096
+ }, getFromContacts)), /*#__PURE__*/React__default.createElement(VotedAt, {
34074
34097
  color: textSecondary
34075
34098
  }, formatDate(new Date(vote.createdAt)))));
34076
34099
  }), isLoading && allVotes.length > 0 && /*#__PURE__*/React__default.createElement(LoadingText, {
34077
34100
  color: textSecondary
34078
34101
  }, "Loading...")))))));
34079
34102
  };
34080
- var VotesList = styled__default.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 60vh;\n padding: 8px 0;\n"])));
34103
+ var VotesList = styled__default.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 500px;\n padding: 8px 0;\n"])));
34081
34104
  var VoterRow = styled__default.div(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 6px 0;\n"])));
34082
34105
  var VoterInfo = styled__default.div(_templateObject3$r || (_templateObject3$r = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n justify-content: space-between;\n"])));
34083
34106
  var VoterName = styled__default.div(_templateObject4$n || (_templateObject4$n = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.2px;\n"])), function (p) {
@@ -34116,6 +34139,9 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34116
34139
  var _useState = React.useState(null),
34117
34140
  selectedOptionId = _useState[0],
34118
34141
  setSelectedOptionId = _useState[1];
34142
+ var getFromContacts = getShowOnlyContactUsers();
34143
+ var user = getClient().user;
34144
+ var contactsMap = useSelector(contactsMapSelector);
34119
34145
  var _useColor = useColors(),
34120
34146
  background = _useColor[THEME_COLORS.BACKGROUND],
34121
34147
  surface1 = _useColor[THEME_COLORS.SURFACE_1],
@@ -34129,11 +34155,13 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34129
34155
  var allOptionVotes = (poll.votes || []).filter(function (vote) {
34130
34156
  return vote.optionId === opt.id;
34131
34157
  });
34132
- var ownVote = poll.ownVotes.find(function (vote) {
34133
- return vote.optionId === opt.id;
34134
- });
34135
- if (ownVote) {
34136
- allOptionVotes.push(ownVote);
34158
+ if (allOptionVotes.length < 5) {
34159
+ var ownVote = poll.ownVotes.find(function (vote) {
34160
+ return vote.optionId === opt.id;
34161
+ });
34162
+ if (ownVote) {
34163
+ allOptionVotes.push(ownVote);
34164
+ }
34137
34165
  }
34138
34166
  votes[opt.id] = allOptionVotes;
34139
34167
  });
@@ -34188,6 +34216,7 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34188
34216
  }, opt.name), /*#__PURE__*/React__default.createElement(OptionCount, {
34189
34217
  color: textSecondary
34190
34218
  }, totalVotes, " votes")), /*#__PURE__*/React__default.createElement(Voters, null, allVotes.map(function (vote) {
34219
+ var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4, _vote$user4$profile, _vote$user5, _vote$user5$presence, _vote$user6, _vote$user6$presence, _vote$user7, _vote$user7$presence, _vote$user8;
34191
34220
  return /*#__PURE__*/React__default.createElement(VoterRow$1, {
34192
34221
  key: opt.id + "_" + vote.user.id
34193
34222
  }, /*#__PURE__*/React__default.createElement(Avatar, {
@@ -34198,7 +34227,19 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34198
34227
  setDefaultAvatar: true
34199
34228
  }), /*#__PURE__*/React__default.createElement(VoterInfo$1, null, /*#__PURE__*/React__default.createElement(VoterName$1, {
34200
34229
  color: textPrimary
34201
- }, vote.user.profile.firstName || vote.user.id, " ", vote.user.profile.lastName || ''), /*#__PURE__*/React__default.createElement(VotedAt$1, {
34230
+ }, user.id === vote.user.id ? 'You' : makeUsername(contactsMap[vote.user.id], {
34231
+ id: vote === null || vote === void 0 ? void 0 : (_vote$user = vote.user) === null || _vote$user === void 0 ? void 0 : _vote$user.id,
34232
+ firstName: vote === null || vote === void 0 ? void 0 : (_vote$user2 = vote.user) === null || _vote$user2 === void 0 ? void 0 : (_vote$user2$profile = _vote$user2.profile) === null || _vote$user2$profile === void 0 ? void 0 : _vote$user2$profile.firstName,
34233
+ lastName: vote === null || vote === void 0 ? void 0 : (_vote$user3 = vote.user) === null || _vote$user3 === void 0 ? void 0 : (_vote$user3$profile = _vote$user3.profile) === null || _vote$user3$profile === void 0 ? void 0 : _vote$user3$profile.lastName,
34234
+ avatarUrl: vote === null || vote === void 0 ? void 0 : (_vote$user4 = vote.user) === null || _vote$user4 === void 0 ? void 0 : (_vote$user4$profile = _vote$user4.profile) === null || _vote$user4$profile === void 0 ? void 0 : _vote$user4$profile.avatar,
34235
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user5 = vote.user) === null || _vote$user5 === void 0 ? void 0 : (_vote$user5$presence = _vote$user5.presence) === null || _vote$user5$presence === void 0 ? void 0 : _vote$user5$presence.status,
34236
+ blocked: false,
34237
+ presence: {
34238
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user6 = vote.user) === null || _vote$user6 === void 0 ? void 0 : (_vote$user6$presence = _vote$user6.presence) === null || _vote$user6$presence === void 0 ? void 0 : _vote$user6$presence.status,
34239
+ status: vote === null || vote === void 0 ? void 0 : (_vote$user7 = vote.user) === null || _vote$user7 === void 0 ? void 0 : (_vote$user7$presence = _vote$user7.presence) === null || _vote$user7$presence === void 0 ? void 0 : _vote$user7$presence.status,
34240
+ lastActiveAt: new Date((vote === null || vote === void 0 ? void 0 : (_vote$user8 = vote.user) === null || _vote$user8 === void 0 ? void 0 : _vote$user8.createdAt) || '')
34241
+ }
34242
+ }, getFromContacts)), /*#__PURE__*/React__default.createElement(VotedAt$1, {
34202
34243
  color: textSecondary
34203
34244
  }, formatDate(new Date(vote.createdAt)))));
34204
34245
  })), allVotes.length < totalVotes && (/*#__PURE__*/React__default.createElement(Row, {
@@ -34222,7 +34263,7 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34222
34263
  })) === null || _poll$options$find === void 0 ? void 0 : _poll$options$find.name) || ''
34223
34264
  })));
34224
34265
  };
34225
- var OptionsList = styled__default.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height: 64vh;\n"])));
34266
+ var OptionsList = styled__default.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height: 585px;\n"])));
34226
34267
  var OptionBlock = styled__default.div(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: 12px;\n border: 1px solid ", "0F; /* subtle */\n padding: 14px 16px 0 16px;\n"])), function (p) {
34227
34268
  return p.background;
34228
34269
  }, function (p) {
@@ -34287,6 +34328,10 @@ var PollMessage = function PollMessage(_ref) {
34287
34328
  var _useState = React.useState(false),
34288
34329
  showResults = _useState[0],
34289
34330
  setShowResults = _useState[1];
34331
+ var isHaveResults = React.useMemo(function () {
34332
+ var _poll$votes$length, _poll$votes, _poll$ownVotes$length, _poll$ownVotes;
34333
+ return ((_poll$votes$length = poll === null || poll === void 0 ? void 0 : (_poll$votes = poll.votes) === null || _poll$votes === void 0 ? void 0 : _poll$votes.length) != null ? _poll$votes$length : 0) > 0 || ((_poll$ownVotes$length = poll === null || poll === void 0 ? void 0 : (_poll$ownVotes = poll.ownVotes) === null || _poll$ownVotes === void 0 ? void 0 : _poll$ownVotes.length) != null ? _poll$ownVotes$length : 0) > 0;
34334
+ }, [poll === null || poll === void 0 ? void 0 : poll.votes, poll === null || poll === void 0 ? void 0 : poll.ownVotes]);
34290
34335
  if (!poll) {
34291
34336
  return null;
34292
34337
  }
@@ -34323,8 +34368,8 @@ var PollMessage = function PollMessage(_ref) {
34323
34368
  return v.optionId === opt.id;
34324
34369
  }).slice(0, 3);
34325
34370
  if (optionVotesUsers.length < 3) {
34326
- var _poll$ownVotes;
34327
- poll === null || poll === void 0 ? void 0 : (_poll$ownVotes = poll.ownVotes) === null || _poll$ownVotes === void 0 ? void 0 : _poll$ownVotes.forEach(function (vote) {
34371
+ var _poll$ownVotes2;
34372
+ poll === null || poll === void 0 ? void 0 : (_poll$ownVotes2 = poll.ownVotes) === null || _poll$ownVotes2 === void 0 ? void 0 : _poll$ownVotes2.forEach(function (vote) {
34328
34373
  if (vote.optionId === opt.id) {
34329
34374
  optionVotesUsers.push(vote);
34330
34375
  }
@@ -34375,13 +34420,15 @@ var PollMessage = function PollMessage(_ref) {
34375
34420
  })), !(poll !== null && poll !== void 0 && poll.anonymous) && (/*#__PURE__*/React__default.createElement(Button, {
34376
34421
  type: 'button',
34377
34422
  backgroundColor: background,
34378
- color: accent,
34423
+ color: isHaveResults ? accent : textSecondary,
34424
+ disabledOpacity: 0.8,
34379
34425
  borderRadius: '14px',
34380
- onClick: handleViewResults,
34426
+ onClick: isHaveResults ? handleViewResults : undefined,
34381
34427
  style: {
34382
34428
  width: '100%',
34383
34429
  marginTop: 10
34384
- }
34430
+ },
34431
+ disabled: !isHaveResults
34385
34432
  }, "View Results")), showResults && (/*#__PURE__*/React__default.createElement(VotesResultsPopup, {
34386
34433
  onClose: function onClose() {
34387
34434
  return setShowResults(false);
@@ -44085,7 +44132,7 @@ function InviteLinkModal(_ref) {
44085
44132
  })), showCopiedToast && (/*#__PURE__*/React__default.createElement(CopiedTooltip, {
44086
44133
  background: tooltipBackground,
44087
44134
  color: textOnPrimary
44088
- }, "Copied")))), showHistorySection && /*#__PURE__*/React__default.createElement(SectionTitle, {
44135
+ }, "Link copied")))), showHistorySection && /*#__PURE__*/React__default.createElement(SectionTitle, {
44089
44136
  color: textSecondary
44090
44137
  }, historyTitle), showHistorySection && (/*#__PURE__*/React__default.createElement(HistoryRow, null, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(FieldLabel, {
44091
44138
  color: textPrimary
package/index.modern.js CHANGED
@@ -13391,9 +13391,9 @@ var Button = styled.button(_templateObject12 || (_templateObject12 = _taggedTemp
13391
13391
  }, function (props) {
13392
13392
  return props.margin || '0';
13393
13393
  }, function (props) {
13394
- return props.disabled ? 0.5 : 1;
13394
+ return props.disabled ? props.disabledOpacity || 0.5 : 1;
13395
13395
  }, function (props) {
13396
- return props.disabled ? 0.5 : 0.8;
13396
+ return props.disabled ? props.disabledOpacity || 0.5 : 0.8;
13397
13397
  });
13398
13398
  var PopupName = styled.h3(_templateObject13 || (_templateObject13 = _taggedTemplateLiteralLoose(["\n font-style: normal;\n font-weight: 500;\n font-size: 20px;\n line-height: 23px;\n color: ", ";\n margin: 0;\n margin-top: ", ";\n margin-bottom: ", ";\n padding: ", ";\n word-break: break-word;\n\n ", "\n"])), function (props) {
13399
13399
  return props.color;
@@ -23820,7 +23820,7 @@ var Channel = function Channel(_ref3) {
23820
23820
  draftMessageText: draftMessageText,
23821
23821
  lastMessage: draftMessage || lastMessage,
23822
23822
  isDirectChannel: isDirectChannel,
23823
- unsupportedMessage: unsupportedMessage
23823
+ unsupportedMessage: unsupportedMessage && !getCustomLatestMessage
23824
23824
  });
23825
23825
  }, [typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isTyping, typingOrRecording === null || typingOrRecording === void 0 ? void 0 : typingOrRecording.isRecording, draftMessageText, lastMessage, user, contactsMap, getFromContacts, lastMessageMetas, accentColor, typingOrRecording, channel, isDirectChannel, unsupportedMessage]);
23826
23826
  var getCustomLatestMessageComponent = useCallback(function (_ref4) {
@@ -33993,6 +33993,9 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
33993
33993
  textPrimary = _useColor[THEME_COLORS.TEXT_PRIMARY],
33994
33994
  textSecondary = _useColor[THEME_COLORS.TEXT_SECONDARY],
33995
33995
  surface1 = _useColor[THEME_COLORS.SURFACE_1];
33996
+ var contactsMap = useSelector(contactsMapSelector);
33997
+ var getFromContacts = getShowOnlyContactUsers();
33998
+ var user = getClient().user;
33996
33999
  var dispatch = useDispatch();
33997
34000
  var key = poll.id + "_" + optionId;
33998
34001
  var pollVotesList = useSelector(pollVotesListSelector);
@@ -34009,7 +34012,7 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34009
34012
  }
34010
34013
  }, []);
34011
34014
  useEffect(function () {
34012
- if (allVotes.length > 0 && hasMore && !isLoading && allVotes.length < POLL_VOTES_LIMIT) {
34015
+ if (allVotes.length > 0 && hasMore && !isLoading && allVotes.length < POLL_VOTES_LIMIT - 1) {
34013
34016
  dispatch(loadMorePollVotesAC(poll.id, optionId, POLL_VOTES_LIMIT));
34014
34017
  }
34015
34018
  }, [allVotes.length, hasMore, isLoading, poll.id, optionId, dispatch]);
@@ -34033,6 +34036,12 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34033
34036
  return '';
34034
34037
  }
34035
34038
  };
34039
+ var ownVote = useMemo(function () {
34040
+ var _poll$ownVotes;
34041
+ return poll === null || poll === void 0 ? void 0 : (_poll$ownVotes = poll.ownVotes) === null || _poll$ownVotes === void 0 ? void 0 : _poll$ownVotes.find(function (vote) {
34042
+ return vote.optionId === optionId;
34043
+ });
34044
+ }, [poll === null || poll === void 0 ? void 0 : poll.ownVotes, optionId]);
34036
34045
  return /*#__PURE__*/React__default.createElement(PopupContainer, null, /*#__PURE__*/React__default.createElement(Popup, {
34037
34046
  backgroundColor: background,
34038
34047
  maxWidth: '560px',
@@ -34058,7 +34067,9 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34058
34067
  color: textSecondary
34059
34068
  }))) : (/*#__PURE__*/React__default.createElement(VotesList, {
34060
34069
  onScroll: handleScroll
34061
- }, allVotes.map(function (vote) {
34070
+ }, [].concat(ownVote ? [ownVote] : [], allVotes).map(function (vote) {
34071
+ var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4, _vote$user4$profile, _vote$user5, _vote$user5$presence, _vote$user6, _vote$user6$presence, _vote$user7, _vote$user7$presence, _vote$user8;
34072
+ var contact = contactsMap[vote.user.id];
34062
34073
  return /*#__PURE__*/React__default.createElement(VoterRow, {
34063
34074
  key: vote.optionId + "_" + vote.user.id
34064
34075
  }, /*#__PURE__*/React__default.createElement(Avatar, {
@@ -34069,14 +34080,26 @@ var AllVotesPopup = function AllVotesPopup(_ref) {
34069
34080
  setDefaultAvatar: true
34070
34081
  }), /*#__PURE__*/React__default.createElement(VoterInfo, null, /*#__PURE__*/React__default.createElement(VoterName, {
34071
34082
  color: textPrimary
34072
- }, vote.user.profile.firstName || vote.user.id, " ", vote.user.profile.lastName || ''), /*#__PURE__*/React__default.createElement(VotedAt, {
34083
+ }, user.id === vote.user.id ? 'You' : makeUsername(contact, {
34084
+ id: vote === null || vote === void 0 ? void 0 : (_vote$user = vote.user) === null || _vote$user === void 0 ? void 0 : _vote$user.id,
34085
+ firstName: vote === null || vote === void 0 ? void 0 : (_vote$user2 = vote.user) === null || _vote$user2 === void 0 ? void 0 : (_vote$user2$profile = _vote$user2.profile) === null || _vote$user2$profile === void 0 ? void 0 : _vote$user2$profile.firstName,
34086
+ lastName: vote === null || vote === void 0 ? void 0 : (_vote$user3 = vote.user) === null || _vote$user3 === void 0 ? void 0 : (_vote$user3$profile = _vote$user3.profile) === null || _vote$user3$profile === void 0 ? void 0 : _vote$user3$profile.lastName,
34087
+ avatarUrl: vote === null || vote === void 0 ? void 0 : (_vote$user4 = vote.user) === null || _vote$user4 === void 0 ? void 0 : (_vote$user4$profile = _vote$user4.profile) === null || _vote$user4$profile === void 0 ? void 0 : _vote$user4$profile.avatar,
34088
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user5 = vote.user) === null || _vote$user5 === void 0 ? void 0 : (_vote$user5$presence = _vote$user5.presence) === null || _vote$user5$presence === void 0 ? void 0 : _vote$user5$presence.status,
34089
+ blocked: false,
34090
+ presence: {
34091
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user6 = vote.user) === null || _vote$user6 === void 0 ? void 0 : (_vote$user6$presence = _vote$user6.presence) === null || _vote$user6$presence === void 0 ? void 0 : _vote$user6$presence.status,
34092
+ status: vote === null || vote === void 0 ? void 0 : (_vote$user7 = vote.user) === null || _vote$user7 === void 0 ? void 0 : (_vote$user7$presence = _vote$user7.presence) === null || _vote$user7$presence === void 0 ? void 0 : _vote$user7$presence.status,
34093
+ lastActiveAt: new Date((vote === null || vote === void 0 ? void 0 : (_vote$user8 = vote.user) === null || _vote$user8 === void 0 ? void 0 : _vote$user8.createdAt) || '')
34094
+ }
34095
+ }, getFromContacts)), /*#__PURE__*/React__default.createElement(VotedAt, {
34073
34096
  color: textSecondary
34074
34097
  }, formatDate(new Date(vote.createdAt)))));
34075
34098
  }), isLoading && allVotes.length > 0 && /*#__PURE__*/React__default.createElement(LoadingText, {
34076
34099
  color: textSecondary
34077
34100
  }, "Loading...")))))));
34078
34101
  };
34079
- var VotesList = styled.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 60vh;\n padding: 8px 0;\n"])));
34102
+ var VotesList = styled.div(_templateObject$C || (_templateObject$C = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 500px;\n padding: 8px 0;\n"])));
34080
34103
  var VoterRow = styled.div(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 6px 0;\n"])));
34081
34104
  var VoterInfo = styled.div(_templateObject3$r || (_templateObject3$r = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n justify-content: space-between;\n"])));
34082
34105
  var VoterName = styled.div(_templateObject4$n || (_templateObject4$n = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-weight: 500;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: -0.2px;\n"])), function (p) {
@@ -34115,6 +34138,9 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34115
34138
  var _useState = useState(null),
34116
34139
  selectedOptionId = _useState[0],
34117
34140
  setSelectedOptionId = _useState[1];
34141
+ var getFromContacts = getShowOnlyContactUsers();
34142
+ var user = getClient().user;
34143
+ var contactsMap = useSelector(contactsMapSelector);
34118
34144
  var _useColor = useColors(),
34119
34145
  background = _useColor[THEME_COLORS.BACKGROUND],
34120
34146
  surface1 = _useColor[THEME_COLORS.SURFACE_1],
@@ -34128,11 +34154,13 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34128
34154
  var allOptionVotes = (poll.votes || []).filter(function (vote) {
34129
34155
  return vote.optionId === opt.id;
34130
34156
  });
34131
- var ownVote = poll.ownVotes.find(function (vote) {
34132
- return vote.optionId === opt.id;
34133
- });
34134
- if (ownVote) {
34135
- allOptionVotes.push(ownVote);
34157
+ if (allOptionVotes.length < 5) {
34158
+ var ownVote = poll.ownVotes.find(function (vote) {
34159
+ return vote.optionId === opt.id;
34160
+ });
34161
+ if (ownVote) {
34162
+ allOptionVotes.push(ownVote);
34163
+ }
34136
34164
  }
34137
34165
  votes[opt.id] = allOptionVotes;
34138
34166
  });
@@ -34187,6 +34215,7 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34187
34215
  }, opt.name), /*#__PURE__*/React__default.createElement(OptionCount, {
34188
34216
  color: textSecondary
34189
34217
  }, totalVotes, " votes")), /*#__PURE__*/React__default.createElement(Voters, null, allVotes.map(function (vote) {
34218
+ var _vote$user, _vote$user2, _vote$user2$profile, _vote$user3, _vote$user3$profile, _vote$user4, _vote$user4$profile, _vote$user5, _vote$user5$presence, _vote$user6, _vote$user6$presence, _vote$user7, _vote$user7$presence, _vote$user8;
34190
34219
  return /*#__PURE__*/React__default.createElement(VoterRow$1, {
34191
34220
  key: opt.id + "_" + vote.user.id
34192
34221
  }, /*#__PURE__*/React__default.createElement(Avatar, {
@@ -34197,7 +34226,19 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34197
34226
  setDefaultAvatar: true
34198
34227
  }), /*#__PURE__*/React__default.createElement(VoterInfo$1, null, /*#__PURE__*/React__default.createElement(VoterName$1, {
34199
34228
  color: textPrimary
34200
- }, vote.user.profile.firstName || vote.user.id, " ", vote.user.profile.lastName || ''), /*#__PURE__*/React__default.createElement(VotedAt$1, {
34229
+ }, user.id === vote.user.id ? 'You' : makeUsername(contactsMap[vote.user.id], {
34230
+ id: vote === null || vote === void 0 ? void 0 : (_vote$user = vote.user) === null || _vote$user === void 0 ? void 0 : _vote$user.id,
34231
+ firstName: vote === null || vote === void 0 ? void 0 : (_vote$user2 = vote.user) === null || _vote$user2 === void 0 ? void 0 : (_vote$user2$profile = _vote$user2.profile) === null || _vote$user2$profile === void 0 ? void 0 : _vote$user2$profile.firstName,
34232
+ lastName: vote === null || vote === void 0 ? void 0 : (_vote$user3 = vote.user) === null || _vote$user3 === void 0 ? void 0 : (_vote$user3$profile = _vote$user3.profile) === null || _vote$user3$profile === void 0 ? void 0 : _vote$user3$profile.lastName,
34233
+ avatarUrl: vote === null || vote === void 0 ? void 0 : (_vote$user4 = vote.user) === null || _vote$user4 === void 0 ? void 0 : (_vote$user4$profile = _vote$user4.profile) === null || _vote$user4$profile === void 0 ? void 0 : _vote$user4$profile.avatar,
34234
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user5 = vote.user) === null || _vote$user5 === void 0 ? void 0 : (_vote$user5$presence = _vote$user5.presence) === null || _vote$user5$presence === void 0 ? void 0 : _vote$user5$presence.status,
34235
+ blocked: false,
34236
+ presence: {
34237
+ state: vote === null || vote === void 0 ? void 0 : (_vote$user6 = vote.user) === null || _vote$user6 === void 0 ? void 0 : (_vote$user6$presence = _vote$user6.presence) === null || _vote$user6$presence === void 0 ? void 0 : _vote$user6$presence.status,
34238
+ status: vote === null || vote === void 0 ? void 0 : (_vote$user7 = vote.user) === null || _vote$user7 === void 0 ? void 0 : (_vote$user7$presence = _vote$user7.presence) === null || _vote$user7$presence === void 0 ? void 0 : _vote$user7$presence.status,
34239
+ lastActiveAt: new Date((vote === null || vote === void 0 ? void 0 : (_vote$user8 = vote.user) === null || _vote$user8 === void 0 ? void 0 : _vote$user8.createdAt) || '')
34240
+ }
34241
+ }, getFromContacts)), /*#__PURE__*/React__default.createElement(VotedAt$1, {
34201
34242
  color: textSecondary
34202
34243
  }, formatDate(new Date(vote.createdAt)))));
34203
34244
  })), allVotes.length < totalVotes && (/*#__PURE__*/React__default.createElement(Row, {
@@ -34221,7 +34262,7 @@ var VotesResultsPopup = function VotesResultsPopup(_ref) {
34221
34262
  })) === null || _poll$options$find === void 0 ? void 0 : _poll$options$find.name) || ''
34222
34263
  })));
34223
34264
  };
34224
- var OptionsList = styled.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height: 64vh;\n"])));
34265
+ var OptionsList = styled.div(_templateObject$D || (_templateObject$D = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n overflow-y: auto;\n max-height: 585px;\n"])));
34225
34266
  var OptionBlock = styled.div(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: 12px;\n border: 1px solid ", "0F; /* subtle */\n padding: 14px 16px 0 16px;\n"])), function (p) {
34226
34267
  return p.background;
34227
34268
  }, function (p) {
@@ -34286,6 +34327,10 @@ var PollMessage = function PollMessage(_ref) {
34286
34327
  var _useState = useState(false),
34287
34328
  showResults = _useState[0],
34288
34329
  setShowResults = _useState[1];
34330
+ var isHaveResults = useMemo(function () {
34331
+ var _poll$votes$length, _poll$votes, _poll$ownVotes$length, _poll$ownVotes;
34332
+ return ((_poll$votes$length = poll === null || poll === void 0 ? void 0 : (_poll$votes = poll.votes) === null || _poll$votes === void 0 ? void 0 : _poll$votes.length) != null ? _poll$votes$length : 0) > 0 || ((_poll$ownVotes$length = poll === null || poll === void 0 ? void 0 : (_poll$ownVotes = poll.ownVotes) === null || _poll$ownVotes === void 0 ? void 0 : _poll$ownVotes.length) != null ? _poll$ownVotes$length : 0) > 0;
34333
+ }, [poll === null || poll === void 0 ? void 0 : poll.votes, poll === null || poll === void 0 ? void 0 : poll.ownVotes]);
34289
34334
  if (!poll) {
34290
34335
  return null;
34291
34336
  }
@@ -34322,8 +34367,8 @@ var PollMessage = function PollMessage(_ref) {
34322
34367
  return v.optionId === opt.id;
34323
34368
  }).slice(0, 3);
34324
34369
  if (optionVotesUsers.length < 3) {
34325
- var _poll$ownVotes;
34326
- poll === null || poll === void 0 ? void 0 : (_poll$ownVotes = poll.ownVotes) === null || _poll$ownVotes === void 0 ? void 0 : _poll$ownVotes.forEach(function (vote) {
34370
+ var _poll$ownVotes2;
34371
+ poll === null || poll === void 0 ? void 0 : (_poll$ownVotes2 = poll.ownVotes) === null || _poll$ownVotes2 === void 0 ? void 0 : _poll$ownVotes2.forEach(function (vote) {
34327
34372
  if (vote.optionId === opt.id) {
34328
34373
  optionVotesUsers.push(vote);
34329
34374
  }
@@ -34374,13 +34419,15 @@ var PollMessage = function PollMessage(_ref) {
34374
34419
  })), !(poll !== null && poll !== void 0 && poll.anonymous) && (/*#__PURE__*/React__default.createElement(Button, {
34375
34420
  type: 'button',
34376
34421
  backgroundColor: background,
34377
- color: accent,
34422
+ color: isHaveResults ? accent : textSecondary,
34423
+ disabledOpacity: 0.8,
34378
34424
  borderRadius: '14px',
34379
- onClick: handleViewResults,
34425
+ onClick: isHaveResults ? handleViewResults : undefined,
34380
34426
  style: {
34381
34427
  width: '100%',
34382
34428
  marginTop: 10
34383
- }
34429
+ },
34430
+ disabled: !isHaveResults
34384
34431
  }, "View Results")), showResults && (/*#__PURE__*/React__default.createElement(VotesResultsPopup, {
34385
34432
  onClose: function onClose() {
34386
34433
  return setShowResults(false);
@@ -44084,7 +44131,7 @@ function InviteLinkModal(_ref) {
44084
44131
  })), showCopiedToast && (/*#__PURE__*/React__default.createElement(CopiedTooltip, {
44085
44132
  background: tooltipBackground,
44086
44133
  color: textOnPrimary
44087
- }, "Copied")))), showHistorySection && /*#__PURE__*/React__default.createElement(SectionTitle, {
44134
+ }, "Link copied")))), showHistorySection && /*#__PURE__*/React__default.createElement(SectionTitle, {
44088
44135
  color: textSecondary
44089
44136
  }, historyTitle), showHistorySection && (/*#__PURE__*/React__default.createElement(HistoryRow, null, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(FieldLabel, {
44090
44137
  color: textPrimary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sceyt-chat-react-uikit",
3
- "version": "1.7.5-beta.15",
3
+ "version": "1.7.5-beta.17",
4
4
  "description": "Interactive React UI Components for Sceyt Chat.",
5
5
  "author": "Sceyt",
6
6
  "license": "MIT",