@100mslive/react-native-room-kit 1.1.2 → 1.1.4

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 (658) hide show
  1. package/lib/commonjs/HMSContainer.js.map +1 -1
  2. package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
  3. package/lib/commonjs/HMSPrebuilt.js +3 -0
  4. package/lib/commonjs/HMSPrebuilt.js.map +1 -1
  5. package/lib/commonjs/HMSRoomSetup.js +28 -4
  6. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  7. package/lib/commonjs/Icons/100ms/index.js.map +1 -1
  8. package/lib/commonjs/Icons/Add/index.js.map +1 -1
  9. package/lib/commonjs/Icons/Alert/index.js.map +1 -1
  10. package/lib/commonjs/Icons/AlertTriangle/index.js.map +1 -1
  11. package/lib/commonjs/Icons/AnswerPhone/index.js.map +1 -1
  12. package/lib/commonjs/Icons/BRB/index.js.map +1 -1
  13. package/lib/commonjs/Icons/Bluetooth/index.js.map +1 -1
  14. package/lib/commonjs/Icons/Camera/index.js.map +1 -1
  15. package/lib/commonjs/Icons/Chat/index.js.map +1 -1
  16. package/lib/commonjs/Icons/Check/index.js.map +1 -1
  17. package/lib/commonjs/Icons/CheckBox/index.js.map +1 -1
  18. package/lib/commonjs/Icons/Chevron/index.js.map +1 -1
  19. package/lib/commonjs/Icons/Clock/assets/clock-vector.png +0 -0
  20. package/lib/commonjs/Icons/Clock/assets/clock-vector@2x.png +0 -0
  21. package/lib/commonjs/Icons/Clock/assets/clock-vector@3x.png +0 -0
  22. package/lib/commonjs/Icons/Clock/assets/clock.png +0 -0
  23. package/lib/commonjs/Icons/Clock/assets/clock@2x.png +0 -0
  24. package/lib/commonjs/Icons/Clock/assets/clock@3x.png +0 -0
  25. package/lib/commonjs/Icons/Clock/index.js +7 -2
  26. package/lib/commonjs/Icons/Clock/index.js.map +1 -1
  27. package/lib/commonjs/Icons/Close/index.js.map +1 -1
  28. package/lib/commonjs/Icons/CrossCircle/index.js.map +1 -1
  29. package/lib/commonjs/Icons/End/index.js.map +1 -1
  30. package/lib/commonjs/Icons/Eye/index.js.map +1 -1
  31. package/lib/commonjs/Icons/GenericLogo/index.js.map +1 -1
  32. package/lib/commonjs/Icons/Hamburger/index.js.map +1 -1
  33. package/lib/commonjs/Icons/Hand/index.js.map +1 -1
  34. package/lib/commonjs/Icons/Headphones/index.js.map +1 -1
  35. package/lib/commonjs/Icons/Leave/index.js.map +1 -1
  36. package/lib/commonjs/Icons/Maximize/index.js.map +1 -1
  37. package/lib/commonjs/Icons/Mic/index.js.map +1 -1
  38. package/lib/commonjs/Icons/Minimize/index.js.map +1 -1
  39. package/lib/commonjs/Icons/NetworkQuality/index.js.map +1 -1
  40. package/lib/commonjs/Icons/NoEntry/index.js.map +1 -1
  41. package/lib/commonjs/Icons/Participants/index.js.map +1 -1
  42. package/lib/commonjs/Icons/PauseCircle/index.js.map +1 -1
  43. package/lib/commonjs/Icons/Pencil/index.js.map +1 -1
  44. package/lib/commonjs/Icons/Person/index.js.map +1 -1
  45. package/lib/commonjs/Icons/Pin/index.js.map +1 -1
  46. package/lib/commonjs/Icons/Poll/index.js.map +1 -1
  47. package/lib/commonjs/Icons/PollVote/index.js.map +1 -1
  48. package/lib/commonjs/Icons/Quiz/index.js.map +1 -1
  49. package/lib/commonjs/Icons/Radio/index.js.map +1 -1
  50. package/lib/commonjs/Icons/Recording/index.js.map +1 -1
  51. package/lib/commonjs/Icons/RotateCamera/index.js.map +1 -1
  52. package/lib/commonjs/Icons/ScreenShare/index.js.map +1 -1
  53. package/lib/commonjs/Icons/Search/index.js.map +1 -1
  54. package/lib/commonjs/Icons/Send/index.js.map +1 -1
  55. package/lib/commonjs/Icons/Settings/index.js.map +1 -1
  56. package/lib/commonjs/Icons/Speaker/index.js.map +1 -1
  57. package/lib/commonjs/Icons/Star/index.js.map +1 -1
  58. package/lib/commonjs/Icons/Stop/index.js.map +1 -1
  59. package/lib/commonjs/Icons/ThreeDots/index.js.map +1 -1
  60. package/lib/commonjs/Icons/TrashBin/index.js.map +1 -1
  61. package/lib/commonjs/Icons/Wave/index.js.map +1 -1
  62. package/lib/commonjs/Icons/WelcomeHand/index.js.map +1 -1
  63. package/lib/commonjs/Icons/index.js.map +1 -1
  64. package/lib/commonjs/components/AnimatedFooter.js.map +1 -1
  65. package/lib/commonjs/components/AnimatedHLSFooter.js.map +1 -1
  66. package/lib/commonjs/components/AnimatedHeader.js.map +1 -1
  67. package/lib/commonjs/components/AvatarView.js.map +1 -1
  68. package/lib/commonjs/components/BackButton.js.map +1 -1
  69. package/lib/commonjs/components/BottomSheet.js.map +1 -1
  70. package/lib/commonjs/components/ChangeNameModalContent.js.map +1 -1
  71. package/lib/commonjs/components/Chat/ChatBanner.js.map +1 -1
  72. package/lib/commonjs/components/Chat/ChatFilterBottomSheet.js.map +1 -1
  73. package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -1
  74. package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js.map +1 -1
  75. package/lib/commonjs/components/Chat/ChatFilterItem.js.map +1 -1
  76. package/lib/commonjs/components/Chat/ChatFilterView.js.map +1 -1
  77. package/lib/commonjs/components/Chat/ChatList.js.map +1 -1
  78. package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -1
  79. package/lib/commonjs/components/Chat/ChatMoreActionsModal.js.map +1 -1
  80. package/lib/commonjs/components/Chat/ChatMoreActionsSheetView.js.map +1 -1
  81. package/lib/commonjs/components/Chat/ChatMoreActionsView.js.map +1 -1
  82. package/lib/commonjs/components/Chat/ChatPaused.js.map +1 -1
  83. package/lib/commonjs/components/Chat/MessageOptionsBottomSheet.js.map +1 -1
  84. package/lib/commonjs/components/Chat/MessageOptionsBottomSheetView.js.map +1 -1
  85. package/lib/commonjs/components/Chat/MessageOptionsView.js.map +1 -1
  86. package/lib/commonjs/components/Chat/PeerBlockedFromChat.js.map +1 -1
  87. package/lib/commonjs/components/Chat/PinnedMessages.js.map +1 -1
  88. package/lib/commonjs/components/Chat/index.js.map +1 -1
  89. package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
  90. package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -1
  91. package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
  92. package/lib/commonjs/components/ChatAndParticipants/ChatView.js.map +1 -1
  93. package/lib/commonjs/components/ChatAndParticipants/ParticipantsView.js.map +1 -1
  94. package/lib/commonjs/components/ChatAndParticipants/index.js.map +1 -1
  95. package/lib/commonjs/components/CheckboxInputRow.js.map +1 -1
  96. package/lib/commonjs/components/CompanyLogo.js.map +1 -1
  97. package/lib/commonjs/components/CreatePoll.js +3 -2
  98. package/lib/commonjs/components/CreatePoll.js.map +1 -1
  99. package/lib/commonjs/components/CustomButton.js.map +1 -1
  100. package/lib/commonjs/components/CustomHLSPlayerControls.js.map +1 -1
  101. package/lib/commonjs/components/DefaultModal.js.map +1 -1
  102. package/lib/commonjs/components/DisplayView.js.map +1 -1
  103. package/lib/commonjs/components/EndRoomModal.js.map +1 -1
  104. package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
  105. package/lib/commonjs/components/Footer.js.map +1 -1
  106. package/lib/commonjs/components/FullScreenIndicator.js.map +1 -1
  107. package/lib/commonjs/components/FullScreenVideoView.js.map +1 -1
  108. package/lib/commonjs/components/GridView.js.map +1 -1
  109. package/lib/commonjs/components/HLSFooter.js.map +1 -1
  110. package/lib/commonjs/components/HLSPlayerEmoticons.js.map +1 -1
  111. package/lib/commonjs/components/HLSPlayerStatsView.js.map +1 -1
  112. package/lib/commonjs/components/HLSView.js +15 -1
  113. package/lib/commonjs/components/HLSView.js.map +1 -1
  114. package/lib/commonjs/components/HMSBaseButton.js.map +1 -1
  115. package/lib/commonjs/components/HMSChat.js.map +1 -1
  116. package/lib/commonjs/components/HMSDangerButton.js.map +1 -1
  117. package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
  118. package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -1
  119. package/lib/commonjs/components/HMSHLSNotStarted.js.map +1 -1
  120. package/lib/commonjs/components/HMSHLSStreamLoading.js.map +1 -1
  121. package/lib/commonjs/components/HMSHandRaiseNotification.js.map +1 -1
  122. package/lib/commonjs/components/HMSKeyboardAvoidingView.android.js.map +1 -1
  123. package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -1
  124. package/lib/commonjs/components/HMSLiveIndicator.js.map +1 -1
  125. package/lib/commonjs/components/HMSLiveViewerCount.js.map +1 -1
  126. package/lib/commonjs/components/HMSLocalScreenshareNotification.js.map +1 -1
  127. package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -1
  128. package/lib/commonjs/components/HMSManageAudioOutput.js +1 -1
  129. package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -1
  130. package/lib/commonjs/components/HMSManageCameraRotation.js.map +1 -1
  131. package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
  132. package/lib/commonjs/components/HMSManageLocalAudio.js.map +1 -1
  133. package/lib/commonjs/components/HMSManageLocalVideo.js.map +1 -1
  134. package/lib/commonjs/components/HMSManageRaiseHand.js.map +1 -1
  135. package/lib/commonjs/components/HMSMeetingEnded.js.map +1 -1
  136. package/lib/commonjs/components/HMSNotification.js.map +1 -1
  137. package/lib/commonjs/components/HMSNotifications.js.map +1 -1
  138. package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -1
  139. package/lib/commonjs/components/HMSPollsQuizzesNotification.js +1 -1
  140. package/lib/commonjs/components/HMSPollsQuizzesNotification.js.map +1 -1
  141. package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
  142. package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
  143. package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
  144. package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -1
  145. package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
  146. package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
  147. package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
  148. package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -1
  149. package/lib/commonjs/components/HMSPrimaryButton.js.map +1 -1
  150. package/lib/commonjs/components/HMSReconnectingNotification.js.map +1 -1
  151. package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
  152. package/lib/commonjs/components/HMSRoleChangeDeclinedNotification.js.map +1 -1
  153. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
  154. package/lib/commonjs/components/HMSSecondaryButton.js.map +1 -1
  155. package/lib/commonjs/components/HMSSendMessageInput.js.map +1 -1
  156. package/lib/commonjs/components/HMSTerminalErrorNotification.js.map +1 -1
  157. package/lib/commonjs/components/HMSTextInput.js.map +1 -1
  158. package/lib/commonjs/components/HMSVideoView.js.map +1 -1
  159. package/lib/commonjs/components/Header.js.map +1 -1
  160. package/lib/commonjs/components/LeaderboardEntry.js +140 -0
  161. package/lib/commonjs/components/LeaderboardEntry.js.map +1 -0
  162. package/lib/commonjs/components/LeaveRoomBottomSheet.js.map +1 -1
  163. package/lib/commonjs/components/LocalPeerRegularVideoView.js.map +1 -1
  164. package/lib/commonjs/components/LocalPeerScreenshareView.js.map +1 -1
  165. package/lib/commonjs/components/Meeting.js.map +1 -1
  166. package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
  167. package/lib/commonjs/components/MenuModal/Menu.js.map +1 -1
  168. package/lib/commonjs/components/MenuModal/MenuDivider.js.map +1 -1
  169. package/lib/commonjs/components/MenuModal/MenuItem.js.map +1 -1
  170. package/lib/commonjs/components/MenuModal/index.js.map +1 -1
  171. package/lib/commonjs/components/MiniView.js.map +1 -1
  172. package/lib/commonjs/components/Modals.js.map +1 -1
  173. package/lib/commonjs/components/OverlayContainer.js.map +1 -1
  174. package/lib/commonjs/components/OverlayedViews.js.map +1 -1
  175. package/lib/commonjs/components/PIPView.js.map +1 -1
  176. package/lib/commonjs/components/PaginationDots.js.map +1 -1
  177. package/lib/commonjs/components/Participants/MultiRoleParticipantsList.js.map +1 -1
  178. package/lib/commonjs/components/Participants/ParticipantsAccordian.js.map +1 -1
  179. package/lib/commonjs/components/Participants/ParticipantsAccordianExpanded.js.map +1 -1
  180. package/lib/commonjs/components/Participants/ParticipantsGroupFooter.js.map +1 -1
  181. package/lib/commonjs/components/Participants/ParticipantsGroupHeader.js.map +1 -1
  182. package/lib/commonjs/components/Participants/ParticipantsGroupOptions.js.map +1 -1
  183. package/lib/commonjs/components/Participants/ParticipantsItem.js.map +1 -1
  184. package/lib/commonjs/components/Participants/ParticipantsItemOption.js.map +1 -1
  185. package/lib/commonjs/components/Participants/ParticipantsItemOptions.js.map +1 -1
  186. package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
  187. package/lib/commonjs/components/Participants/ParticipantsListFooter.js.map +1 -1
  188. package/lib/commonjs/components/Participants/ParticipantsSeachInput.js.map +1 -1
  189. package/lib/commonjs/components/Participants/index.js.map +1 -1
  190. package/lib/commonjs/components/ParticipantsCount.js.map +1 -1
  191. package/lib/commonjs/components/PeerDisplayView.js.map +1 -1
  192. package/lib/commonjs/components/PeerMinimizedView.js.map +1 -1
  193. package/lib/commonjs/components/PeerRTCStatsContainer.js.map +1 -1
  194. package/lib/commonjs/components/PeerRTCStatsView.js.map +1 -1
  195. package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
  196. package/lib/commonjs/components/PeerVideoTile/AvatarView.js.map +1 -1
  197. package/lib/commonjs/components/PeerVideoTile/HMSFullScreenButton.js.map +1 -1
  198. package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js.map +1 -1
  199. package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
  200. package/lib/commonjs/components/PeerVideoTile/PeerMetadata.js.map +1 -1
  201. package/lib/commonjs/components/PeerVideoTile/PeerNameAndNetwork.js.map +1 -1
  202. package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +16 -6
  203. package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  204. package/lib/commonjs/components/PeerVideoTile/VideoView.js.map +1 -1
  205. package/lib/commonjs/components/PeerVideoTile/index.js.map +1 -1
  206. package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js.map +1 -1
  207. package/lib/commonjs/components/PollAndQuizQuestionResponseCards.js.map +1 -1
  208. package/lib/commonjs/components/PollAndQuizSheetScreen.js +69 -0
  209. package/lib/commonjs/components/PollAndQuizSheetScreen.js.map +1 -0
  210. package/lib/commonjs/components/PollAndQuizVoting.js +133 -4
  211. package/lib/commonjs/components/PollAndQuizVoting.js.map +1 -1
  212. package/lib/commonjs/components/PollAndQuizzStateLabel.js.map +1 -1
  213. package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js.map +1 -1
  214. package/lib/commonjs/components/PollQuestion.js.map +1 -1
  215. package/lib/commonjs/components/PollQuestionDeleteConfirmation.js.map +1 -1
  216. package/lib/commonjs/components/PollQuestions.js +104 -4
  217. package/lib/commonjs/components/PollQuestions.js.map +1 -1
  218. package/lib/commonjs/components/PollResponseProgressView.js.map +1 -1
  219. package/lib/commonjs/components/PollsAndQuizBottomSheet.js +9 -11
  220. package/lib/commonjs/components/PollsAndQuizBottomSheet.js.map +1 -1
  221. package/lib/commonjs/components/PollsAndQuizzesCard.js +1 -1
  222. package/lib/commonjs/components/PollsAndQuizzesCard.js.map +1 -1
  223. package/lib/commonjs/components/PollsAndQuizzesModalContent.js +26 -120
  224. package/lib/commonjs/components/PollsAndQuizzesModalContent.js.map +1 -1
  225. package/lib/commonjs/components/PollsConfigAndList.js +81 -4
  226. package/lib/commonjs/components/PollsConfigAndList.js.map +1 -1
  227. package/lib/commonjs/components/PressableIcon.js.map +1 -1
  228. package/lib/commonjs/components/Preview.js.map +1 -1
  229. package/lib/commonjs/components/PreviewForRoleChangeModal.js.map +1 -1
  230. package/lib/commonjs/components/PreviousPollsAndQuizzesList.js +7 -15
  231. package/lib/commonjs/components/PreviousPollsAndQuizzesList.js.map +1 -1
  232. package/lib/commonjs/components/QuizEndOptionsView.js.map +1 -1
  233. package/lib/commonjs/components/QuizLeaderboardEntriesScreen.js +284 -0
  234. package/lib/commonjs/components/QuizLeaderboardEntriesScreen.js.map +1 -0
  235. package/lib/commonjs/components/QuizLeaderboardScreen.js +279 -0
  236. package/lib/commonjs/components/QuizLeaderboardScreen.js.map +1 -0
  237. package/lib/commonjs/components/QuizLeaderboardSummary.js +195 -0
  238. package/lib/commonjs/components/QuizLeaderboardSummary.js.map +1 -0
  239. package/lib/commonjs/components/RadioInput.js.map +1 -1
  240. package/lib/commonjs/components/RadioInputRow.js.map +1 -1
  241. package/lib/commonjs/components/ReconnectionView.js.map +1 -1
  242. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  243. package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js.map +1 -1
  244. package/lib/commonjs/components/StatusBar.js.map +1 -1
  245. package/lib/commonjs/components/StopRecordingModalContent.js.map +1 -1
  246. package/lib/commonjs/components/StreamingQualityModalContent.js.map +1 -1
  247. package/lib/commonjs/components/SwitchRow.js.map +1 -1
  248. package/lib/commonjs/components/Tile.js.map +1 -1
  249. package/lib/commonjs/components/TilesContainer.js.map +1 -1
  250. package/lib/commonjs/components/UnmountAfterDelay.js.map +1 -1
  251. package/lib/commonjs/components/VoterParticipationSummary.js +46 -0
  252. package/lib/commonjs/components/VoterParticipationSummary.js.map +1 -0
  253. package/lib/commonjs/components/WebrtcView.js.map +1 -1
  254. package/lib/commonjs/components/WelcomeInMeeting.js.map +1 -1
  255. package/lib/commonjs/components/index.js.map +1 -1
  256. package/lib/commonjs/components/styles.js.map +1 -1
  257. package/lib/commonjs/hooks/useHmsInstance.js.map +1 -1
  258. package/lib/commonjs/hooks-sdk-selectors.js.map +1 -1
  259. package/lib/commonjs/hooks-sdk.js.map +1 -1
  260. package/lib/commonjs/hooks-util-selectors.js.map +1 -1
  261. package/lib/commonjs/hooks-util.js +16 -3
  262. package/lib/commonjs/hooks-util.js.map +1 -1
  263. package/lib/commonjs/index.js.map +1 -1
  264. package/lib/commonjs/modules/HMSManager.js.map +1 -1
  265. package/lib/commonjs/modules/parser.js.map +1 -1
  266. package/lib/commonjs/peerTrackNodeUtils.js.map +1 -1
  267. package/lib/commonjs/redux/actionTypes.js +7 -1
  268. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  269. package/lib/commonjs/redux/actions/index.js +25 -5
  270. package/lib/commonjs/redux/actions/index.js.map +1 -1
  271. package/lib/commonjs/redux/index.js.map +1 -1
  272. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  273. package/lib/commonjs/redux/reducers/chatWindow.js.map +1 -1
  274. package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
  275. package/lib/commonjs/redux/reducers/index.js.map +1 -1
  276. package/lib/commonjs/redux/reducers/message.js.map +1 -1
  277. package/lib/commonjs/redux/reducers/polls.js +65 -5
  278. package/lib/commonjs/redux/reducers/polls.js.map +1 -1
  279. package/lib/commonjs/redux/reducers/userState.js +10 -8
  280. package/lib/commonjs/redux/reducers/userState.js.map +1 -1
  281. package/lib/commonjs/types.js.map +1 -1
  282. package/lib/commonjs/utils/constants.js.map +1 -1
  283. package/lib/commonjs/utils/dimension.js.map +1 -1
  284. package/lib/commonjs/utils/functions.js.map +1 -1
  285. package/lib/commonjs/utils/hooks.js +107 -2
  286. package/lib/commonjs/utils/hooks.js.map +1 -1
  287. package/lib/commonjs/utils/theme.js.map +1 -1
  288. package/lib/commonjs/utils/types.js.map +1 -1
  289. package/lib/commonjs/utils.js.map +1 -1
  290. package/lib/module/HMSContainer.js.map +1 -1
  291. package/lib/module/HMSInstanceSetup.js.map +1 -1
  292. package/lib/module/HMSPrebuilt.js +3 -0
  293. package/lib/module/HMSPrebuilt.js.map +1 -1
  294. package/lib/module/HMSRoomSetup.js +29 -5
  295. package/lib/module/HMSRoomSetup.js.map +1 -1
  296. package/lib/module/Icons/100ms/index.js.map +1 -1
  297. package/lib/module/Icons/Add/index.js.map +1 -1
  298. package/lib/module/Icons/Alert/index.js.map +1 -1
  299. package/lib/module/Icons/AlertTriangle/index.js.map +1 -1
  300. package/lib/module/Icons/AnswerPhone/index.js.map +1 -1
  301. package/lib/module/Icons/BRB/index.js.map +1 -1
  302. package/lib/module/Icons/Bluetooth/index.js.map +1 -1
  303. package/lib/module/Icons/Camera/index.js.map +1 -1
  304. package/lib/module/Icons/Chat/index.js.map +1 -1
  305. package/lib/module/Icons/Check/index.js.map +1 -1
  306. package/lib/module/Icons/CheckBox/index.js.map +1 -1
  307. package/lib/module/Icons/Chevron/index.js.map +1 -1
  308. package/lib/module/Icons/Clock/assets/clock-vector.png +0 -0
  309. package/lib/module/Icons/Clock/assets/clock-vector@2x.png +0 -0
  310. package/lib/module/Icons/Clock/assets/clock-vector@3x.png +0 -0
  311. package/lib/module/Icons/Clock/assets/clock.png +0 -0
  312. package/lib/module/Icons/Clock/assets/clock@2x.png +0 -0
  313. package/lib/module/Icons/Clock/assets/clock@3x.png +0 -0
  314. package/lib/module/Icons/Clock/index.js +7 -2
  315. package/lib/module/Icons/Clock/index.js.map +1 -1
  316. package/lib/module/Icons/Close/index.js.map +1 -1
  317. package/lib/module/Icons/CrossCircle/index.js.map +1 -1
  318. package/lib/module/Icons/End/index.js.map +1 -1
  319. package/lib/module/Icons/Eye/index.js.map +1 -1
  320. package/lib/module/Icons/GenericLogo/index.js.map +1 -1
  321. package/lib/module/Icons/Hamburger/index.js.map +1 -1
  322. package/lib/module/Icons/Hand/index.js.map +1 -1
  323. package/lib/module/Icons/Headphones/index.js.map +1 -1
  324. package/lib/module/Icons/Leave/index.js.map +1 -1
  325. package/lib/module/Icons/Maximize/index.js.map +1 -1
  326. package/lib/module/Icons/Mic/index.js.map +1 -1
  327. package/lib/module/Icons/Minimize/index.js.map +1 -1
  328. package/lib/module/Icons/NetworkQuality/index.js.map +1 -1
  329. package/lib/module/Icons/NoEntry/index.js.map +1 -1
  330. package/lib/module/Icons/Participants/index.js.map +1 -1
  331. package/lib/module/Icons/PauseCircle/index.js.map +1 -1
  332. package/lib/module/Icons/Pencil/index.js.map +1 -1
  333. package/lib/module/Icons/Person/index.js.map +1 -1
  334. package/lib/module/Icons/Pin/index.js.map +1 -1
  335. package/lib/module/Icons/Poll/index.js.map +1 -1
  336. package/lib/module/Icons/PollVote/index.js.map +1 -1
  337. package/lib/module/Icons/Quiz/index.js.map +1 -1
  338. package/lib/module/Icons/Radio/index.js.map +1 -1
  339. package/lib/module/Icons/Recording/index.js.map +1 -1
  340. package/lib/module/Icons/RotateCamera/index.js.map +1 -1
  341. package/lib/module/Icons/ScreenShare/index.js.map +1 -1
  342. package/lib/module/Icons/Search/index.js.map +1 -1
  343. package/lib/module/Icons/Send/index.js.map +1 -1
  344. package/lib/module/Icons/Settings/index.js.map +1 -1
  345. package/lib/module/Icons/Speaker/index.js.map +1 -1
  346. package/lib/module/Icons/Star/index.js.map +1 -1
  347. package/lib/module/Icons/Stop/index.js.map +1 -1
  348. package/lib/module/Icons/ThreeDots/index.js.map +1 -1
  349. package/lib/module/Icons/TrashBin/index.js.map +1 -1
  350. package/lib/module/Icons/Wave/index.js.map +1 -1
  351. package/lib/module/Icons/WelcomeHand/index.js.map +1 -1
  352. package/lib/module/Icons/index.js.map +1 -1
  353. package/lib/module/components/AnimatedFooter.js.map +1 -1
  354. package/lib/module/components/AnimatedHLSFooter.js.map +1 -1
  355. package/lib/module/components/AnimatedHeader.js.map +1 -1
  356. package/lib/module/components/AvatarView.js.map +1 -1
  357. package/lib/module/components/BackButton.js.map +1 -1
  358. package/lib/module/components/BottomSheet.js.map +1 -1
  359. package/lib/module/components/ChangeNameModalContent.js.map +1 -1
  360. package/lib/module/components/Chat/ChatBanner.js.map +1 -1
  361. package/lib/module/components/Chat/ChatFilterBottomSheet.js.map +1 -1
  362. package/lib/module/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -1
  363. package/lib/module/components/Chat/ChatFilterBottomSheetView.js.map +1 -1
  364. package/lib/module/components/Chat/ChatFilterItem.js.map +1 -1
  365. package/lib/module/components/Chat/ChatFilterView.js.map +1 -1
  366. package/lib/module/components/Chat/ChatList.js.map +1 -1
  367. package/lib/module/components/Chat/ChatMessage.js.map +1 -1
  368. package/lib/module/components/Chat/ChatMoreActionsModal.js.map +1 -1
  369. package/lib/module/components/Chat/ChatMoreActionsSheetView.js.map +1 -1
  370. package/lib/module/components/Chat/ChatMoreActionsView.js.map +1 -1
  371. package/lib/module/components/Chat/ChatPaused.js.map +1 -1
  372. package/lib/module/components/Chat/MessageOptionsBottomSheet.js.map +1 -1
  373. package/lib/module/components/Chat/MessageOptionsBottomSheetView.js.map +1 -1
  374. package/lib/module/components/Chat/MessageOptionsView.js.map +1 -1
  375. package/lib/module/components/Chat/PeerBlockedFromChat.js.map +1 -1
  376. package/lib/module/components/Chat/PinnedMessages.js.map +1 -1
  377. package/lib/module/components/Chat/index.js.map +1 -1
  378. package/lib/module/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -1
  379. package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -1
  380. package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -1
  381. package/lib/module/components/ChatAndParticipants/ChatView.js.map +1 -1
  382. package/lib/module/components/ChatAndParticipants/ParticipantsView.js.map +1 -1
  383. package/lib/module/components/ChatAndParticipants/index.js.map +1 -1
  384. package/lib/module/components/CheckboxInputRow.js.map +1 -1
  385. package/lib/module/components/CompanyLogo.js.map +1 -1
  386. package/lib/module/components/CreatePoll.js +4 -3
  387. package/lib/module/components/CreatePoll.js.map +1 -1
  388. package/lib/module/components/CustomButton.js.map +1 -1
  389. package/lib/module/components/CustomHLSPlayerControls.js.map +1 -1
  390. package/lib/module/components/DefaultModal.js.map +1 -1
  391. package/lib/module/components/DisplayView.js.map +1 -1
  392. package/lib/module/components/EndRoomModal.js.map +1 -1
  393. package/lib/module/components/EndRoomModalContent.js.map +1 -1
  394. package/lib/module/components/Footer.js.map +1 -1
  395. package/lib/module/components/FullScreenIndicator.js.map +1 -1
  396. package/lib/module/components/FullScreenVideoView.js.map +1 -1
  397. package/lib/module/components/GridView.js.map +1 -1
  398. package/lib/module/components/HLSFooter.js.map +1 -1
  399. package/lib/module/components/HLSPlayerEmoticons.js.map +1 -1
  400. package/lib/module/components/HLSPlayerStatsView.js.map +1 -1
  401. package/lib/module/components/HLSView.js +17 -3
  402. package/lib/module/components/HLSView.js.map +1 -1
  403. package/lib/module/components/HMSBaseButton.js.map +1 -1
  404. package/lib/module/components/HMSChat.js.map +1 -1
  405. package/lib/module/components/HMSDangerButton.js.map +1 -1
  406. package/lib/module/components/HMSHLSMessage.js.map +1 -1
  407. package/lib/module/components/HMSHLSMessageList.js.map +1 -1
  408. package/lib/module/components/HMSHLSNotStarted.js.map +1 -1
  409. package/lib/module/components/HMSHLSStreamLoading.js.map +1 -1
  410. package/lib/module/components/HMSHandRaiseNotification.js.map +1 -1
  411. package/lib/module/components/HMSKeyboardAvoidingView.android.js.map +1 -1
  412. package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
  413. package/lib/module/components/HMSLiveIndicator.js.map +1 -1
  414. package/lib/module/components/HMSLiveViewerCount.js.map +1 -1
  415. package/lib/module/components/HMSLocalScreenshareNotification.js.map +1 -1
  416. package/lib/module/components/HMSLocalVideoView.js.map +1 -1
  417. package/lib/module/components/HMSManageAudioOutput.js +1 -1
  418. package/lib/module/components/HMSManageAudioOutput.js.map +1 -1
  419. package/lib/module/components/HMSManageCameraRotation.js.map +1 -1
  420. package/lib/module/components/HMSManageLeave.js.map +1 -1
  421. package/lib/module/components/HMSManageLocalAudio.js.map +1 -1
  422. package/lib/module/components/HMSManageLocalVideo.js.map +1 -1
  423. package/lib/module/components/HMSManageRaiseHand.js.map +1 -1
  424. package/lib/module/components/HMSMeetingEnded.js.map +1 -1
  425. package/lib/module/components/HMSNotification.js.map +1 -1
  426. package/lib/module/components/HMSNotifications.js.map +1 -1
  427. package/lib/module/components/HMSOverlayChatView.js.map +1 -1
  428. package/lib/module/components/HMSPollsQuizzesNotification.js +2 -2
  429. package/lib/module/components/HMSPollsQuizzesNotification.js.map +1 -1
  430. package/lib/module/components/HMSPreviewEditName.js.map +1 -1
  431. package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -1
  432. package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
  433. package/lib/module/components/HMSPreviewNetworkQuality.js.map +1 -1
  434. package/lib/module/components/HMSPreviewPeersList.js.map +1 -1
  435. package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
  436. package/lib/module/components/HMSPreviewTile.js.map +1 -1
  437. package/lib/module/components/HMSPreviewTitle.js.map +1 -1
  438. package/lib/module/components/HMSPrimaryButton.js.map +1 -1
  439. package/lib/module/components/HMSReconnectingNotification.js.map +1 -1
  440. package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
  441. package/lib/module/components/HMSRoleChangeDeclinedNotification.js.map +1 -1
  442. package/lib/module/components/HMSRoomOptions.js.map +1 -1
  443. package/lib/module/components/HMSSecondaryButton.js.map +1 -1
  444. package/lib/module/components/HMSSendMessageInput.js.map +1 -1
  445. package/lib/module/components/HMSTerminalErrorNotification.js.map +1 -1
  446. package/lib/module/components/HMSTextInput.js.map +1 -1
  447. package/lib/module/components/HMSVideoView.js.map +1 -1
  448. package/lib/module/components/Header.js.map +1 -1
  449. package/lib/module/components/LeaderboardEntry.js +131 -0
  450. package/lib/module/components/LeaderboardEntry.js.map +1 -0
  451. package/lib/module/components/LeaveRoomBottomSheet.js.map +1 -1
  452. package/lib/module/components/LocalPeerRegularVideoView.js.map +1 -1
  453. package/lib/module/components/LocalPeerScreenshareView.js.map +1 -1
  454. package/lib/module/components/Meeting.js.map +1 -1
  455. package/lib/module/components/MeetingScreenContent.js.map +1 -1
  456. package/lib/module/components/MenuModal/Menu.js.map +1 -1
  457. package/lib/module/components/MenuModal/MenuDivider.js.map +1 -1
  458. package/lib/module/components/MenuModal/MenuItem.js.map +1 -1
  459. package/lib/module/components/MenuModal/index.js.map +1 -1
  460. package/lib/module/components/MiniView.js.map +1 -1
  461. package/lib/module/components/Modals.js.map +1 -1
  462. package/lib/module/components/OverlayContainer.js.map +1 -1
  463. package/lib/module/components/OverlayedViews.js.map +1 -1
  464. package/lib/module/components/PIPView.js.map +1 -1
  465. package/lib/module/components/PaginationDots.js.map +1 -1
  466. package/lib/module/components/Participants/MultiRoleParticipantsList.js.map +1 -1
  467. package/lib/module/components/Participants/ParticipantsAccordian.js.map +1 -1
  468. package/lib/module/components/Participants/ParticipantsAccordianExpanded.js.map +1 -1
  469. package/lib/module/components/Participants/ParticipantsGroupFooter.js.map +1 -1
  470. package/lib/module/components/Participants/ParticipantsGroupHeader.js.map +1 -1
  471. package/lib/module/components/Participants/ParticipantsGroupOptions.js.map +1 -1
  472. package/lib/module/components/Participants/ParticipantsItem.js.map +1 -1
  473. package/lib/module/components/Participants/ParticipantsItemOption.js.map +1 -1
  474. package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -1
  475. package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
  476. package/lib/module/components/Participants/ParticipantsListFooter.js.map +1 -1
  477. package/lib/module/components/Participants/ParticipantsSeachInput.js.map +1 -1
  478. package/lib/module/components/Participants/index.js.map +1 -1
  479. package/lib/module/components/ParticipantsCount.js.map +1 -1
  480. package/lib/module/components/PeerDisplayView.js.map +1 -1
  481. package/lib/module/components/PeerMinimizedView.js.map +1 -1
  482. package/lib/module/components/PeerRTCStatsContainer.js.map +1 -1
  483. package/lib/module/components/PeerRTCStatsView.js.map +1 -1
  484. package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
  485. package/lib/module/components/PeerVideoTile/AvatarView.js.map +1 -1
  486. package/lib/module/components/PeerVideoTile/HMSFullScreenButton.js.map +1 -1
  487. package/lib/module/components/PeerVideoTile/HMSPinchGesture.js.map +1 -1
  488. package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
  489. package/lib/module/components/PeerVideoTile/PeerMetadata.js.map +1 -1
  490. package/lib/module/components/PeerVideoTile/PeerNameAndNetwork.js.map +1 -1
  491. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +19 -7
  492. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  493. package/lib/module/components/PeerVideoTile/VideoView.js.map +1 -1
  494. package/lib/module/components/PeerVideoTile/index.js.map +1 -1
  495. package/lib/module/components/PollAndQuizQuestionResponseCard.js.map +1 -1
  496. package/lib/module/components/PollAndQuizQuestionResponseCards.js.map +1 -1
  497. package/lib/module/components/PollAndQuizSheetScreen.js +60 -0
  498. package/lib/module/components/PollAndQuizSheetScreen.js.map +1 -0
  499. package/lib/module/components/PollAndQuizVoting.js +135 -6
  500. package/lib/module/components/PollAndQuizVoting.js.map +1 -1
  501. package/lib/module/components/PollAndQuizzStateLabel.js.map +1 -1
  502. package/lib/module/components/PollQDeleteConfirmationSheetView.js.map +1 -1
  503. package/lib/module/components/PollQuestion.js.map +1 -1
  504. package/lib/module/components/PollQuestionDeleteConfirmation.js.map +1 -1
  505. package/lib/module/components/PollQuestions.js +107 -7
  506. package/lib/module/components/PollQuestions.js.map +1 -1
  507. package/lib/module/components/PollResponseProgressView.js.map +1 -1
  508. package/lib/module/components/PollsAndQuizBottomSheet.js +11 -13
  509. package/lib/module/components/PollsAndQuizBottomSheet.js.map +1 -1
  510. package/lib/module/components/PollsAndQuizzesCard.js +2 -2
  511. package/lib/module/components/PollsAndQuizzesCard.js.map +1 -1
  512. package/lib/module/components/PollsAndQuizzesModalContent.js +28 -122
  513. package/lib/module/components/PollsAndQuizzesModalContent.js.map +1 -1
  514. package/lib/module/components/PollsConfigAndList.js +82 -5
  515. package/lib/module/components/PollsConfigAndList.js.map +1 -1
  516. package/lib/module/components/PressableIcon.js.map +1 -1
  517. package/lib/module/components/Preview.js.map +1 -1
  518. package/lib/module/components/PreviewForRoleChangeModal.js.map +1 -1
  519. package/lib/module/components/PreviousPollsAndQuizzesList.js +7 -15
  520. package/lib/module/components/PreviousPollsAndQuizzesList.js.map +1 -1
  521. package/lib/module/components/QuizEndOptionsView.js.map +1 -1
  522. package/lib/module/components/QuizLeaderboardEntriesScreen.js +275 -0
  523. package/lib/module/components/QuizLeaderboardEntriesScreen.js.map +1 -0
  524. package/lib/module/components/QuizLeaderboardScreen.js +270 -0
  525. package/lib/module/components/QuizLeaderboardScreen.js.map +1 -0
  526. package/lib/module/components/QuizLeaderboardSummary.js +186 -0
  527. package/lib/module/components/QuizLeaderboardSummary.js.map +1 -0
  528. package/lib/module/components/RadioInput.js.map +1 -1
  529. package/lib/module/components/RadioInputRow.js.map +1 -1
  530. package/lib/module/components/ReconnectionView.js.map +1 -1
  531. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  532. package/lib/module/components/RoomSettingsModalDebugModeContent.js.map +1 -1
  533. package/lib/module/components/StatusBar.js.map +1 -1
  534. package/lib/module/components/StopRecordingModalContent.js.map +1 -1
  535. package/lib/module/components/StreamingQualityModalContent.js.map +1 -1
  536. package/lib/module/components/SwitchRow.js.map +1 -1
  537. package/lib/module/components/Tile.js.map +1 -1
  538. package/lib/module/components/TilesContainer.js.map +1 -1
  539. package/lib/module/components/UnmountAfterDelay.js.map +1 -1
  540. package/lib/module/components/VoterParticipationSummary.js +37 -0
  541. package/lib/module/components/VoterParticipationSummary.js.map +1 -0
  542. package/lib/module/components/WebrtcView.js.map +1 -1
  543. package/lib/module/components/WelcomeInMeeting.js.map +1 -1
  544. package/lib/module/components/index.js.map +1 -1
  545. package/lib/module/components/styles.js.map +1 -1
  546. package/lib/module/hooks/useHmsInstance.js.map +1 -1
  547. package/lib/module/hooks-sdk-selectors.js.map +1 -1
  548. package/lib/module/hooks-sdk.js.map +1 -1
  549. package/lib/module/hooks-util-selectors.js.map +1 -1
  550. package/lib/module/hooks-util.js +16 -3
  551. package/lib/module/hooks-util.js.map +1 -1
  552. package/lib/module/index.js.map +1 -1
  553. package/lib/module/modules/HMSManager.js.map +1 -1
  554. package/lib/module/modules/parser.js.map +1 -1
  555. package/lib/module/peerTrackNodeUtils.js.map +1 -1
  556. package/lib/module/redux/actionTypes.js +7 -1
  557. package/lib/module/redux/actionTypes.js.map +1 -1
  558. package/lib/module/redux/actions/index.js +18 -3
  559. package/lib/module/redux/actions/index.js.map +1 -1
  560. package/lib/module/redux/index.js.map +1 -1
  561. package/lib/module/redux/reducers/appState.js.map +1 -1
  562. package/lib/module/redux/reducers/chatWindow.js.map +1 -1
  563. package/lib/module/redux/reducers/hmsStates.js.map +1 -1
  564. package/lib/module/redux/reducers/index.js.map +1 -1
  565. package/lib/module/redux/reducers/message.js.map +1 -1
  566. package/lib/module/redux/reducers/polls.js +65 -5
  567. package/lib/module/redux/reducers/polls.js.map +1 -1
  568. package/lib/module/redux/reducers/userState.js +10 -8
  569. package/lib/module/redux/reducers/userState.js.map +1 -1
  570. package/lib/module/types.js.map +1 -1
  571. package/lib/module/utils/constants.js.map +1 -1
  572. package/lib/module/utils/dimension.js.map +1 -1
  573. package/lib/module/utils/functions.js.map +1 -1
  574. package/lib/module/utils/hooks.js +105 -2
  575. package/lib/module/utils/hooks.js.map +1 -1
  576. package/lib/module/utils/theme.js.map +1 -1
  577. package/lib/module/utils/types.js.map +1 -1
  578. package/lib/module/utils.js.map +1 -1
  579. package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
  580. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  581. package/lib/typescript/Icons/Clock/index.d.ts +1 -0
  582. package/lib/typescript/Icons/Clock/index.d.ts.map +1 -1
  583. package/lib/typescript/components/CreatePoll.d.ts.map +1 -1
  584. package/lib/typescript/components/HLSView.d.ts.map +1 -1
  585. package/lib/typescript/components/LeaderboardEntry.d.ts +11 -0
  586. package/lib/typescript/components/LeaderboardEntry.d.ts.map +1 -0
  587. package/lib/typescript/components/PollAndQuizSheetScreen.d.ts +8 -0
  588. package/lib/typescript/components/PollAndQuizSheetScreen.d.ts.map +1 -0
  589. package/lib/typescript/components/PollAndQuizVoting.d.ts +2 -0
  590. package/lib/typescript/components/PollAndQuizVoting.d.ts.map +1 -1
  591. package/lib/typescript/components/PollQuestions.d.ts +2 -0
  592. package/lib/typescript/components/PollQuestions.d.ts.map +1 -1
  593. package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts.map +1 -1
  594. package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts +0 -1
  595. package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts.map +1 -1
  596. package/lib/typescript/components/PollsConfigAndList.d.ts +1 -0
  597. package/lib/typescript/components/PollsConfigAndList.d.ts.map +1 -1
  598. package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts.map +1 -1
  599. package/lib/typescript/components/QuizLeaderboardEntriesScreen.d.ts +8 -0
  600. package/lib/typescript/components/QuizLeaderboardEntriesScreen.d.ts.map +1 -0
  601. package/lib/typescript/components/QuizLeaderboardScreen.d.ts +8 -0
  602. package/lib/typescript/components/QuizLeaderboardScreen.d.ts.map +1 -0
  603. package/lib/typescript/components/QuizLeaderboardSummary.d.ts +9 -0
  604. package/lib/typescript/components/QuizLeaderboardSummary.d.ts.map +1 -0
  605. package/lib/typescript/components/VoterParticipationSummary.d.ts +7 -0
  606. package/lib/typescript/components/VoterParticipationSummary.d.ts.map +1 -0
  607. package/lib/typescript/hooks-util.d.ts.map +1 -1
  608. package/lib/typescript/redux/actionTypes.d.ts +29 -8
  609. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  610. package/lib/typescript/redux/actions/index.d.ts +10 -10
  611. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  612. package/lib/typescript/redux/index.d.ts +20 -18
  613. package/lib/typescript/redux/index.d.ts.map +1 -1
  614. package/lib/typescript/redux/reducers/index.d.ts +20 -18
  615. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  616. package/lib/typescript/redux/reducers/polls.d.ts +3 -2
  617. package/lib/typescript/redux/reducers/polls.d.ts.map +1 -1
  618. package/lib/typescript/redux/reducers/userState.d.ts +3 -2
  619. package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
  620. package/lib/typescript/types.d.ts +9 -2
  621. package/lib/typescript/types.d.ts.map +1 -1
  622. package/lib/typescript/utils/hooks.d.ts +6 -0
  623. package/lib/typescript/utils/hooks.d.ts.map +1 -1
  624. package/package.json +3 -3
  625. package/src/HMSPrebuilt.tsx +4 -0
  626. package/src/HMSRoomSetup.tsx +35 -5
  627. package/src/Icons/Clock/assets/clock-vector.png +0 -0
  628. package/src/Icons/Clock/assets/clock-vector@2x.png +0 -0
  629. package/src/Icons/Clock/assets/clock-vector@3x.png +0 -0
  630. package/src/Icons/Clock/assets/clock.png +0 -0
  631. package/src/Icons/Clock/assets/clock@2x.png +0 -0
  632. package/src/Icons/Clock/assets/clock@3x.png +0 -0
  633. package/src/Icons/Clock/index.tsx +16 -3
  634. package/src/components/CreatePoll.tsx +7 -2
  635. package/src/components/HLSView.tsx +27 -1
  636. package/src/components/HMSManageAudioOutput.tsx +1 -1
  637. package/src/components/HMSPollsQuizzesNotification.tsx +2 -2
  638. package/src/components/LeaderboardEntry.tsx +181 -0
  639. package/src/components/PeerVideoTile/PeerVideoTileView.tsx +12 -12
  640. package/src/components/PollAndQuizSheetScreen.tsx +85 -0
  641. package/src/components/PollAndQuizVoting.tsx +181 -7
  642. package/src/components/PollQuestions.tsx +171 -49
  643. package/src/components/PollsAndQuizBottomSheet.tsx +20 -42
  644. package/src/components/PollsAndQuizzesCard.tsx +2 -2
  645. package/src/components/PollsAndQuizzesModalContent.tsx +40 -163
  646. package/src/components/PollsConfigAndList.tsx +107 -11
  647. package/src/components/PreviousPollsAndQuizzesList.tsx +33 -40
  648. package/src/components/QuizLeaderboardEntriesScreen.tsx +323 -0
  649. package/src/components/QuizLeaderboardScreen.tsx +342 -0
  650. package/src/components/QuizLeaderboardSummary.tsx +207 -0
  651. package/src/components/VoterParticipationSummary.tsx +67 -0
  652. package/src/hooks-util.ts +27 -9
  653. package/src/redux/actionTypes.ts +35 -5
  654. package/src/redux/actions/index.ts +36 -10
  655. package/src/redux/reducers/polls.ts +84 -6
  656. package/src/redux/reducers/userState.ts +17 -12
  657. package/src/types.ts +14 -2
  658. package/src/utils/hooks.ts +190 -3
