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

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