@100mslive/react-native-room-kit 1.0.9 → 1.1.1

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 (410) hide show
  1. package/README.md +5 -6
  2. package/lib/commonjs/HMSRoomSetup.js +49 -0
  3. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  4. package/lib/commonjs/Icons/Add/assets/add-circle.png +0 -0
  5. package/lib/commonjs/Icons/Add/assets/add-circle@2x.png +0 -0
  6. package/lib/commonjs/Icons/Add/assets/add-circle@3x.png +0 -0
  7. package/lib/commonjs/Icons/Add/index.js +35 -0
  8. package/lib/commonjs/Icons/Add/index.js.map +1 -0
  9. package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked.png +0 -0
  10. package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
  11. package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
  12. package/lib/commonjs/Icons/CheckBox/assets/checkbox.png +0 -0
  13. package/lib/commonjs/Icons/CheckBox/assets/checkbox@2x.png +0 -0
  14. package/lib/commonjs/Icons/CheckBox/assets/checkbox@3x.png +0 -0
  15. package/lib/commonjs/Icons/CheckBox/index.js +34 -0
  16. package/lib/commonjs/Icons/CheckBox/index.js.map +1 -0
  17. package/lib/commonjs/Icons/Poll/assets/poll.png +0 -0
  18. package/lib/commonjs/Icons/Poll/assets/poll@2x.png +0 -0
  19. package/lib/commonjs/Icons/Poll/assets/poll@3x.png +0 -0
  20. package/lib/commonjs/Icons/Poll/index.js +33 -0
  21. package/lib/commonjs/Icons/Poll/index.js.map +1 -0
  22. package/lib/commonjs/Icons/PollVote/assets/poll-vote.png +0 -0
  23. package/lib/commonjs/Icons/PollVote/assets/poll-vote@2x.png +0 -0
  24. package/lib/commonjs/Icons/PollVote/assets/poll-vote@3x.png +0 -0
  25. package/lib/commonjs/Icons/PollVote/index.js +33 -0
  26. package/lib/commonjs/Icons/PollVote/index.js.map +1 -0
  27. package/lib/commonjs/Icons/Quiz/assets/quiz.png +0 -0
  28. package/lib/commonjs/Icons/Quiz/assets/quiz@2x.png +0 -0
  29. package/lib/commonjs/Icons/Quiz/assets/quiz@3x.png +0 -0
  30. package/lib/commonjs/Icons/Quiz/index.js +33 -0
  31. package/lib/commonjs/Icons/Quiz/index.js.map +1 -0
  32. package/lib/commonjs/Icons/TrashBin/assets/trash-bin.png +0 -0
  33. package/lib/commonjs/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
  34. package/lib/commonjs/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
  35. package/lib/commonjs/Icons/TrashBin/index.js +34 -0
  36. package/lib/commonjs/Icons/TrashBin/index.js.map +1 -0
  37. package/lib/commonjs/Icons/index.js +66 -0
  38. package/lib/commonjs/Icons/index.js.map +1 -1
  39. package/lib/commonjs/components/CheckboxInputRow.js +53 -0
  40. package/lib/commonjs/components/CheckboxInputRow.js.map +1 -0
  41. package/lib/commonjs/components/CreatePoll.js +163 -0
  42. package/lib/commonjs/components/CreatePoll.js.map +1 -0
  43. package/lib/commonjs/components/Footer.js +6 -1
  44. package/lib/commonjs/components/Footer.js.map +1 -1
  45. package/lib/commonjs/components/GridView.js +9 -4
  46. package/lib/commonjs/components/GridView.js.map +1 -1
  47. package/lib/commonjs/components/HLSPlayerEmoticons.js +2 -3
  48. package/lib/commonjs/components/HLSPlayerEmoticons.js.map +1 -1
  49. package/lib/commonjs/components/HMSBaseButton.js +4 -2
  50. package/lib/commonjs/components/HMSBaseButton.js.map +1 -1
  51. package/lib/commonjs/components/HMSNotification.js +5 -1
  52. package/lib/commonjs/components/HMSNotification.js.map +1 -1
  53. package/lib/commonjs/components/HMSNotifications.js +4 -0
  54. package/lib/commonjs/components/HMSNotifications.js.map +1 -1
  55. package/lib/commonjs/components/HMSPollsQuizzesNotification.js +95 -0
  56. package/lib/commonjs/components/HMSPollsQuizzesNotification.js.map +1 -0
  57. package/lib/commonjs/components/HMSRoomOptions.js +2 -1
  58. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
  59. package/lib/commonjs/components/HMSSecondaryButton.js +56 -0
  60. package/lib/commonjs/components/HMSSecondaryButton.js.map +1 -0
  61. package/lib/commonjs/components/Meeting.js +1 -0
  62. package/lib/commonjs/components/Meeting.js.map +1 -1
  63. package/lib/commonjs/components/OverlayContainer.js +6 -3
  64. package/lib/commonjs/components/OverlayContainer.js.map +1 -1
  65. package/lib/commonjs/components/OverlayedViews.js +5 -2
  66. package/lib/commonjs/components/OverlayedViews.js.map +1 -1
  67. package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js +18 -87
  68. package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js.map +1 -1
  69. package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +3 -1
  70. package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  71. package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js +185 -0
  72. package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js.map +1 -0
  73. package/lib/commonjs/components/PollAndQuizVoting.js +136 -0
  74. package/lib/commonjs/components/PollAndQuizVoting.js.map +1 -0
  75. package/lib/commonjs/components/PollAndQuizzStateLabel.js +72 -0
  76. package/lib/commonjs/components/PollAndQuizzStateLabel.js.map +1 -0
  77. package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js +68 -0
  78. package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js.map +1 -0
  79. package/lib/commonjs/components/PollQuestion.js +368 -0
  80. package/lib/commonjs/components/PollQuestion.js.map +1 -0
  81. package/lib/commonjs/components/PollQuestionDeleteConfirmation.js +97 -0
  82. package/lib/commonjs/components/PollQuestionDeleteConfirmation.js.map +1 -0
  83. package/lib/commonjs/components/PollQuestions.js +189 -0
  84. package/lib/commonjs/components/PollQuestions.js.map +1 -0
  85. package/lib/commonjs/components/PollResponseProgressView.js +68 -0
  86. package/lib/commonjs/components/PollResponseProgressView.js.map +1 -0
  87. package/lib/commonjs/components/PollsAndQuizBottomSheet.js +59 -0
  88. package/lib/commonjs/components/PollsAndQuizBottomSheet.js.map +1 -0
  89. package/lib/commonjs/components/PollsAndQuizzesCard.js +97 -0
  90. package/lib/commonjs/components/PollsAndQuizzesCard.js.map +1 -0
  91. package/lib/commonjs/components/PollsAndQuizzesModalContent.js +159 -0
  92. package/lib/commonjs/components/PollsAndQuizzesModalContent.js.map +1 -0
  93. package/lib/commonjs/components/PollsConfigAndList.js +32 -0
  94. package/lib/commonjs/components/PollsConfigAndList.js.map +1 -0
  95. package/lib/commonjs/components/PreviousPollsAndQuizzesList.js +76 -0
  96. package/lib/commonjs/components/PreviousPollsAndQuizzesList.js.map +1 -0
  97. package/lib/commonjs/components/RadioInput.js +42 -0
  98. package/lib/commonjs/components/RadioInput.js.map +1 -0
  99. package/lib/commonjs/components/RadioInputRow.js +57 -0
  100. package/lib/commonjs/components/RadioInputRow.js.map +1 -0
  101. package/lib/commonjs/components/RoomSettingsModalContent.js +31 -6
  102. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  103. package/lib/commonjs/components/SwitchRow.js +2 -1
  104. package/lib/commonjs/components/SwitchRow.js.map +1 -1
  105. package/lib/commonjs/components/TilesContainer.js +1 -1
  106. package/lib/commonjs/components/WebrtcView.js +14 -6
  107. package/lib/commonjs/components/WebrtcView.js.map +1 -1
  108. package/lib/commonjs/hooks-util.js +36 -1
  109. package/lib/commonjs/hooks-util.js.map +1 -1
  110. package/lib/commonjs/redux/actionTypes.js +38 -1
  111. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  112. package/lib/commonjs/redux/actions/index.js +140 -1
  113. package/lib/commonjs/redux/actions/index.js.map +1 -1
  114. package/lib/commonjs/redux/reducers/index.js +3 -1
  115. package/lib/commonjs/redux/reducers/index.js.map +1 -1
  116. package/lib/commonjs/redux/reducers/polls.js +251 -0
  117. package/lib/commonjs/redux/reducers/polls.js.map +1 -0
  118. package/lib/commonjs/types.js +1 -0
  119. package/lib/commonjs/types.js.map +1 -1
  120. package/lib/commonjs/utils/functions.js +6 -1
  121. package/lib/commonjs/utils/functions.js.map +1 -1
  122. package/lib/commonjs/utils/types.js +1 -0
  123. package/lib/commonjs/utils/types.js.map +1 -1
  124. package/lib/module/HMSRoomSetup.js +52 -3
  125. package/lib/module/HMSRoomSetup.js.map +1 -1
  126. package/lib/module/Icons/Add/assets/add-circle.png +0 -0
  127. package/lib/module/Icons/Add/assets/add-circle@2x.png +0 -0
  128. package/lib/module/Icons/Add/assets/add-circle@3x.png +0 -0
  129. package/lib/module/Icons/Add/index.js +27 -0
  130. package/lib/module/Icons/Add/index.js.map +1 -0
  131. package/lib/module/Icons/CheckBox/assets/checkbox-checked.png +0 -0
  132. package/lib/module/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
  133. package/lib/module/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
  134. package/lib/module/Icons/CheckBox/assets/checkbox.png +0 -0
  135. package/lib/module/Icons/CheckBox/assets/checkbox@2x.png +0 -0
  136. package/lib/module/Icons/CheckBox/assets/checkbox@3x.png +0 -0
  137. package/lib/module/Icons/CheckBox/index.js +26 -0
  138. package/lib/module/Icons/CheckBox/index.js.map +1 -0
  139. package/lib/module/Icons/Poll/assets/poll.png +0 -0
  140. package/lib/module/Icons/Poll/assets/poll@2x.png +0 -0
  141. package/lib/module/Icons/Poll/assets/poll@3x.png +0 -0
  142. package/lib/module/Icons/Poll/index.js +25 -0
  143. package/lib/module/Icons/Poll/index.js.map +1 -0
  144. package/lib/module/Icons/PollVote/assets/poll-vote.png +0 -0
  145. package/lib/module/Icons/PollVote/assets/poll-vote@2x.png +0 -0
  146. package/lib/module/Icons/PollVote/assets/poll-vote@3x.png +0 -0
  147. package/lib/module/Icons/PollVote/index.js +25 -0
  148. package/lib/module/Icons/PollVote/index.js.map +1 -0
  149. package/lib/module/Icons/Quiz/assets/quiz.png +0 -0
  150. package/lib/module/Icons/Quiz/assets/quiz@2x.png +0 -0
  151. package/lib/module/Icons/Quiz/assets/quiz@3x.png +0 -0
  152. package/lib/module/Icons/Quiz/index.js +25 -0
  153. package/lib/module/Icons/Quiz/index.js.map +1 -0
  154. package/lib/module/Icons/TrashBin/assets/trash-bin.png +0 -0
  155. package/lib/module/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
  156. package/lib/module/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
  157. package/lib/module/Icons/TrashBin/index.js +26 -0
  158. package/lib/module/Icons/TrashBin/index.js.map +1 -0
  159. package/lib/module/Icons/index.js +6 -0
  160. package/lib/module/Icons/index.js.map +1 -1
  161. package/lib/module/components/CheckboxInputRow.js +45 -0
  162. package/lib/module/components/CheckboxInputRow.js.map +1 -0
  163. package/lib/module/components/CreatePoll.js +155 -0
  164. package/lib/module/components/CreatePoll.js.map +1 -0
  165. package/lib/module/components/Footer.js +6 -1
  166. package/lib/module/components/Footer.js.map +1 -1
  167. package/lib/module/components/GridView.js +10 -5
  168. package/lib/module/components/GridView.js.map +1 -1
  169. package/lib/module/components/HLSPlayerEmoticons.js +2 -3
  170. package/lib/module/components/HLSPlayerEmoticons.js.map +1 -1
  171. package/lib/module/components/HMSBaseButton.js +5 -3
  172. package/lib/module/components/HMSBaseButton.js.map +1 -1
  173. package/lib/module/components/HMSNotification.js +5 -1
  174. package/lib/module/components/HMSNotification.js.map +1 -1
  175. package/lib/module/components/HMSNotifications.js +4 -0
  176. package/lib/module/components/HMSNotifications.js.map +1 -1
  177. package/lib/module/components/HMSPollsQuizzesNotification.js +86 -0
  178. package/lib/module/components/HMSPollsQuizzesNotification.js.map +1 -0
  179. package/lib/module/components/HMSRoomOptions.js +2 -1
  180. package/lib/module/components/HMSRoomOptions.js.map +1 -1
  181. package/lib/module/components/HMSSecondaryButton.js +47 -0
  182. package/lib/module/components/HMSSecondaryButton.js.map +1 -0
  183. package/lib/module/components/Meeting.js +2 -1
  184. package/lib/module/components/Meeting.js.map +1 -1
  185. package/lib/module/components/OverlayContainer.js +5 -3
  186. package/lib/module/components/OverlayContainer.js.map +1 -1
  187. package/lib/module/components/OverlayedViews.js +5 -2
  188. package/lib/module/components/OverlayedViews.js.map +1 -1
  189. package/lib/module/components/PeerVideoTile/HMSPinchGesture.js +18 -87
  190. package/lib/module/components/PeerVideoTile/HMSPinchGesture.js.map +1 -1
  191. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +3 -1
  192. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  193. package/lib/module/components/PollAndQuizQuestionResponseCard.js +176 -0
  194. package/lib/module/components/PollAndQuizQuestionResponseCard.js.map +1 -0
  195. package/lib/module/components/PollAndQuizVoting.js +127 -0
  196. package/lib/module/components/PollAndQuizVoting.js.map +1 -0
  197. package/lib/module/components/PollAndQuizzStateLabel.js +63 -0
  198. package/lib/module/components/PollAndQuizzStateLabel.js.map +1 -0
  199. package/lib/module/components/PollQDeleteConfirmationSheetView.js +60 -0
  200. package/lib/module/components/PollQDeleteConfirmationSheetView.js.map +1 -0
  201. package/lib/module/components/PollQuestion.js +359 -0
  202. package/lib/module/components/PollQuestion.js.map +1 -0
  203. package/lib/module/components/PollQuestionDeleteConfirmation.js +88 -0
  204. package/lib/module/components/PollQuestionDeleteConfirmation.js.map +1 -0
  205. package/lib/module/components/PollQuestions.js +180 -0
  206. package/lib/module/components/PollQuestions.js.map +1 -0
  207. package/lib/module/components/PollResponseProgressView.js +59 -0
  208. package/lib/module/components/PollResponseProgressView.js.map +1 -0
  209. package/lib/module/components/PollsAndQuizBottomSheet.js +50 -0
  210. package/lib/module/components/PollsAndQuizBottomSheet.js.map +1 -0
  211. package/lib/module/components/PollsAndQuizzesCard.js +88 -0
  212. package/lib/module/components/PollsAndQuizzesCard.js.map +1 -0
  213. package/lib/module/components/PollsAndQuizzesModalContent.js +150 -0
  214. package/lib/module/components/PollsAndQuizzesModalContent.js.map +1 -0
  215. package/lib/module/components/PollsConfigAndList.js +23 -0
  216. package/lib/module/components/PollsConfigAndList.js.map +1 -0
  217. package/lib/module/components/PreviousPollsAndQuizzesList.js +67 -0
  218. package/lib/module/components/PreviousPollsAndQuizzesList.js.map +1 -0
  219. package/lib/module/components/RadioInput.js +34 -0
  220. package/lib/module/components/RadioInput.js.map +1 -0
  221. package/lib/module/components/RadioInputRow.js +49 -0
  222. package/lib/module/components/RadioInputRow.js.map +1 -0
  223. package/lib/module/components/RoomSettingsModalContent.js +32 -7
  224. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  225. package/lib/module/components/SwitchRow.js +2 -1
  226. package/lib/module/components/SwitchRow.js.map +1 -1
  227. package/lib/module/components/TilesContainer.js +1 -1
  228. package/lib/module/components/WebrtcView.js +15 -7
  229. package/lib/module/components/WebrtcView.js.map +1 -1
  230. package/lib/module/hooks-util.js +35 -2
  231. package/lib/module/hooks-util.js.map +1 -1
  232. package/lib/module/redux/actionTypes.js +39 -0
  233. package/lib/module/redux/actionTypes.js.map +1 -1
  234. package/lib/module/redux/actions/index.js +116 -1
  235. package/lib/module/redux/actions/index.js.map +1 -1
  236. package/lib/module/redux/reducers/index.js +3 -1
  237. package/lib/module/redux/reducers/index.js.map +1 -1
  238. package/lib/module/redux/reducers/polls.js +245 -0
  239. package/lib/module/redux/reducers/polls.js.map +1 -0
  240. package/lib/module/types.js +1 -0
  241. package/lib/module/types.js.map +1 -1
  242. package/lib/module/utils/functions.js +5 -1
  243. package/lib/module/utils/functions.js.map +1 -1
  244. package/lib/module/utils/types.js +1 -0
  245. package/lib/module/utils/types.js.map +1 -1
  246. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  247. package/lib/typescript/Icons/Add/index.d.ts +8 -0
  248. package/lib/typescript/Icons/Add/index.d.ts.map +1 -0
  249. package/lib/typescript/Icons/CheckBox/index.d.ts +8 -0
  250. package/lib/typescript/Icons/CheckBox/index.d.ts.map +1 -0
  251. package/lib/typescript/Icons/Poll/index.d.ts +7 -0
  252. package/lib/typescript/Icons/Poll/index.d.ts.map +1 -0
  253. package/lib/typescript/Icons/PollVote/index.d.ts +7 -0
  254. package/lib/typescript/Icons/PollVote/index.d.ts.map +1 -0
  255. package/lib/typescript/Icons/Quiz/index.d.ts +7 -0
  256. package/lib/typescript/Icons/Quiz/index.d.ts.map +1 -0
  257. package/lib/typescript/Icons/TrashBin/index.d.ts +7 -0
  258. package/lib/typescript/Icons/TrashBin/index.d.ts.map +1 -0
  259. package/lib/typescript/Icons/index.d.ts +6 -0
  260. package/lib/typescript/Icons/index.d.ts.map +1 -1
  261. package/lib/typescript/components/CheckboxInputRow.d.ts +13 -0
  262. package/lib/typescript/components/CheckboxInputRow.d.ts.map +1 -0
  263. package/lib/typescript/components/CreatePoll.d.ts +5 -0
  264. package/lib/typescript/components/CreatePoll.d.ts.map +1 -0
  265. package/lib/typescript/components/Footer.d.ts.map +1 -1
  266. package/lib/typescript/components/GridView.d.ts.map +1 -1
  267. package/lib/typescript/components/HLSPlayerEmoticons.d.ts.map +1 -1
  268. package/lib/typescript/components/HMSBaseButton.d.ts +2 -1
  269. package/lib/typescript/components/HMSBaseButton.d.ts.map +1 -1
  270. package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
  271. package/lib/typescript/components/HMSPollsQuizzesNotification.d.ts +7 -0
  272. package/lib/typescript/components/HMSPollsQuizzesNotification.d.ts.map +1 -0
  273. package/lib/typescript/components/HMSPrimaryButton.d.ts +1 -1
  274. package/lib/typescript/components/HMSPrimaryButton.d.ts.map +1 -1
  275. package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
  276. package/lib/typescript/components/HMSSecondaryButton.d.ts +15 -0
  277. package/lib/typescript/components/HMSSecondaryButton.d.ts.map +1 -0
  278. package/lib/typescript/components/Meeting.d.ts.map +1 -1
  279. package/lib/typescript/components/OverlayContainer.d.ts +5 -1
  280. package/lib/typescript/components/OverlayContainer.d.ts.map +1 -1
  281. package/lib/typescript/components/OverlayedViews.d.ts +2 -1
  282. package/lib/typescript/components/OverlayedViews.d.ts.map +1 -1
  283. package/lib/typescript/components/PeerVideoTile/HMSPinchGesture.d.ts.map +1 -1
  284. package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
  285. package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts +13 -0
  286. package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts.map +1 -0
  287. package/lib/typescript/components/PollAndQuizVoting.d.ts +6 -0
  288. package/lib/typescript/components/PollAndQuizVoting.d.ts.map +1 -0
  289. package/lib/typescript/components/PollAndQuizzStateLabel.d.ts +7 -0
  290. package/lib/typescript/components/PollAndQuizzStateLabel.d.ts.map +1 -0
  291. package/lib/typescript/components/PollQDeleteConfirmationSheetView.d.ts +6 -0
  292. package/lib/typescript/components/PollQDeleteConfirmationSheetView.d.ts.map +1 -0
  293. package/lib/typescript/components/PollQuestion.d.ts +14 -0
  294. package/lib/typescript/components/PollQuestion.d.ts.map +1 -0
  295. package/lib/typescript/components/PollQuestionDeleteConfirmation.d.ts +6 -0
  296. package/lib/typescript/components/PollQuestionDeleteConfirmation.d.ts.map +1 -0
  297. package/lib/typescript/components/PollQuestions.d.ts +6 -0
  298. package/lib/typescript/components/PollQuestions.d.ts.map +1 -0
  299. package/lib/typescript/components/PollResponseProgressView.d.ts +9 -0
  300. package/lib/typescript/components/PollResponseProgressView.d.ts.map +1 -0
  301. package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts +3 -0
  302. package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts.map +1 -0
  303. package/lib/typescript/components/PollsAndQuizzesCard.d.ts +7 -0
  304. package/lib/typescript/components/PollsAndQuizzesCard.d.ts.map +1 -0
  305. package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts +7 -0
  306. package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts.map +1 -0
  307. package/lib/typescript/components/PollsConfigAndList.d.ts +5 -0
  308. package/lib/typescript/components/PollsConfigAndList.d.ts.map +1 -0
  309. package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts +5 -0
  310. package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts.map +1 -0
  311. package/lib/typescript/components/RadioInput.d.ts +9 -0
  312. package/lib/typescript/components/RadioInput.d.ts.map +1 -0
  313. package/lib/typescript/components/RadioInputRow.d.ts +16 -0
  314. package/lib/typescript/components/RadioInputRow.d.ts.map +1 -0
  315. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  316. package/lib/typescript/components/SwitchRow.d.ts +2 -1
  317. package/lib/typescript/components/SwitchRow.d.ts.map +1 -1
  318. package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
  319. package/lib/typescript/hooks-util.d.ts +2 -0
  320. package/lib/typescript/hooks-util.d.ts.map +1 -1
  321. package/lib/typescript/redux/actionTypes.d.ts +161 -0
  322. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  323. package/lib/typescript/redux/actions/index.d.ts +36 -2
  324. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  325. package/lib/typescript/redux/index.d.ts +13 -0
  326. package/lib/typescript/redux/index.d.ts.map +1 -1
  327. package/lib/typescript/redux/reducers/index.d.ts +13 -0
  328. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  329. package/lib/typescript/redux/reducers/polls.d.ts +19 -0
  330. package/lib/typescript/redux/reducers/polls.d.ts.map +1 -0
  331. package/lib/typescript/types.d.ts +3 -1
  332. package/lib/typescript/types.d.ts.map +1 -1
  333. package/lib/typescript/utils/functions.d.ts +2 -0
  334. package/lib/typescript/utils/functions.d.ts.map +1 -1
  335. package/lib/typescript/utils/types.d.ts +1 -0
  336. package/lib/typescript/utils/types.d.ts.map +1 -1
  337. package/package.json +2 -2
  338. package/src/HMSRoomSetup.tsx +61 -0
  339. package/src/Icons/Add/assets/add-circle.png +0 -0
  340. package/src/Icons/Add/assets/add-circle@2x.png +0 -0
  341. package/src/Icons/Add/assets/add-circle@3x.png +0 -0
  342. package/src/Icons/Add/index.tsx +37 -0
  343. package/src/Icons/CheckBox/assets/checkbox-checked.png +0 -0
  344. package/src/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
  345. package/src/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
  346. package/src/Icons/CheckBox/assets/checkbox.png +0 -0
  347. package/src/Icons/CheckBox/assets/checkbox@2x.png +0 -0
  348. package/src/Icons/CheckBox/assets/checkbox@3x.png +0 -0
  349. package/src/Icons/CheckBox/index.tsx +40 -0
  350. package/src/Icons/Poll/assets/poll.png +0 -0
  351. package/src/Icons/Poll/assets/poll@2x.png +0 -0
  352. package/src/Icons/Poll/assets/poll@3x.png +0 -0
  353. package/src/Icons/Poll/index.tsx +30 -0
  354. package/src/Icons/PollVote/assets/poll-vote.png +0 -0
  355. package/src/Icons/PollVote/assets/poll-vote@2x.png +0 -0
  356. package/src/Icons/PollVote/assets/poll-vote@3x.png +0 -0
  357. package/src/Icons/PollVote/index.tsx +33 -0
  358. package/src/Icons/Quiz/assets/quiz.png +0 -0
  359. package/src/Icons/Quiz/assets/quiz@2x.png +0 -0
  360. package/src/Icons/Quiz/assets/quiz@3x.png +0 -0
  361. package/src/Icons/Quiz/index.tsx +30 -0
  362. package/src/Icons/TrashBin/assets/trash-bin.png +0 -0
  363. package/src/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
  364. package/src/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
  365. package/src/Icons/TrashBin/index.tsx +34 -0
  366. package/src/Icons/index.ts +6 -0
  367. package/src/components/CheckboxInputRow.tsx +68 -0
  368. package/src/components/CreatePoll.tsx +176 -0
  369. package/src/components/Footer.tsx +7 -1
  370. package/src/components/GridView.tsx +14 -5
  371. package/src/components/HLSPlayerEmoticons.tsx +2 -3
  372. package/src/components/HMSBaseButton.tsx +8 -3
  373. package/src/components/HMSNotification.tsx +1 -1
  374. package/src/components/HMSNotifications.tsx +7 -0
  375. package/src/components/HMSPollsQuizzesNotification.tsx +110 -0
  376. package/src/components/HMSPrimaryButton.tsx +1 -1
  377. package/src/components/HMSRoomOptions.tsx +3 -0
  378. package/src/components/HMSSecondaryButton.tsx +72 -0
  379. package/src/components/Meeting.tsx +3 -0
  380. package/src/components/OverlayContainer.tsx +12 -3
  381. package/src/components/OverlayedViews.tsx +7 -3
  382. package/src/components/PeerVideoTile/HMSPinchGesture.tsx +28 -71
  383. package/src/components/PeerVideoTile/PeerVideoTileView.tsx +4 -1
  384. package/src/components/PollAndQuizQuestionResponseCard.tsx +311 -0
  385. package/src/components/PollAndQuizVoting.tsx +157 -0
  386. package/src/components/PollAndQuizzStateLabel.tsx +83 -0
  387. package/src/components/PollQDeleteConfirmationSheetView.tsx +82 -0
  388. package/src/components/PollQuestion.tsx +553 -0
  389. package/src/components/PollQuestionDeleteConfirmation.tsx +110 -0
  390. package/src/components/PollQuestions.tsx +259 -0
  391. package/src/components/PollResponseProgressView.tsx +77 -0
  392. package/src/components/PollsAndQuizBottomSheet.tsx +83 -0
  393. package/src/components/PollsAndQuizzesCard.tsx +111 -0
  394. package/src/components/PollsAndQuizzesModalContent.tsx +198 -0
  395. package/src/components/PollsConfigAndList.tsx +29 -0
  396. package/src/components/PreviousPollsAndQuizzesList.tsx +103 -0
  397. package/src/components/RadioInput.tsx +44 -0
  398. package/src/components/RadioInputRow.tsx +73 -0
  399. package/src/components/RoomSettingsModalContent.tsx +23 -0
  400. package/src/components/SwitchRow.tsx +4 -2
  401. package/src/components/TilesContainer.tsx +1 -1
  402. package/src/components/WebrtcView.tsx +27 -9
  403. package/src/hooks-util.ts +54 -0
  404. package/src/redux/actionTypes.ts +221 -0
  405. package/src/redux/actions/index.ts +218 -1
  406. package/src/redux/reducers/index.ts +2 -0
  407. package/src/redux/reducers/polls.ts +328 -0
  408. package/src/types.ts +2 -0
  409. package/src/utils/functions.ts +14 -0
  410. package/src/utils/types.ts +1 -0