@@ -3,6 +3,7 @@ import type {
3
3
  HMSPollQuestion,
4
4
  HMSPollQuestionType,
5
5
  HMSPollType,
6
+ PollLeaderboardResponse,
6
7
  } from '@100mslive/react-native-hms';
7
8
 
8
9
  const createRequests = (base: String) => {
@@ -195,6 +196,8 @@ export enum CreatePollStages {
195
196
  POLL_CONFIG,
196
197
  POLL_QUESTION_CONFIG,
197
198
  POLL_VOTING,
199
+ QUIZ_LEADERBOARD,
200
+ QUIZ_LEADERBOARD_ENTRIES,
198
201
  }
199
202
 
200
203
  export type PollConfig = {
@@ -217,7 +220,10 @@ export type PollsActionType =
217
220
  | SetDeleteConfirmationVisible
218
221
  | SetPollNameAction
219
222
  | SetPollConfigAction
220
- | SetPollStageAction
223
+ | PushToNavigationStackAction
224
+ | ResetNavigationStackAction
225
+ | PopFromNavigationStackAction
226
+ | ReplaceTopOfNavigationStackAction
221
227
  | AddPollQuestionAction
222
228
  | DeletePollQuestionAction
223
229
  | SetSelectedQuestionIndexAction
@@ -241,6 +247,7 @@ export type PollsActionType =
241
247
  | AddPollQuestionResponseAction
242
248
  | RemovePollQuestionResponseAction
243
249
  | AddCuedPollIdAction
250
+ | AddLeaderboardAction
244
251
  | { type: HmsStateActionTypes.CLEAR_STATES };
245
252
 
246
253
  export type ClearPollFormStateAction = {
@@ -262,9 +269,22 @@ export type SetPollConfigAction = {
262
269
  pollConfig: Partial<PollConfig>;
263
270
  };
264
271
 
265
- export type SetPollStageAction = {
266
- type: PollsStateActionTypes.SET_POLL_STAGE;
267
- pollStage: CreatePollStages;
272
+ export type PushToNavigationStackAction = {
273
+ type: PollsStateActionTypes.PUSH_TO_NAVIGATION_STACK;
274
+ screen: CreatePollStages;
275
+ };
276
+
277
+ export type ResetNavigationStackAction = {
278
+ type: PollsStateActionTypes.RESET_NAVIGATION_STACK;
279
+ };
280
+
281
+ export type PopFromNavigationStackAction = {
282
+ type: PollsStateActionTypes.POP_FROM_NAVIGATION_STACK;
283
+ };
284
+
285
+ export type ReplaceTopOfNavigationStackAction = {
286
+ type: PollsStateActionTypes.REPLACE_TOP_OF_NAVIGATION_STACK;
287
+ screen: CreatePollStages;
268
288
  };
269
289
 
270
290
  export type AddPollQuestionAction = {
@@ -391,12 +411,21 @@ export type AddCuedPollIdAction = {
391
411
  pollId: HMSPoll['pollId'];
392
412
  };
393
413
 
414
+ export type AddLeaderboardAction = {
415
+ type: PollsStateActionTypes.ADD_LEADERBOARD;
416
+ pollId: HMSPoll['pollId'];
417
+ leaderboard: PollLeaderboardResponse;
418
+ };
419
+
394
420
  export enum PollsStateActionTypes {
395
421
  CLEAR_POLL_FORM_STATE = 'CLEAR_POLL_FORM_STATE',
396
422
  SET_DELETE_CONFIRMATION_VISIBLE = 'SET_DELETE_CONFIRMATION_VISIBLE',
397
423
  SET_POLL_NAME = 'SET_POLL_NAME',
398
424
  SET_POLL_CONFIG = 'SET_POLL_CONFIG',
399
- SET_POLL_STAGE = 'SET_POLL_STAGE',
425
+ PUSH_TO_NAVIGATION_STACK = 'PUSH_TO_NAVIGATION_STACK',
426
+ RESET_NAVIGATION_STACK = 'RESET_NAVIGATION_STACK',
427
+ POP_FROM_NAVIGATION_STACK = 'POP_FROM_NAVIGATION_STACK',
428
+ REPLACE_TOP_OF_NAVIGATION_STACK = 'REPLACE_TOP_OF_NAVIGATION_STACK',
400
429
  ADD_POLL_QUESTION = 'ADD_POLL_QUESTION',
401
430
  DELETE_POLL_QUESTION = 'DELETE_POLL_QUESTION',
402
431
  SET_SELECTED_QUESTION_INDEX = 'SET_SELECTED_QUESTION_INDEX',
@@ -419,4 +448,5 @@ export enum PollsStateActionTypes {
419
448
  REMOVE_POLL_QUESTION_RESPONSE = 'REMOVE_POLL_QUESTION_RESPONSE',
420
449
  ADD_POLL_QUESTION_RESPONSE = 'ADD_POLL_QUESTION_RESPONSE',
421
450
  ADD_CUED_POLL_ID = 'ADD_CUED_POLL_ID',
451
+ ADD_LEADERBOARD = 'ADD_LEADERBOARD',
422
452
  }
@@ -32,7 +32,6 @@ import type {
32
32
  AddPollQuestionAction,
33
33
  SetPollConfigAction,
34
34
  SetPollNameAction,
35
- SetPollStageAction,
36
35
  DeletePollQuestionAction,
37
36
  SetDeleteConfirmationVisible,
38
37
  SetSelectedQuestionIndexAction,
@@ -54,12 +53,18 @@ import type {
54
53
  RemovePollQuestionResponseAction,
55
54
  SetQuestionPointWeightageAction,
56
55
  SetQuestionCorrectOptionAction,
56
+ PushToNavigationStackAction,
57
+ PopFromNavigationStackAction,
58
+ ReplaceTopOfNavigationStackAction,
59
+ AddLeaderboardAction,
60
+ ResetNavigationStackAction,
57
61
  } from '../actionTypes';
58
62
  import { MeetingState } from '../../types';
59
63
  import type { ChatState, Notification, PinnedMessage } from '../../types';
60
64
 
61
65
  export const setPrebuiltData = (data: {
62
- roomCode: string;
66
+ roomCode?: string;
67
+ token?: string;
63
68
  options?: {
64
69
  userName?: string;
65
70
  userId?: string;
@@ -160,9 +165,6 @@ export const clearPeerData = () => ({
160
165
  });
161
166
 
162
167
  export const saveUserData = (data: {
163
- userName?: String;
164
- roomID?: String;
165
- roomCode?: String;
166
168
  hmsInstance?: HMSSDK;
167
169
  hmsSessionStore?: HMSSessionStore;
168
170
  spotlightTrackId?: string | null;
@@ -491,11 +493,26 @@ export const setPollConfig = (
491
493
  pollConfig,
492
494
  });
493
495
 
494
- export const setPollStage = (
495
- pollStage: SetPollStageAction['pollStage']
496
- ): SetPollStageAction => ({
497
- type: PollsStateActionTypes.SET_POLL_STAGE,
498
- pollStage,
496
+ export const pushToNavigationStack = (
497
+ screen: PushToNavigationStackAction['screen']
498
+ ): PushToNavigationStackAction => ({
499
+ type: PollsStateActionTypes.PUSH_TO_NAVIGATION_STACK,
500
+ screen,
501
+ });
502
+
503
+ export const resetNavigationStack = (): ResetNavigationStackAction => ({
504
+ type: PollsStateActionTypes.RESET_NAVIGATION_STACK,
505
+ });
506
+
507
+ export const popFromNavigationStack = (): PopFromNavigationStackAction => ({
508
+ type: PollsStateActionTypes.POP_FROM_NAVIGATION_STACK,
509
+ });
510
+
511
+ export const replaceTopOfNavigationStack = (
512
+ screen: ReplaceTopOfNavigationStackAction['screen']
513
+ ): ReplaceTopOfNavigationStackAction => ({
514
+ type: PollsStateActionTypes.REPLACE_TOP_OF_NAVIGATION_STACK,
515
+ screen,
499
516
  });
500
517
 
501
518
  export const addPollQuestion = (): AddPollQuestionAction => ({
@@ -672,3 +689,12 @@ export const addCuedPollId = (pollId: string) => ({
672
689
  type: PollsStateActionTypes.ADD_CUED_POLL_ID,
673
690
  pollId,
674
691
  });
692
+
693
+ export const addLeaderboard = (
694
+ pollId: AddLeaderboardAction['pollId'],
695
+ leaderboard: AddLeaderboardAction['leaderboard']
696
+ ): AddLeaderboardAction => ({
697
+ type: PollsStateActionTypes.ADD_LEADERBOARD,
698
+ pollId,
699
+ leaderboard,
700
+ });
@@ -1,5 +1,8 @@
1
1
  import { HMSPollQuestionType, HMSPollType } from '@100mslive/react-native-hms';
2
- import type { HMSPoll } from '@100mslive/react-native-hms';
2
+ import type {
3
+ HMSPoll,
4
+ PollLeaderboardResponse,
5
+ } from '@100mslive/react-native-hms';
3
6
 
4
7
  import {
5
8
  PollsStateActionTypes,
@@ -30,7 +33,7 @@ function getDefaultQuestionObj(): PollQuestionUI {
30
33
  type IntialStateType = {
31
34
  pollName: string;
32
35
  pollConfig: PollConfig;
33
- stage: CreatePollStages;
36
+ navigationStack: CreatePollStages[];
34
37
  questions: PollQuestionUI[];
35
38
  deleteConfirmationVisible: boolean;
36
39
  selectedPollQuestionIndex: number | null;
@@ -39,6 +42,7 @@ type IntialStateType = {
39
42
  cuedPollIds: HMSPoll['pollId'][]; // In case of HLSViewer, pollIds should be aligned with onCue event
40
43
  polls: Record<string, HMSPoll>;
41
44
  pollsResponses: Record<string, Record<number, number | number[]>>;
45
+ leaderboards: Record<string, PollLeaderboardResponse>;
42
46
  };
43
47
 
44
48
  const INITIAL_STATE: IntialStateType = {
@@ -48,7 +52,7 @@ const INITIAL_STATE: IntialStateType = {
48
52
  voteCountHidden: false,
49
53
  resultsAnonymous: false,
50
54
  },
51
- stage: CreatePollStages.POLL_CONFIG,
55
+ navigationStack: [CreatePollStages.POLL_CONFIG],
52
56
  questions: [getDefaultQuestionObj()],
53
57
  deleteConfirmationVisible: false,
54
58
  selectedPollQuestionIndex: null,
@@ -57,6 +61,7 @@ const INITIAL_STATE: IntialStateType = {
57
61
  cuedPollIds: [],
58
62
  polls: {},
59
63
  pollsResponses: {},
64
+ leaderboards: {},
60
65
  };
61
66
 
62
67
  const hmsStatesReducer = (
@@ -87,11 +92,30 @@ const hmsStatesReducer = (
87
92
  : state.questions,
88
93
  selectedPollQuestionIndex: null,
89
94
  };
90
- case PollsStateActionTypes.SET_POLL_STAGE:
95
+ case PollsStateActionTypes.PUSH_TO_NAVIGATION_STACK:
91
96
  return {
92
97
  ...state,
93
- stage: action.pollStage,
94
- selectedPollQuestionIndex: null,
98
+ navigationStack: [...state.navigationStack, action.screen],
99
+ };
100
+ case PollsStateActionTypes.RESET_NAVIGATION_STACK:
101
+ return {
102
+ ...state,
103
+ navigationStack: INITIAL_STATE.navigationStack,
104
+ };
105
+ case PollsStateActionTypes.POP_FROM_NAVIGATION_STACK: {
106
+ const updatedNavigationStack = [...state.navigationStack];
107
+ updatedNavigationStack.pop();
108
+ return {
109
+ ...state,
110
+ navigationStack: updatedNavigationStack,
111
+ };
112
+ }
113
+ case PollsStateActionTypes.REPLACE_TOP_OF_NAVIGATION_STACK:
114
+ const updatedNavigationStack = [...state.navigationStack];
115
+ updatedNavigationStack[updatedNavigationStack.length - 1] = action.screen;
116
+ return {
117
+ ...state,
118
+ navigationStack: updatedNavigationStack,
95
119
  };
96
120
  case PollsStateActionTypes.ADD_POLL_QUESTION:
97
121
  return {
@@ -286,6 +310,51 @@ const hmsStatesReducer = (
286
310
  selectedPollId: action.pollId,
287
311
  };
288
312
  case PollsStateActionTypes.ADD_POLL:
313
+ const prevPoll = state.polls[action.poll.pollId];
314
+
315
+ // Hack: Restore previous state of poll if current poll has missing myResponses and voteCount
316
+ if (
317
+ prevPoll &&
318
+ Array.isArray(prevPoll.questions) &&
319
+ prevPoll.questions.length > 0
320
+ ) {
321
+ action.poll.questions?.forEach((question) => {
322
+ const prevQuestion = prevPoll.questions?.find(
323
+ (prevQuestion) => prevQuestion.index === question.index
324
+ );
325
+
326
+ //#region Restore previous responses on question if current question has no responses
327
+ const prevResponsesOnQuestion = prevQuestion?.myResponses;
328
+ if (
329
+ Array.isArray(prevResponsesOnQuestion) &&
330
+ prevResponsesOnQuestion.length > 0 &&
331
+ (!question.myResponses || question.myResponses.length <= 0)
332
+ ) {
333
+ question.myResponses = prevResponsesOnQuestion;
334
+ }
335
+ //#endregion
336
+
337
+ //#region Restore previous voteCount on question options if current question options has no voteCount
338
+ const prevOptions = prevQuestion?.options;
339
+
340
+ question.options?.forEach((option) => {
341
+ const prevOption = prevOptions?.find(
342
+ (prevOption) => prevOption.index === option.index
343
+ );
344
+
345
+ // Edge Case: User changes response on question, due to which new vountCount becomes 0, and we are treating as invalid value
346
+ if (
347
+ option.voteCount <= 0 &&
348
+ prevOption &&
349
+ prevOption?.voteCount > 0
350
+ ) {
351
+ option.voteCount = prevOption.voteCount;
352
+ }
353
+ });
354
+ //#endregion
355
+ });
356
+ }
357
+
289
358
  return {
290
359
  ...state,
291
360
  polls: {
@@ -360,6 +429,15 @@ const hmsStatesReducer = (
360
429
  cuedPollIds: [...state.cuedPollIds, action.pollId],
361
430
  };
362
431
  }
432
+ case PollsStateActionTypes.ADD_LEADERBOARD: {
433
+ return {
434
+ ...state,
435
+ leaderboards: {
436
+ ...state.leaderboards,
437
+ [action.pollId]: action.leaderboard,
438
+ },
439
+ };
440
+ }
363
441
  case PollsStateActionTypes.CLEAR_POLL_FORM_STATE: {
364
442
  return {
365
443
  ...INITIAL_STATE,
@@ -3,9 +3,11 @@ import type {
3
3
  HMSSDK,
4
4
  HMSSessionStore,
5
5
  } from '@100mslive/react-native-hms';
6
- import { getMeetingCode, getMeetingUrl } from '../../utils/functions';
7
6
  import ActionTypes, { HmsStateActionTypes } from '../actionTypes';
8
- import type { HMSIOSScreenShareConfig, OnLeaveHandler } from '../../utils/types';
7
+ import type {
8
+ HMSIOSScreenShareConfig,
9
+ OnLeaveHandler,
10
+ } from '../../utils/types';
9
11
 
10
12
  type ActionType = {
11
13
  payload: any;
@@ -15,13 +17,14 @@ type ActionType = {
15
17
  type IntialStateType = {
16
18
  userName: string;
17
19
  userId: string | undefined;
18
- endPoints: { init: string; token: string; layout: string; } | undefined;
20
+ endPoints: { init: string; token: string; layout: string } | undefined;
19
21
  debugMode: boolean;
20
- roomID: string;
22
+ roomID: string | undefined;
21
23
  hmsInstance?: HMSSDK;
22
24
  hmsSessionStore?: HMSSessionStore | null;
23
25
  spotlightTrackId?: string | null;
24
- roomCode: string;
26
+ roomCode: string | undefined;
27
+ token: string | undefined;
25
28
  isHLSFlow: boolean;
26
29
  roles: HMSRole[];
27
30
  iosBuildConfig: HMSIOSScreenShareConfig | null;
@@ -34,8 +37,9 @@ const INITIAL_STATE: IntialStateType = {
34
37
  endPoints: undefined,
35
38
  debugMode: false,
36
39
  hmsInstance: undefined,
37
- roomID: getMeetingUrl(),
38
- roomCode: getMeetingCode(),
40
+ roomID: undefined,
41
+ roomCode: undefined,
42
+ token: undefined,
39
43
  isHLSFlow: true,
40
44
  roles: [],
41
45
  hmsSessionStore: null,
@@ -73,11 +77,12 @@ const userReducer = (
73
77
  };
74
78
  case HmsStateActionTypes.SET_PREBUILT_DATA:
75
79
  state.roomCode = action.payload.roomCode;
76
- state.userName = action.payload.options.userName ?? '';
77
- state.userId = action.payload.options.userId;
78
- state.endPoints = action.payload.options.endPoints;
79
- state.debugMode = action.payload.options.debugMode ?? false;
80
- state.iosBuildConfig = action.payload.options.ios ?? null;
80
+ state.token = action.payload.token;
81
+ state.userName = action.payload.options?.userName ?? '';
82
+ state.userId = action.payload.options?.userId;
83
+ state.endPoints = action.payload.options?.endPoints;
84
+ state.debugMode = action.payload.options?.debugMode ?? false;
85
+ state.iosBuildConfig = action.payload.options?.ios ?? null;
81
86
 
82
87
  return state;
83
88
  case HmsStateActionTypes.SET_ON_LEAVE_HANDLER:
package/src/types.ts CHANGED
@@ -9,8 +9,7 @@ export enum MeetingState {
9
9
  MEETING_ENDED,
10
10
  ERROR,
11
11
  }
12
- export interface HMSPrebuiltProps {
13
- roomCode: string;
12
+ export interface HMSPrebuiltCommonProps {
14
13
  options?: {
15
14
  userName?: string;
16
15
  userId?: string;
@@ -63,6 +62,19 @@ export interface HMSPrebuiltProps {
63
62
  autoEnterPipMode?: boolean;
64
63
  }
65
64
 
65
+ export type HMSPrebuiltConditionalProps =
66
+ | {
67
+ roomCode: string;
68
+ token?: never;
69
+ }
70
+ | {
71
+ roomCode?: never;
72
+ token: string;
73
+ };
74
+
75
+ export type HMSPrebuiltProps = HMSPrebuiltCommonProps &
76
+ HMSPrebuiltConditionalProps;
77
+
66
78
  export enum NotificationTypes {
67
79
  INFO = 'info',
68
80
  ROLE_CHANGE_DECLINED = 'role_change_declined',
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
1
+ import { useEffect, useMemo } from 'react';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
3
  import {
4
4
  HMSLocalAudioStats,
@@ -13,10 +13,12 @@ import {
13
13
  HMSTrackSource,
14
14
  HMSUpdateListenerActions,
15
15
  } from '@100mslive/react-native-hms';
16
+ import type { HMSPoll } from '@100mslive/react-native-hms';
16
17
 
17
- import type { RootState } from '../redux';
18
- import { setRTCStats } from '../redux/actions';
19
18
  import { ModalTypes } from './types';
19
+ import type { RootState } from '../redux';
20
+ import { addLeaderboard, setRTCStats } from '../redux/actions';
21
+ import { useHMSInstance } from '../hooks-util';
20
22
 
21
23
  export const useRTCStatsListeners = () => {
22
24
  const dispatch = useDispatch();
@@ -102,3 +104,188 @@ export const useRTCStatsListeners = () => {
102
104
  }
103
105
  }, [hmsInstance, addListeners]);
104
106
  };
107
+
108
+ export const useFetchLeaderboardResponse = (
109
+ pollId: HMSPoll['pollId'] | undefined
110
+ ) => {
111
+ const dispatch = useDispatch();
112
+ const hmsInstance = useHMSInstance();
113
+
114
+ const hasPollWritePermission = useSelector((state: RootState) => {
115
+ const permissions = state.hmsStates.localPeer?.role?.permissions;
116
+ return permissions?.pollWrite;
117
+ });
118
+
119
+ const leaderboardData = useSelector((state: RootState) => {
120
+ if (!pollId) return null;
121
+ return state.polls.leaderboards[pollId] || null;
122
+ });
123
+
124
+ const leaderboardDataExist = !!leaderboardData;
125
+
126
+ useEffect(() => {
127
+ if (!!leaderboardData) return;
128
+
129
+ let mounted = true;
130
+
131
+ async function fetchLeaderboard() {
132
+ if (pollId) {
133
+ const response = await hmsInstance.interactivityCenter.fetchLeaderboard(
134
+ pollId,
135
+ 5,
136
+ 1, // Indexing starts from 1
137
+ !hasPollWritePermission // fetchCurrentUser only if user has only pollRead permission
138
+ );
139
+ if (mounted) {
140
+ dispatch(addLeaderboard(pollId, response));
141
+ }
142
+ }
143
+ }
144
+ fetchLeaderboard();
145
+
146
+ return () => {
147
+ mounted = false;
148
+ };
149
+ }, [pollId, leaderboardDataExist, hasPollWritePermission]);
150
+
151
+ return leaderboardData;
152
+ };
153
+
154
+ export const useLeaderboardSummaryData = (
155
+ pollId: HMSPoll['pollId'] | undefined
156
+ ): { label: string; value: any }[][] | null => {
157
+ const localPeerUserId = useSelector(
158
+ (state: RootState) => state.hmsStates.localPeer?.customerUserID
159
+ );
160
+ const localPeerPollInitiator = useSelector((state: RootState) => {
161
+ if (!pollId) return null;
162
+ const pollInitiatorUserID =
163
+ state.polls.polls[pollId]?.createdBy?.customerUserID;
164
+ return (
165
+ localPeerUserId &&
166
+ pollInitiatorUserID &&
167
+ localPeerUserId === pollInitiatorUserID
168
+ );
169
+ });
170
+ const canCreateOrEndPoll = useSelector((state: RootState) => {
171
+ const permissions = state.hmsStates.localPeer?.role?.permissions;
172
+ return permissions?.pollWrite;
173
+ });
174
+
175
+ const leaderboardData = useSelector((state: RootState) => {
176
+ if (!pollId) return null;
177
+ return state.polls.leaderboards[pollId] || null;
178
+ });
179
+ const pollQuestionsLength = useSelector((state: RootState) => {
180
+ if (!pollId) return null;
181
+ return state.polls.polls[pollId]?.questions?.length;
182
+ });
183
+ const leaderboardSummary = leaderboardData?.summary;
184
+
185
+ const pollInitiatorSummaryData = useMemo(() => {
186
+ if (!localPeerPollInitiator) {
187
+ return null;
188
+ }
189
+ return [
190
+ [
191
+ {
192
+ label: 'ANSWERED',
193
+ value:
194
+ leaderboardSummary &&
195
+ typeof leaderboardSummary.respondedPeersCount === 'number' &&
196
+ typeof leaderboardSummary.totalPeersCount === 'number'
197
+ ? `${Math.round((leaderboardSummary.respondedPeersCount / leaderboardSummary.totalPeersCount) * 100)}% (${leaderboardSummary.respondedPeersCount}/${leaderboardSummary.totalPeersCount})`
198
+ : '-',
199
+ },
200
+ {
201
+ label: 'CORRECT ANSWERS',
202
+ value:
203
+ leaderboardSummary &&
204
+ typeof leaderboardSummary.respondedCorrectlyPeersCount ===
205
+ 'number' &&
206
+ typeof leaderboardSummary.totalPeersCount === 'number'
207
+ ? `${Math.round((leaderboardSummary.respondedCorrectlyPeersCount / leaderboardSummary?.totalPeersCount) * 100)}% (${leaderboardSummary.respondedCorrectlyPeersCount}/${leaderboardSummary.totalPeersCount})`
208
+ : '-',
209
+ },
210
+ ],
211
+ [
212
+ {
213
+ label: 'AVG. TIME TAKEN',
214
+ value:
215
+ leaderboardSummary &&
216
+ typeof leaderboardSummary.averageTime === 'number'
217
+ ? `${(leaderboardSummary.averageTime / 1000).toFixed(2)}s`
218
+ : '-', // averageTime is in milliseconds
219
+ },
220
+ {
221
+ label: 'AVG. SCORE',
222
+ value:
223
+ leaderboardSummary &&
224
+ typeof leaderboardSummary.averageScore === 'number'
225
+ ? leaderboardSummary.averageScore.toFixed(2)
226
+ : '-',
227
+ },
228
+ ],
229
+ ];
230
+ }, [leaderboardSummary, localPeerPollInitiator]);
231
+
232
+ const localLeaderboardEntry =
233
+ localPeerUserId && leaderboardData && Array.isArray(leaderboardData.entries)
234
+ ? leaderboardData.entries.find(
235
+ (entry) => entry.peer?.customerUserId === localPeerUserId
236
+ )
237
+ : null;
238
+
239
+ const voterSummaryData = useMemo(() => {
240
+ if (!localLeaderboardEntry || canCreateOrEndPoll) {
241
+ return null;
242
+ }
243
+ return [
244
+ [
245
+ {
246
+ label: 'YOUR RANK',
247
+ value:
248
+ localLeaderboardEntry &&
249
+ typeof localLeaderboardEntry.totalResponses === 'number' &&
250
+ leaderboardSummary &&
251
+ typeof leaderboardSummary.totalPeersCount === 'number'
252
+ ? `${localLeaderboardEntry.position}/${leaderboardSummary.totalPeersCount}`
253
+ : '-',
254
+ },
255
+ {
256
+ label: 'CORRECT ANSWERS',
257
+ value:
258
+ localLeaderboardEntry &&
259
+ typeof localLeaderboardEntry.correctResponses === 'number' &&
260
+ typeof pollQuestionsLength === 'number'
261
+ ? `${Math.round((localLeaderboardEntry.correctResponses / pollQuestionsLength) * 100)}% (${localLeaderboardEntry.correctResponses}/${pollQuestionsLength})`
262
+ : '-',
263
+ },
264
+ ],
265
+ [
266
+ {
267
+ label: 'TIME TAKEN',
268
+ value:
269
+ localLeaderboardEntry &&
270
+ typeof localLeaderboardEntry.duration === 'number'
271
+ ? `${(localLeaderboardEntry.duration / 1000).toFixed(2)}s`
272
+ : '-',
273
+ },
274
+ {
275
+ label: 'YOUR POINTS',
276
+ value:
277
+ localLeaderboardEntry &&
278
+ typeof localLeaderboardEntry.score === 'number'
279
+ ? localLeaderboardEntry.score
280
+ : '-',
281
+ },
282
+ ],
283
+ ];
284
+ }, [localLeaderboardEntry, leaderboardSummary?.totalPeersCount]);
285
+
286
+ return localPeerPollInitiator
287
+ ? pollInitiatorSummaryData
288
+ : voterSummaryData
289
+ ? voterSummaryData
290
+ : null;
291
+ };