@@ -0,0 +1,553 @@
1
+ import * as React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
3
+ import { HMSPollQuestionType } from '@100mslive/react-native-hms';
4
+ import { useSelector } from 'react-redux';
5
+
6
+ import { useHMSRoomStyleSheet } from '../hooks-util';
7
+ import { BottomSheet } from './BottomSheet';
8
+ import { AddIcon, ChevronIcon, TrashBinIcon } from '../Icons';
9
+ import { HMSTextInput } from './HMSTextInput';
10
+ import { HMSBaseButton } from './HMSBaseButton';
11
+ import { PressableIcon } from './PressableIcon';
12
+ import type { PollQuestionUI } from '../redux/actionTypes';
13
+ import type { RootState } from '../redux';
14
+
15
+ export interface PollQuestionProps {
16
+ totalQuestions: number;
17
+ currentQuestionIndex: number;
18
+ pollQuestion: PollQuestionUI;
19
+ onAddPollQuestionOption(questionIndex: number): void;
20
+ onDeletePollQuestionOption(questionIndex: number, optionIndex: number): void;
21
+ onEditPollQuestionOption(
22
+ questionIndex: number,
23
+ optionIndex: number,
24
+ option: string
25
+ ): void;
26
+ onQuestionFieldChange: <K extends keyof Omit<PollQuestionUI, 'options'>>(
27
+ questionIndex: number,
28
+ questionField: K,
29
+ value: Omit<PollQuestionUI, 'options'>[K]
30
+ ) => void;
31
+ onDelete(index: number): void;
32
+ }
33
+
34
+ const questionTypes = [
35
+ {
36
+ label: getLabelFromPollQuestionType(HMSPollQuestionType.singleChoice),
37
+ value: HMSPollQuestionType.singleChoice,
38
+ id: 'single-choice',
39
+ },
40
+ {
41
+ label: getLabelFromPollQuestionType(HMSPollQuestionType.multipleChoice),
42
+ value: HMSPollQuestionType.multipleChoice,
43
+ id: 'multiple-choice',
44
+ },
45
+ // {
46
+ // label: getLabelFromPollQuestionType(HMSPollQuestionType.shortAnswer),
47
+ // value: HMSPollQuestionType.shortAnswer,
48
+ // id: 'short-answer',
49
+ // },
50
+ // {
51
+ // label: getLabelFromPollQuestionType(HMSPollQuestionType.longAnswer),
52
+ // value: HMSPollQuestionType.longAnswer,
53
+ // id: 'long-answer',
54
+ // },
55
+ ];
56
+
57
+ export const PollQuestion: React.FC<PollQuestionProps> = ({
58
+ totalQuestions,
59
+ currentQuestionIndex,
60
+ pollQuestion,
61
+ onAddPollQuestionOption,
62
+ onDeletePollQuestionOption,
63
+ onEditPollQuestionOption,
64
+ onQuestionFieldChange,
65
+ onDelete,
66
+ }) => {
67
+ const [questionTypesVisible, setQuestionTypesVisible] = React.useState(false);
68
+ const launchingPoll = useSelector(
69
+ (state: RootState) => state.polls.launchingPoll
70
+ );
71
+
72
+ const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
73
+ container: {
74
+ backgroundColor: theme.palette.surface_default,
75
+ },
76
+ regularMediumText: {
77
+ color: theme.palette.on_surface_medium,
78
+ fontFamily: `${typography.font_family}-Regular`,
79
+ },
80
+ regularHighText: {
81
+ color: theme.palette.on_surface_high,
82
+ fontFamily: `${typography.font_family}-Regular`,
83
+ },
84
+ semiBoldLowText: {
85
+ color: theme.palette.on_surface_low,
86
+ fontFamily: `${typography.font_family}-SemiBold`,
87
+ },
88
+ questionType: {
89
+ backgroundColor: theme.palette.surface_bright,
90
+ },
91
+ floatingQuestionContainer: {
92
+ borderColor: theme.palette.border_default,
93
+ backgroundColor: theme.palette.surface_bright,
94
+ },
95
+ saveButton: {
96
+ backgroundColor: theme.palette.secondary_default,
97
+ },
98
+ saveButtonDisabled: {
99
+ backgroundColor: theme.palette.secondary_dim,
100
+ },
101
+ saveText: {
102
+ color: theme.palette.on_secondary_high,
103
+ fontFamily: `${typography.font_family}-SemiBold`,
104
+ },
105
+ saveTextDisabled: {
106
+ color: theme.palette.on_secondary_low,
107
+ fontFamily: `${typography.font_family}-SemiBold`,
108
+ },
109
+ divider: {
110
+ backgroundColor: theme.palette.border_bright,
111
+ },
112
+ dividerV2: {
113
+ backgroundColor: theme.palette.border_default,
114
+ },
115
+ optionText: {
116
+ backgroundColor: theme.palette.surface_bright,
117
+ borderColor: theme.palette.surface_bright,
118
+ },
119
+ optionDeleteIcon: {
120
+ tintColor: theme.palette.on_surface_low,
121
+ },
122
+ }));
123
+
124
+ const saveButtonDisabled =
125
+ !pollQuestion.title ||
126
+ ((pollQuestion.type === HMSPollQuestionType.singleChoice ||
127
+ pollQuestion.type === HMSPollQuestionType.multipleChoice) &&
128
+ pollQuestion.options &&
129
+ (pollQuestion.options.length <= 1 ||
130
+ pollQuestion.options.some((option) => !option)));
131
+
132
+ if (pollQuestion.saved) {
133
+ return (
134
+ <View style={[styles.container, hmsRoomStyles.container]}>
135
+ <Text
136
+ style={[
137
+ styles.tinyText,
138
+ styles.questionLabel,
139
+ hmsRoomStyles.semiBoldLowText,
140
+ ]}
141
+ >
142
+ Question {currentQuestionIndex + 1} of {totalQuestions}:{' '}
143
+ {getLabelFromPollQuestionType(pollQuestion.type).toUpperCase()}
144
+ </Text>
145
+
146
+ {pollQuestion.type === HMSPollQuestionType.singleChoice ||
147
+ pollQuestion.type === HMSPollQuestionType.multipleChoice ? (
148
+ <TouchableOpacity
149
+ activeOpacity={0.8}
150
+ onPress={() => setQuestionTypesVisible((prev) => !prev)}
151
+ style={[
152
+ {
153
+ flexDirection: 'row',
154
+ alignItems: 'center',
155
+ justifyContent: 'space-between',
156
+ },
157
+ { marginBottom: 16 },
158
+ ]}
159
+ >
160
+ <Text style={[styles.normalText, hmsRoomStyles.regularHighText]}>
161
+ {pollQuestion.title}
162
+ </Text>
163
+ <ChevronIcon direction={questionTypesVisible ? 'top' : 'down'} />
164
+ </TouchableOpacity>
165
+ ) : (
166
+ <Text
167
+ style={[
168
+ styles.normalText,
169
+ hmsRoomStyles.regularHighText,
170
+ { marginBottom: 16 },
171
+ ]}
172
+ >
173
+ {pollQuestion.title}
174
+ </Text>
175
+ )}
176
+
177
+ {questionTypesVisible && pollQuestion.options ? (
178
+ <View style={{ marginBottom: 8 }}>
179
+ {pollQuestion.options.map((option, idx) => (
180
+ <Text
181
+ key={idx}
182
+ style={[
183
+ styles.smallText,
184
+ { marginBottom: 8 },
185
+ hmsRoomStyles.regularMediumText,
186
+ ]}
187
+ >
188
+ {option}
189
+ </Text>
190
+ ))}
191
+ </View>
192
+ ) : null}
193
+
194
+ <View style={styles.saveContainer}>
195
+ <PressableIcon
196
+ disabled={launchingPoll}
197
+ style={[styles.deleteIcon, launchingPoll ? { opacity: 0.4 } : null]}
198
+ onPress={() => onDelete(currentQuestionIndex)}
199
+ >
200
+ <TrashBinIcon />
201
+ </PressableIcon>
202
+
203
+ <HMSBaseButton
204
+ loading={false}
205
+ disabled={saveButtonDisabled || launchingPoll}
206
+ onPress={() => {
207
+ setQuestionTypesVisible(false);
208
+ onQuestionFieldChange(
209
+ currentQuestionIndex,
210
+ 'saved',
211
+ !pollQuestion.saved
212
+ );
213
+ }}
214
+ title={pollQuestion.saved ? 'Edit' : 'Save'}
215
+ underlayColor={hmsRoomStyles.saveButtonDisabled.backgroundColor}
216
+ style={
217
+ saveButtonDisabled || launchingPoll
218
+ ? hmsRoomStyles.saveButtonDisabled
219
+ : hmsRoomStyles.saveButton
220
+ }
221
+ textStyle={[
222
+ styles.normalText,
223
+ saveButtonDisabled || launchingPoll
224
+ ? hmsRoomStyles.saveTextDisabled
225
+ : hmsRoomStyles.saveText,
226
+ ]}
227
+ />
228
+ </View>
229
+ </View>
230
+ );
231
+ }
232
+
233
+ return (
234
+ <View style={[styles.container, hmsRoomStyles.container]}>
235
+ <Text
236
+ style={[
237
+ styles.tinyText,
238
+ styles.questionLabel,
239
+ hmsRoomStyles.semiBoldLowText,
240
+ ]}
241
+ >
242
+ Question {currentQuestionIndex + 1} of {totalQuestions}
243
+ </Text>
244
+
245
+ <Text
246
+ style={[
247
+ styles.smallText,
248
+ styles.bottomSpace,
249
+ hmsRoomStyles.regularHighText,
250
+ ]}
251
+ >
252
+ Question Type
253
+ </Text>
254
+
255
+ <View style={styles.questionTypeWrapper}>
256
+ <TouchableOpacity
257
+ activeOpacity={0.8}
258
+ onPress={() => setQuestionTypesVisible((prev) => !prev)}
259
+ style={[styles.questionType, hmsRoomStyles.questionType]}
260
+ >
261
+ <Text style={[styles.normalText, hmsRoomStyles.regularHighText]}>
262
+ {getLabelFromPollQuestionType(pollQuestion.type)}
263
+ </Text>
264
+ <ChevronIcon direction={questionTypesVisible ? 'top' : 'down'} />
265
+ </TouchableOpacity>
266
+
267
+ {questionTypesVisible ? (
268
+ <View
269
+ collapsable={false}
270
+ style={[
271
+ styles.questionTypeOptions,
272
+ { height: 48 * questionTypes.length + 16 },
273
+ hmsRoomStyles.floatingQuestionContainer,
274
+ ]}
275
+ >
276
+ {questionTypes.map((item, idx) => {
277
+ const isFirst = idx === 0;
278
+ return (
279
+ <React.Fragment key={item.id}>
280
+ {isFirst ? null : (
281
+ <View
282
+ style={[
283
+ styles.questionTypeDivider,
284
+ hmsRoomStyles.dividerV2,
285
+ ]}
286
+ />
287
+ )}
288
+
289
+ <TouchableOpacity
290
+ key={item.id}
291
+ onPress={() => {
292
+ setQuestionTypesVisible((prev) => !prev);
293
+ onQuestionFieldChange(
294
+ currentQuestionIndex,
295
+ 'type',
296
+ item.value
297
+ );
298
+ }}
299
+ style={[
300
+ styles.questionTypeOption,
301
+ hmsRoomStyles.questionType,
302
+ ]}
303
+ >
304
+ <Text
305
+ style={[styles.normalText, hmsRoomStyles.regularHighText]}
306
+ >
307
+ {item.label}
308
+ </Text>
309
+ </TouchableOpacity>
310
+ </React.Fragment>
311
+ );
312
+ })}
313
+ </View>
314
+ ) : null}
315
+ </View>
316
+
317
+ <Text
318
+ style={[
319
+ styles.smallText,
320
+ styles.bottomSpace,
321
+ hmsRoomStyles.regularHighText,
322
+ ]}
323
+ >
324
+ Question
325
+ </Text>
326
+
327
+ <HMSTextInput
328
+ placeholder="e.g. Who will win the match?"
329
+ style={hmsRoomStyles.optionText}
330
+ value={pollQuestion.title}
331
+ autoFocus={false}
332
+ autoCapitalize="none"
333
+ autoCompleteType="off"
334
+ onChangeText={(value) =>
335
+ onQuestionFieldChange(currentQuestionIndex, 'title', value)
336
+ }
337
+ />
338
+
339
+ {pollQuestion.options ? (
340
+ <>
341
+ <BottomSheet.Divider style={hmsRoomStyles.divider} />
342
+
343
+ <Text
344
+ style={[
345
+ styles.smallText,
346
+ styles.bottomSpace,
347
+ hmsRoomStyles.regularHighText,
348
+ ]}
349
+ >
350
+ Options
351
+ </Text>
352
+
353
+ <View style={styles.optionsWrapper}>
354
+ {pollQuestion.options.map((option, idx) => {
355
+ const isFirst = idx === 0;
356
+ return (
357
+ <View
358
+ key={idx}
359
+ style={[
360
+ styles.optionContainer,
361
+ isFirst ? null : styles.topSpace,
362
+ ]}
363
+ >
364
+ <HMSTextInput
365
+ placeholder={`Option ${idx + 1}`}
366
+ style={hmsRoomStyles.optionText}
367
+ value={option}
368
+ autoCapitalize="none"
369
+ autoCompleteType="off"
370
+ autoFocus={false}
371
+ onChangeText={(value) =>
372
+ onEditPollQuestionOption(currentQuestionIndex, idx, value)
373
+ }
374
+ />
375
+
376
+ <PressableIcon
377
+ style={styles.optionDelete}
378
+ border={false}
379
+ onPress={() =>
380
+ onDeletePollQuestionOption(currentQuestionIndex, idx)
381
+ }
382
+ >
383
+ <TrashBinIcon style={hmsRoomStyles.optionDeleteIcon} />
384
+ </PressableIcon>
385
+ </View>
386
+ );
387
+ })}
388
+ </View>
389
+
390
+ <View style={styles.addOptionWrapper}>
391
+ <TouchableOpacity
392
+ style={styles.addOptionContainer}
393
+ onPress={() => onAddPollQuestionOption(currentQuestionIndex)}
394
+ >
395
+ <View style={styles.addOptionIconWrapper}>
396
+ <AddIcon type="circle" />
397
+ </View>
398
+ <Text style={[styles.smallText, hmsRoomStyles.regularMediumText]}>
399
+ Add an option
400
+ </Text>
401
+ </TouchableOpacity>
402
+ </View>
403
+ </>
404
+ ) : null}
405
+
406
+ <BottomSheet.Divider style={hmsRoomStyles.divider} />
407
+
408
+ <View style={styles.saveContainer}>
409
+ <PressableIcon
410
+ style={styles.deleteIcon}
411
+ onPress={() => onDelete(currentQuestionIndex)}
412
+ >
413
+ <TrashBinIcon />
414
+ </PressableIcon>
415
+
416
+ <HMSBaseButton
417
+ loading={false}
418
+ disabled={saveButtonDisabled}
419
+ onPress={() => {
420
+ setQuestionTypesVisible(false);
421
+ onQuestionFieldChange(
422
+ currentQuestionIndex,
423
+ 'saved',
424
+ !pollQuestion.saved
425
+ );
426
+ }}
427
+ title={pollQuestion.saved ? 'Edit' : 'Save'}
428
+ underlayColor={hmsRoomStyles.saveButtonDisabled.backgroundColor}
429
+ style={
430
+ saveButtonDisabled
431
+ ? hmsRoomStyles.saveButtonDisabled
432
+ : hmsRoomStyles.saveButton
433
+ }
434
+ textStyle={[
435
+ styles.normalText,
436
+ saveButtonDisabled
437
+ ? hmsRoomStyles.saveTextDisabled
438
+ : hmsRoomStyles.saveText,
439
+ ]}
440
+ />
441
+ </View>
442
+ </View>
443
+ );
444
+ };
445
+
446
+ const styles = StyleSheet.create({
447
+ container: {
448
+ padding: 16,
449
+ borderRadius: 8,
450
+ },
451
+ tinyText: {
452
+ fontSize: 10,
453
+ lineHeight: 16,
454
+ letterSpacing: 1.5,
455
+ },
456
+ smallText: {
457
+ fontSize: 14,
458
+ lineHeight: 20,
459
+ },
460
+ normalText: {
461
+ fontSize: 16,
462
+ lineHeight: 24,
463
+ letterSpacing: 0.5,
464
+ },
465
+ questionLabel: {
466
+ textTransform: 'uppercase',
467
+ marginBottom: 16,
468
+ },
469
+ questionTypeWrapper: {
470
+ position: 'relative',
471
+ marginBottom: 16,
472
+ zIndex: 40,
473
+ },
474
+ questionType: {
475
+ paddingVertical: 12,
476
+ paddingHorizontal: 16,
477
+ flexDirection: 'row',
478
+ alignItems: 'center',
479
+ justifyContent: 'space-between',
480
+ borderRadius: 8,
481
+ },
482
+ questionTypeOptions: {
483
+ width: '100%',
484
+ paddingVertical: 8,
485
+ overflow: 'hidden',
486
+ position: 'absolute',
487
+ zIndex: 20,
488
+ top: 48 + 4,
489
+ borderWidth: 1,
490
+ borderRadius: 8,
491
+ },
492
+ questionTypeDivider: {
493
+ height: 1,
494
+ width: '90%',
495
+ alignSelf: 'center',
496
+ },
497
+ questionTypeOption: {
498
+ paddingVertical: 12,
499
+ paddingHorizontal: 16,
500
+ },
501
+ optionsWrapper: {
502
+ marginBottom: 16,
503
+ },
504
+ optionContainer: {
505
+ flexDirection: 'row',
506
+ alignItems: 'center',
507
+ },
508
+ optionDelete: {
509
+ alignSelf: 'center',
510
+ marginLeft: 8,
511
+ },
512
+ topSpace: {
513
+ marginTop: 8,
514
+ },
515
+ bottomSpace: {
516
+ marginBottom: 8,
517
+ },
518
+ addOptionWrapper: {
519
+ alignSelf: 'flex-start',
520
+ },
521
+ addOptionContainer: {
522
+ flexDirection: 'row',
523
+ alignItems: 'center',
524
+ },
525
+ addOptionIconWrapper: {
526
+ marginRight: 8,
527
+ padding: 8,
528
+ },
529
+ config: {
530
+ marginBottom: 16,
531
+ },
532
+ saveContainer: {
533
+ flexDirection: 'row',
534
+ justifyContent: 'space-between',
535
+ alignItems: 'center',
536
+ },
537
+ deleteIcon: {
538
+ marginRight: 16,
539
+ },
540
+ });
541
+
542
+ function getLabelFromPollQuestionType(type: HMSPollQuestionType): string {
543
+ switch (type) {
544
+ case HMSPollQuestionType.singleChoice:
545
+ return 'Single Choice';
546
+ case HMSPollQuestionType.multipleChoice:
547
+ return 'Multiple Choice';
548
+ case HMSPollQuestionType.longAnswer:
549
+ return 'Long Answer';
550
+ case HMSPollQuestionType.shortAnswer:
551
+ return 'Short Answer';
552
+ }
553
+ }
@@ -0,0 +1,110 @@
1
+ import * as React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
3
+ import { useDispatch } from 'react-redux';
4
+
5
+ import { useHMSRoomStyleSheet } from '../hooks-util';
6
+ import { AlertTriangleIcon, CloseIcon } from '../Icons';
7
+ import { HMSDangerButton } from './HMSDangerButton';
8
+ import { deletePollQuestion } from '../redux/actions';
9
+
10
+ export interface PollQuestionDeleteConfirmationProps {
11
+ dismissModal(): void;
12
+ }
13
+
14
+ export const PollQuestionDeleteConfirmation: React.FC<
15
+ PollQuestionDeleteConfirmationProps
16
+ > = ({ dismissModal }) => {
17
+ const dispatch = useDispatch();
18
+
19
+ const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
20
+ headerText: {
21
+ color: theme.palette.alert_error_default,
22
+ fontFamily: `${typography.font_family}-SemiBold`,
23
+ },
24
+ subtitle: {
25
+ color: theme.palette.on_surface_medium,
26
+ fontFamily: `${typography.font_family}-Regular`,
27
+ },
28
+ }));
29
+
30
+ const disabledButton = false;
31
+
32
+ const handleClosePress = () => dismissModal();
33
+
34
+ const handlePollQuestionDelete = () => {
35
+ dispatch(deletePollQuestion());
36
+ dismissModal();
37
+ };
38
+
39
+ return (
40
+ <View style={styles.container}>
41
+ <View style={styles.header}>
42
+ <View style={styles.headerControls}>
43
+ <AlertTriangleIcon style={styles.backIcon} />
44
+
45
+ <Text style={[styles.headerText, hmsRoomStyles.headerText]}>
46
+ Delete Question
47
+ </Text>
48
+ </View>
49
+
50
+ <TouchableOpacity
51
+ onPress={handleClosePress}
52
+ hitSlop={styles.closeIconHitSlop}
53
+ >
54
+ <CloseIcon />
55
+ </TouchableOpacity>
56
+ </View>
57
+
58
+ <Text style={[styles.subtitle, hmsRoomStyles.subtitle]}>
59
+ Are you sure you want to delete this question?{'\n'}You can't undo this
60
+ action.
61
+ </Text>
62
+
63
+ <HMSDangerButton
64
+ loading={false}
65
+ onPress={handlePollQuestionDelete}
66
+ title="Delete"
67
+ disabled={disabledButton}
68
+ style={styles.deleteButton}
69
+ />
70
+ </View>
71
+ );
72
+ };
73
+
74
+ const styles = StyleSheet.create({
75
+ container: {
76
+ padding: 24,
77
+ paddingBottom: 32,
78
+ },
79
+ header: {
80
+ flexDirection: 'row',
81
+ alignItems: 'center',
82
+ justifyContent: 'space-between',
83
+ },
84
+ headerControls: {
85
+ flexDirection: 'row',
86
+ alignItems: 'center',
87
+ },
88
+ backIcon: {
89
+ marginRight: 8,
90
+ },
91
+ headerText: {
92
+ fontSize: 20,
93
+ lineHeight: 24,
94
+ letterSpacing: 0.15,
95
+ },
96
+ closeIconHitSlop: {
97
+ bottom: 16,
98
+ left: 16,
99
+ right: 16,
100
+ top: 16,
101
+ },
102
+ subtitle: {
103
+ fontSize: 14,
104
+ lineHeight: 20,
105
+ marginTop: 8,
106
+ },
107
+ deleteButton: {
108
+ marginTop: 16,
109
+ },
110
+ });