be-components 4.2.0 → 4.2.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 (283) hide show
  1. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +12 -23
  2. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
  3. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +191 -100
  4. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
  5. package/lib/commonjs/Competition/components/WagerPickForm.js +8 -2
  6. package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -1
  7. package/lib/commonjs/Competition/index.js +49 -9
  8. package/lib/commonjs/Competition/index.js.map +1 -1
  9. package/lib/commonjs/Components/ConfirmationModal.js +11 -3
  10. package/lib/commonjs/Components/ConfirmationModal.js.map +1 -1
  11. package/lib/commonjs/Components/SearchBox.js +3 -1
  12. package/lib/commonjs/Components/SearchBox.js.map +1 -1
  13. package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js +2 -0
  14. package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
  15. package/lib/commonjs/MarketMaker/components/Contest.js +39 -41
  16. package/lib/commonjs/MarketMaker/components/Contest.js.map +1 -1
  17. package/lib/commonjs/MarketMaker/components/ContestSelector.js +48 -30
  18. package/lib/commonjs/MarketMaker/components/ContestSelector.js.map +1 -1
  19. package/lib/commonjs/MarketMaker/components/Dashboard.js +14 -73
  20. package/lib/commonjs/MarketMaker/components/Dashboard.js.map +1 -1
  21. package/lib/commonjs/MarketMaker/components/FundOwnershipList.js +27 -30
  22. package/lib/commonjs/MarketMaker/components/FundOwnershipList.js.map +1 -1
  23. package/lib/commonjs/MarketMaker/components/FundSelector.js +30 -33
  24. package/lib/commonjs/MarketMaker/components/FundSelector.js.map +1 -1
  25. package/lib/commonjs/MarketMaker/components/FundingRequestList.js +28 -41
  26. package/lib/commonjs/MarketMaker/components/FundingRequestList.js.map +1 -1
  27. package/lib/commonjs/MarketMaker/components/ManageFundForm.js +1 -1
  28. package/lib/commonjs/MarketMaker/components/ManageFundForm.js.map +1 -1
  29. package/lib/commonjs/MarketMaker/components/MarketSelector.js +26 -24
  30. package/lib/commonjs/MarketMaker/components/MarketSelector.js.map +1 -1
  31. package/lib/commonjs/MarketMaker/components/OrderForm.js +7 -4
  32. package/lib/commonjs/MarketMaker/components/OrderForm.js.map +1 -1
  33. package/lib/commonjs/MarketMaker/index.js +301 -227
  34. package/lib/commonjs/MarketMaker/index.js.map +1 -1
  35. package/lib/commonjs/Poll/components/CampaignHeader.js +20 -15
  36. package/lib/commonjs/Poll/components/CampaignHeader.js.map +1 -1
  37. package/lib/commonjs/Poll/components/CampaignLeaderboard.js +77 -75
  38. package/lib/commonjs/Poll/components/CampaignLeaderboard.js.map +1 -1
  39. package/lib/commonjs/Poll/components/CampaignProgressBar.js +21 -20
  40. package/lib/commonjs/Poll/components/CampaignProgressBar.js.map +1 -1
  41. package/lib/commonjs/Poll/components/CampaignResult.js +21 -19
  42. package/lib/commonjs/Poll/components/CampaignResult.js.map +1 -1
  43. package/lib/commonjs/Poll/components/PollCard.js +240 -218
  44. package/lib/commonjs/Poll/components/PollCard.js.map +1 -1
  45. package/lib/commonjs/Poll/components/PollOptionCard.js +28 -25
  46. package/lib/commonjs/Poll/components/PollOptionCard.js.map +1 -1
  47. package/lib/commonjs/Poll/components/PollQuestionsSection.js +25 -19
  48. package/lib/commonjs/Poll/components/PollQuestionsSection.js.map +1 -1
  49. package/lib/commonjs/Poll/components/PollSelectCard.js +48 -45
  50. package/lib/commonjs/Poll/components/PollSelectCard.js.map +1 -1
  51. package/lib/commonjs/Poll/index.js +97 -93
  52. package/lib/commonjs/Poll/index.js.map +1 -1
  53. package/lib/commonjs/Squares/index.js +28 -9
  54. package/lib/commonjs/Squares/index.js.map +1 -1
  55. package/lib/module/Competition/components/CompetitionLeaderboard.js +12 -23
  56. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
  57. package/lib/module/Competition/components/EnterCompetitionPrompt.js +191 -100
  58. package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
  59. package/lib/module/Competition/components/WagerPickForm.js +8 -2
  60. package/lib/module/Competition/components/WagerPickForm.js.map +1 -1
  61. package/lib/module/Competition/index.js +49 -9
  62. package/lib/module/Competition/index.js.map +1 -1
  63. package/lib/module/Components/ConfirmationModal.js +11 -3
  64. package/lib/module/Components/ConfirmationModal.js.map +1 -1
  65. package/lib/module/Components/SearchBox.js +3 -1
  66. package/lib/module/Components/SearchBox.js.map +1 -1
  67. package/lib/module/MarketComponents/components/ContestOrderStatsCard.js +2 -0
  68. package/lib/module/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
  69. package/lib/module/MarketMaker/components/Contest.js +21 -24
  70. package/lib/module/MarketMaker/components/Contest.js.map +1 -1
  71. package/lib/module/MarketMaker/components/ContestSelector.js +43 -25
  72. package/lib/module/MarketMaker/components/ContestSelector.js.map +1 -1
  73. package/lib/module/MarketMaker/components/Dashboard.js +9 -66
  74. package/lib/module/MarketMaker/components/Dashboard.js.map +1 -1
  75. package/lib/module/MarketMaker/components/FundOwnershipList.js +19 -22
  76. package/lib/module/MarketMaker/components/FundOwnershipList.js.map +1 -1
  77. package/lib/module/MarketMaker/components/FundSelector.js +24 -27
  78. package/lib/module/MarketMaker/components/FundSelector.js.map +1 -1
  79. package/lib/module/MarketMaker/components/FundingRequestList.js +18 -31
  80. package/lib/module/MarketMaker/components/FundingRequestList.js.map +1 -1
  81. package/lib/module/MarketMaker/components/ManageFundForm.js +1 -1
  82. package/lib/module/MarketMaker/components/ManageFundForm.js.map +1 -1
  83. package/lib/module/MarketMaker/components/MarketSelector.js +19 -17
  84. package/lib/module/MarketMaker/components/MarketSelector.js.map +1 -1
  85. package/lib/module/MarketMaker/components/OrderForm.js +7 -4
  86. package/lib/module/MarketMaker/components/OrderForm.js.map +1 -1
  87. package/lib/module/MarketMaker/index.js +298 -223
  88. package/lib/module/MarketMaker/index.js.map +1 -1
  89. package/lib/module/Poll/components/CampaignHeader.js +19 -14
  90. package/lib/module/Poll/components/CampaignHeader.js.map +1 -1
  91. package/lib/module/Poll/components/CampaignLeaderboard.js +59 -57
  92. package/lib/module/Poll/components/CampaignLeaderboard.js.map +1 -1
  93. package/lib/module/Poll/components/CampaignProgressBar.js +17 -15
  94. package/lib/module/Poll/components/CampaignProgressBar.js.map +1 -1
  95. package/lib/module/Poll/components/CampaignResult.js +17 -15
  96. package/lib/module/Poll/components/CampaignResult.js.map +1 -1
  97. package/lib/module/Poll/components/PollCard.js +238 -216
  98. package/lib/module/Poll/components/PollCard.js.map +1 -1
  99. package/lib/module/Poll/components/PollOptionCard.js +24 -20
  100. package/lib/module/Poll/components/PollOptionCard.js.map +1 -1
  101. package/lib/module/Poll/components/PollQuestionsSection.js +21 -15
  102. package/lib/module/Poll/components/PollQuestionsSection.js.map +1 -1
  103. package/lib/module/Poll/components/PollSelectCard.js +33 -30
  104. package/lib/module/Poll/components/PollSelectCard.js.map +1 -1
  105. package/lib/module/Poll/index.js +97 -92
  106. package/lib/module/Poll/index.js.map +1 -1
  107. package/lib/module/Squares/index.js +28 -9
  108. package/lib/module/Squares/index.js.map +1 -1
  109. package/lib/typescript/lib/commonjs/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  110. package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
  111. package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
  112. package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts +3 -1
  113. package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts.map +1 -1
  114. package/lib/typescript/lib/commonjs/Competition/index.d.ts +2 -1
  115. package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
  116. package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts +2 -1
  117. package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts.map +1 -1
  118. package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts +2 -1
  119. package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
  120. package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
  121. package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
  122. package/lib/typescript/lib/commonjs/MarketMaker/components/Contest.d.ts.map +1 -1
  123. package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts +1 -2
  124. package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts.map +1 -1
  125. package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts +1 -2
  126. package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts.map +1 -1
  127. package/lib/typescript/lib/commonjs/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
  128. package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts +1 -2
  129. package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts.map +1 -1
  130. package/lib/typescript/lib/commonjs/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
  131. package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts +1 -2
  132. package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts.map +1 -1
  133. package/lib/typescript/lib/commonjs/MarketMaker/components/OrderForm.d.ts.map +1 -1
  134. package/lib/typescript/lib/commonjs/MarketMaker/index.d.ts.map +1 -1
  135. package/lib/typescript/lib/commonjs/Poll/components/CampaignHeader.d.ts.map +1 -1
  136. package/lib/typescript/lib/commonjs/Poll/components/CampaignLeaderboard.d.ts +1 -2
  137. package/lib/typescript/lib/commonjs/Poll/components/CampaignLeaderboard.d.ts.map +1 -1
  138. package/lib/typescript/lib/commonjs/Poll/components/CampaignProgressBar.d.ts.map +1 -1
  139. package/lib/typescript/lib/commonjs/Poll/components/CampaignResult.d.ts.map +1 -1
  140. package/lib/typescript/lib/commonjs/Poll/components/PollCard.d.ts +2 -1
  141. package/lib/typescript/lib/commonjs/Poll/components/PollCard.d.ts.map +1 -1
  142. package/lib/typescript/lib/commonjs/Poll/components/PollOptionCard.d.ts.map +1 -1
  143. package/lib/typescript/lib/commonjs/Poll/components/PollQuestionsSection.d.ts.map +1 -1
  144. package/lib/typescript/lib/commonjs/Poll/components/PollSelectCard.d.ts +1 -2
  145. package/lib/typescript/lib/commonjs/Poll/components/PollSelectCard.d.ts.map +1 -1
  146. package/lib/typescript/lib/commonjs/Poll/index.d.ts +1 -2
  147. package/lib/typescript/lib/commonjs/Poll/index.d.ts.map +1 -1
  148. package/lib/typescript/lib/commonjs/Squares/index.d.ts +2 -1
  149. package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
  150. package/lib/typescript/lib/module/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  151. package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
  152. package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
  153. package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts +3 -1
  154. package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts.map +1 -1
  155. package/lib/typescript/lib/module/Competition/index.d.ts +2 -1
  156. package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
  157. package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts +2 -1
  158. package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts.map +1 -1
  159. package/lib/typescript/lib/module/Components/SearchBox.d.ts +2 -1
  160. package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
  161. package/lib/typescript/lib/module/Components/Spring.d.ts +1 -1
  162. package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
  163. package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
  164. package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts +1 -2
  165. package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts.map +1 -1
  166. package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts +2 -4
  167. package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts.map +1 -1
  168. package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts +2 -4
  169. package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts.map +1 -1
  170. package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts +1 -2
  171. package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
  172. package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts +2 -4
  173. package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts.map +1 -1
  174. package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts +1 -2
  175. package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
  176. package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts +2 -4
  177. package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts.map +1 -1
  178. package/lib/typescript/lib/module/MarketMaker/components/OrderForm.d.ts.map +1 -1
  179. package/lib/typescript/lib/module/MarketMaker/index.d.ts +1 -2
  180. package/lib/typescript/lib/module/MarketMaker/index.d.ts.map +1 -1
  181. package/lib/typescript/lib/module/Poll/components/CampaignHeader.d.ts +1 -2
  182. package/lib/typescript/lib/module/Poll/components/CampaignHeader.d.ts.map +1 -1
  183. package/lib/typescript/lib/module/Poll/components/CampaignLeaderboard.d.ts +2 -4
  184. package/lib/typescript/lib/module/Poll/components/CampaignLeaderboard.d.ts.map +1 -1
  185. package/lib/typescript/lib/module/Poll/components/CampaignProgressBar.d.ts +1 -2
  186. package/lib/typescript/lib/module/Poll/components/CampaignProgressBar.d.ts.map +1 -1
  187. package/lib/typescript/lib/module/Poll/components/CampaignResult.d.ts +1 -2
  188. package/lib/typescript/lib/module/Poll/components/CampaignResult.d.ts.map +1 -1
  189. package/lib/typescript/lib/module/Poll/components/PollCard.d.ts +3 -5
  190. package/lib/typescript/lib/module/Poll/components/PollCard.d.ts.map +1 -1
  191. package/lib/typescript/lib/module/Poll/components/PollOptionCard.d.ts +1 -2
  192. package/lib/typescript/lib/module/Poll/components/PollOptionCard.d.ts.map +1 -1
  193. package/lib/typescript/lib/module/Poll/components/PollQuestionsSection.d.ts +1 -2
  194. package/lib/typescript/lib/module/Poll/components/PollQuestionsSection.d.ts.map +1 -1
  195. package/lib/typescript/lib/module/Poll/components/PollSelectCard.d.ts +2 -4
  196. package/lib/typescript/lib/module/Poll/components/PollSelectCard.d.ts.map +1 -1
  197. package/lib/typescript/lib/module/Poll/index.d.ts +2 -4
  198. package/lib/typescript/lib/module/Poll/index.d.ts.map +1 -1
  199. package/lib/typescript/lib/module/Squares/index.d.ts +2 -1
  200. package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
  201. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  202. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
  203. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
  204. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +3 -1
  205. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -1
  206. package/lib/typescript/src/Competition/index.d.ts +2 -1
  207. package/lib/typescript/src/Competition/index.d.ts.map +1 -1
  208. package/lib/typescript/src/Components/ConfirmationModal.d.ts +2 -1
  209. package/lib/typescript/src/Components/ConfirmationModal.d.ts.map +1 -1
  210. package/lib/typescript/src/Components/SearchBox.d.ts +2 -1
  211. package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
  212. package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
  213. package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
  214. package/lib/typescript/src/MarketMaker/components/Contest.d.ts.map +1 -1
  215. package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts +1 -1
  216. package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts.map +1 -1
  217. package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts +1 -1
  218. package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts.map +1 -1
  219. package/lib/typescript/src/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
  220. package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts +1 -2
  221. package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts.map +1 -1
  222. package/lib/typescript/src/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
  223. package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts +1 -1
  224. package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts.map +1 -1
  225. package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts +1 -2
  226. package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts.map +1 -1
  227. package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts +1 -1
  228. package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts.map +1 -1
  229. package/lib/typescript/src/MarketMaker/index.d.ts.map +1 -1
  230. package/lib/typescript/src/Poll/components/CampaignHeader.d.ts.map +1 -1
  231. package/lib/typescript/src/Poll/components/CampaignLeaderboard.d.ts +1 -2
  232. package/lib/typescript/src/Poll/components/CampaignLeaderboard.d.ts.map +1 -1
  233. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts.map +1 -1
  234. package/lib/typescript/src/Poll/components/CampaignResult.d.ts.map +1 -1
  235. package/lib/typescript/src/Poll/components/PollCard.d.ts +3 -2
  236. package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -1
  237. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts.map +1 -1
  238. package/lib/typescript/src/Poll/components/PollQuestionsSection.d.ts.map +1 -1
  239. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts +1 -1
  240. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts.map +1 -1
  241. package/lib/typescript/src/Poll/index.d.ts +1 -2
  242. package/lib/typescript/src/Poll/index.d.ts.map +1 -1
  243. package/lib/typescript/src/Squares/index.d.ts +2 -1
  244. package/lib/typescript/src/Squares/index.d.ts.map +1 -1
  245. package/package.json +1 -1
  246. package/src/Competition/components/CompetitionLeaderboard.tsx +10 -21
  247. package/src/Competition/components/EnterCompetitionPrompt.tsx +98 -59
  248. package/src/Competition/components/WagerPickForm.tsx +4 -2
  249. package/src/Competition/index.tsx +33 -25
  250. package/src/Components/ConfirmationModal.tsx +5 -4
  251. package/src/Components/SearchBox.tsx +4 -2
  252. package/src/MarketComponents/components/ContestOrderStatsCard.tsx +3 -1
  253. package/src/MarketMaker/components/Contest.tsx +21 -21
  254. package/src/MarketMaker/components/ContestSelector.tsx +31 -22
  255. package/src/MarketMaker/components/Dashboard.tsx +9 -24
  256. package/src/MarketMaker/components/FundOwnershipList.tsx +13 -15
  257. package/src/MarketMaker/components/FundSelector.tsx +21 -23
  258. package/src/MarketMaker/components/FundingRequestList.tsx +14 -20
  259. package/src/MarketMaker/components/ManageFundForm.tsx +2 -2
  260. package/src/MarketMaker/components/MarketSelector.tsx +14 -16
  261. package/src/MarketMaker/components/OrderForm.tsx +6 -5
  262. package/src/MarketMaker/index.tsx +166 -94
  263. package/src/Poll/components/CampaignHeader.tsx +13 -12
  264. package/src/Poll/components/CampaignLeaderboard.tsx +41 -52
  265. package/src/Poll/components/CampaignProgressBar.tsx +17 -15
  266. package/src/Poll/components/CampaignResult.tsx +13 -13
  267. package/src/Poll/components/PollCard.tsx +129 -118
  268. package/src/Poll/components/PollOptionCard.tsx +20 -21
  269. package/src/Poll/components/PollQuestionsSection.tsx +15 -14
  270. package/src/Poll/components/PollSelectCard.tsx +47 -48
  271. package/src/Poll/index.tsx +83 -73
  272. package/src/Squares/index.tsx +29 -19
  273. package/lib/commonjs/Poll/components/CampaignPlay.js +0 -472
  274. package/lib/commonjs/Poll/components/CampaignPlay.js.map +0 -1
  275. package/lib/module/Poll/components/CampaignPlay.js +0 -463
  276. package/lib/module/Poll/components/CampaignPlay.js.map +0 -1
  277. package/lib/typescript/lib/commonjs/Poll/components/CampaignPlay.d.ts +0 -12
  278. package/lib/typescript/lib/commonjs/Poll/components/CampaignPlay.d.ts.map +0 -1
  279. package/lib/typescript/lib/module/Poll/components/CampaignPlay.d.ts +0 -13
  280. package/lib/typescript/lib/module/Poll/components/CampaignPlay.d.ts.map +0 -1
  281. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts +0 -14
  282. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts.map +0 -1
  283. package/src/Poll/components/CampaignPlay.tsx +0 -335
@@ -1,10 +1,9 @@
1
- import { TouchableOpacity, View } from "react-native"
2
1
  import React, { useState } from "react"
3
2
  import type { PollCampaignProps } from "../../types"
4
- import { Icons, Text } from "../../Components"
5
- import Colors from '../../constants/colors';
6
- import { view_styles } from "../../constants/styles"
3
+ import { Icons } from "../../Components"
7
4
  import CampaignLeaderboard from "./CampaignLeaderboard"
5
+ import { Button, Text, View } from "../../Components/Themed"
6
+ import { useColors } from "../../constants/useColors"
8
7
 
9
8
  type CampaignResultProps = {
10
9
  poll_campaign:PollCampaignProps,
@@ -13,19 +12,20 @@ type CampaignResultProps = {
13
12
 
14
13
  const CampaignResult = ({ poll_campaign, onShowFullLeaderboard } : CampaignResultProps) => {
15
14
  const [ expanded, setExpanded ] = useState(false);
15
+ const Colors = useColors();
16
16
 
17
17
  return (
18
- <View style={{ flex:1, ...view_styles.section }}>
19
- <TouchableOpacity style={{ ...view_styles.section_header }} onPress={() => setExpanded(!expanded)}>
20
- <Icons.PodiumIcon size={18} color={Colors.brand.midnight} />
21
- <View style={{flex:1, marginLeft:10}}>
22
- <Text theme="header">Leaderboard</Text>
23
- <Text style={{ marginTop:3 }} theme="body">Below are the leaderboard results!</Text>
18
+ <View float style={{ flex:1 }}>
19
+ <Button style={{ flexDirection:'row', alignItems:'center', padding:20, backgroundColor:Colors.views.header }} onPress={() => setExpanded(!expanded)}>
20
+ <Icons.PodiumIcon size={18} color={Colors.text.h1} />
21
+ <View transparent style={{flex:1, marginLeft:10}}>
22
+ <Text theme="h1">Leaderboard</Text>
23
+ <Text style={{ marginTop:3 }} theme="description">Below are the leaderboard results!</Text>
24
24
  </View>
25
- <Icons.ChevronIcon size={8} color={Colors.brand.midnight} direction={expanded ? 'up' : 'down'} />
26
- </TouchableOpacity>
25
+ <Icons.ChevronIcon size={8} color={Colors.text.h1} direction={expanded ? 'up' : 'down'} />
26
+ </Button>
27
27
  {expanded ?
28
- <View style={{ ...view_styles.section_body, padding:0, backgroundColor:Colors.shades.shade100 }}>
28
+ <View style={{ padding:0 }}>
29
29
  <CampaignLeaderboard
30
30
  view_mode="short"
31
31
  poll_campaign={poll_campaign}
@@ -1,17 +1,18 @@
1
- import { FlatList, Image, ScrollView, TouchableOpacity, View } from 'react-native';
1
+ import { ActivityIndicator, FlatList, Image } from 'react-native';
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import PollOptionCard from './PollOptionCard';
4
4
  import ResponseTimer from './ResponseTimer';
5
5
  import type { PollOptionProps, PollProps, PollResponseProps, PollSummaryProps } from '../../types';
6
6
  import { PollApi } from '../api';
7
- import { Button, Icons, Text } from '../../Components';
8
- import Colors from '../../constants/colors';
9
- import { view_styles } from '../../constants/styles';
7
+ import { Icons } from '../../Components';
8
+ import { useColors } from '../../constants/useColors';
9
+ import { Button, Text, View } from '../../Components/Themed';
10
10
 
11
11
  type PollCardProps = {
12
- poll_id:string,
12
+ poll_id?:string,
13
13
  poll_response?:PollResponseProps,
14
14
  action_loading?:boolean,
15
+ width:number,
15
16
  question_number?:number,
16
17
  view?:string,
17
18
  total_questions?:number,
@@ -20,9 +21,9 @@ type PollCardProps = {
20
21
  onCancel:() => void,
21
22
  onSkip: () => void
22
23
  }
23
-
24
- const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, onResponse }: PollCardProps) => {
25
- const [ poll_width, setPollWidth ] = useState(0);
24
+ const sections = ['question','image','options','selected_option', 'correct_select', 'public_results']
25
+ const PollCard = ({ poll_id, width, poll_response, action_loading, onSkip, onCancel, onResponse }: PollCardProps) => {
26
+ const Colors = useColors();
26
27
  const [ poll_data, setPollData ] = useState<{
27
28
  poll?:PollProps,
28
29
  loading:boolean,
@@ -38,6 +39,7 @@ const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, on
38
39
  const correct_option = poll_options.find(o => o.result_ind == 'win');
39
40
  const responses = poll_summaries.reduce((a,b) => a + b.count, 0)
40
41
  useEffect(() => {
42
+ if(!poll_id){ return }
41
43
  getPollFromServer(poll_id)
42
44
  },[poll_id])
43
45
 
@@ -144,111 +146,127 @@ const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, on
144
146
  )
145
147
  }
146
148
 
147
- if(!poll){ return <></> }
148
-
149
- return (
150
- <View nativeID='poll' style={{ ...view_styles.section, minHeight:500 }} onLayout={(ev) => {
151
- const { width } = ev.nativeEvent.layout
152
- setPollWidth(width)
153
- }}>
154
- <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100 }}>
155
- <View style={{ flex:1 }}>
156
- <Text theme='header_2'>Question {poll.priority}</Text>
157
- <Text style={{ marginTop:5 }} theme='header'>{poll.poll_question}</Text>
158
- </View>
159
- </View>
160
- <ScrollView style={{ flex:1 }}>
161
- <View nativeID='question_image'>
162
- {poll?.poll_image?.url ?
163
- <Image
164
- source={{ uri:poll.poll_image.url, width:poll_width, height: poll_width*0.5 }}
165
- resizeMode='contain'
166
- />
167
- :<></>}
168
- </View>
169
-
170
- { poll.status == 'active' && !poll_response ?
171
- <View nativeID='question_respond_options'>
172
- <FlatList
173
- data={poll_options.sort((a,b) => a.priority - b.priority)}
174
- renderItem={renderPollOptions}
175
- numColumns={2}
176
- keyExtractor={(item) => item.poll_option_id.toString()}
177
- />
178
- </View>
179
- :
180
- <View nativeID='question_answer' style={{ flex:1 }}>
181
- {selected_option ?
182
- <View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
183
- <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>MY SELECTED ANSWER</Text>
184
- <PollOptionCard
185
- show_result={true}
186
- show_summary={false}
187
- poll_response={poll_response}
188
- onSelect={() => console.log('Hey')}
189
- poll_option={selected_option}
190
- />
191
- </View>
192
- : (!poll_response || poll_response?.timed_out) ?
193
- <View style={{ marginBottom:10, padding:10 }}>
194
- <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>MY SELECTED ANSWER</Text>
195
- <View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.utility.error }}>
196
- <Text style={{ flex:1 }} size={14} color={Colors.utility.error} textAlign='center' weight='semibold'>Timed Out</Text>
197
- <Icons.CloseIcon color={Colors.utility.error} size={12}/>
149
+ const renderSections = (data:{ item:string, index:number }) => {
150
+ switch(data.item){
151
+ case 'question':
152
+ if(!poll){ return <></> }
153
+ return (
154
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:15, borderTopRightRadius:22, borderTopLeftRadius:22 }}>
155
+ <View transparent style={{ flex:1 }}>
156
+ <Text theme='h2'>Question {poll.priority}</Text>
157
+ <Text style={{ marginTop:5 }} theme='h1'>{poll.poll_question}</Text>
158
+ </View>
198
159
  </View>
199
- </View>
200
- :<></>}
201
- {poll.poll_type == 'select' && correct_option ?
202
- <View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
203
- <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>CORRECT ANSWER</Text>
204
- <PollOptionCard
205
- show_summary={true}
206
- show_result={true}
207
- onSelect={() => console.log('')}
208
- poll_option={correct_option}
209
- />
210
- </View>
211
- :poll.poll_type == 'input' && poll.winning_value ?
212
- <View style={{ marginBottom:10, padding:10 }}>
213
- <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>CORRECT ANSWER</Text>
214
- <View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.utility.success }}>
215
- <Text style={{ flex:1 }} size={14} color={Colors.utility.success} textAlign='center' weight='semibold'>{poll.winning_value}</Text>
216
- <Icons.CheckIcon color={Colors.utility.success} size={12}/>
160
+ )
161
+ case 'image':
162
+ if(!poll?.poll_image?.url){ return <></> }
163
+ return (
164
+ <View nativeID='question_image'>
165
+ <Image
166
+ source={{ uri:poll.poll_image.url }}
167
+ style={{ width:width - 20, height:width/2}}
168
+ resizeMode='cover'
169
+ />
217
170
  </View>
218
- </View>
219
- :<></>}
220
- {poll.poll_type == 'select' ?
221
- <View nativeID='option_results' style={{ backgroundColor:Colors.shades.shade100, padding:10, borderRadius:8 }}>
222
- <View style={{ flexDirection:'row', alignItems:'center', marginBottom:5 }}>
223
- <Text style={{ flex:1 }} size={14} color={Colors.brand.slate} weight='semibold'>PUBLIC RESULTS</Text>
224
- <View style={{ borderRadius:22, padding:10, backgroundColor:Colors.accents.accent100 }}>
225
- <Text size={14} color={Colors.brand.midnight} weight='regular'>{responses} Responses</Text>
171
+ )
172
+ case 'options':
173
+ if(!poll || poll.status != 'active' || poll_response){ return <></> }
174
+ return (
175
+ <View nativeID='question_respond_options' style={{ padding:12, maxHeight:550 }}>
176
+ <FlatList
177
+ data={poll_options.sort((a,b) => a.priority - b.priority)}
178
+ renderItem={renderPollOptions}
179
+ numColumns={2}
180
+ keyExtractor={(item) => item.poll_option_id.toString()}
181
+ />
182
+ </View>
183
+ )
184
+ case 'selected_option':
185
+ if(!selected_option || !poll_response){ return <></> }
186
+ return (
187
+ <View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
188
+ <Text style={{ marginBottom:5 }} size={14} theme='description'>MY SELECTED ANSWER</Text>
189
+ <PollOptionCard
190
+ show_result={true}
191
+ show_summary={false}
192
+ poll_response={poll_response}
193
+ onSelect={() => console.log('Hey')}
194
+ poll_option={selected_option}
195
+ />
196
+ </View>
197
+ )
198
+ case 'correct_select':
199
+ if(!poll || poll.poll_type != 'select' || !correct_option){ return <></> }
200
+ return (
201
+ <View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
202
+ <Text style={{ marginBottom:5 }} size={14} theme='description' weight='semibold'>CORRECT ANSWER</Text>
203
+ <PollOptionCard
204
+ show_summary={true}
205
+ show_result={true}
206
+ onSelect={() => console.log('')}
207
+ poll_option={correct_option}
208
+ />
209
+ </View>
210
+ )
211
+ case 'correct_input':
212
+ if(!poll || poll.poll_type != 'input' || !poll.winning_value){ return <></> }
213
+ return (
214
+ <View style={{ marginBottom:10, padding:10 }}>
215
+ <Text style={{ marginBottom:5 }} size={14} theme='description' weight='semibold'>CORRECT ANSWER</Text>
216
+ <View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.text.success }}>
217
+ <Text style={{ flex:1 }} size={14} color={Colors.text.success} textAlign='center' weight='semibold'>{poll.winning_value}</Text>
218
+ <Icons.CheckIcon color={Colors.text.success} size={12}/>
226
219
  </View>
227
220
  </View>
228
- {!poll.show_responses ?
229
- <Text style={{ marginBottom:5 }} color={Colors.utility.warning} size={12} >Responses are hidden until closed</Text>
230
- :<></>}
231
- <FlatList
232
- data={poll_options}
233
- renderItem={renderPollOptions}
234
- keyExtractor={(item) => item.poll_option_id.toString()}
235
- />
236
- </View>
221
+ )
222
+ case 'public_results':
223
+ if(!poll || poll.poll_type != 'select' || !poll_response){ return <></> }
224
+ if(!poll.show_responses){ return <></> }
225
+ return (
226
+ <View nativeID='option_results' style={{ padding:10, borderRadius:8 }}>
227
+ <View style={{ flexDirection:'row', alignItems:'center', marginBottom:5 }}>
228
+ <Text style={{ flex:1 }} size={14} theme='description' weight='semibold'>PUBLIC RESULTS</Text>
229
+ <View style={{ borderRadius:22, padding:10 }}>
230
+ <Text size={14} theme='description'>{responses} Responses</Text>
231
+ </View>
232
+ </View>
233
+ {!poll.show_responses ?
234
+ <Text style={{ marginBottom:5 }} color={Colors.text.warning} size={12} >Responses are hidden until closed</Text>
235
+ :<></>}
236
+ <FlatList
237
+ data={poll_options}
238
+ renderItem={renderPollOptions}
239
+ keyExtractor={(item) => item.poll_option_id.toString()}
240
+ />
241
+ </View>
242
+ )
243
+ default:return <></>
244
+ }
245
+ }
246
+
247
+ return (
248
+ <View float nativeID='poll' style={{ borderRadius:22 }}>
249
+ <View transparent style={{ flex:1 }}>
250
+ {loading || !poll ?
251
+ <ActivityIndicator style={{ padding:20, alignSelf:'center' }} color={Colors.text.h1} size='large' />
237
252
  :<></>}
238
- </View>
239
- }
240
- </ScrollView>
241
- {!loading ?
242
- <View nativeID='question_actions' style={{ ...view_styles.section_footer, alignItems:undefined }}>
243
- {!poll.seconds_allowed || poll_response ?
244
- <TouchableOpacity
245
- style={{ marginRight:10, justifyContent:'center', paddingRight:20, paddingLeft:20, backgroundColor:Colors.utility.warning, borderRadius:22, borderWidth:1, borderColor:Colors.utility.warning }}
253
+ <FlatList
254
+ data={sections}
255
+ key={'poll_question_sections'}
256
+ keyExtractor={item => item}
257
+ renderItem={renderSections}
258
+ />
259
+ </View>
260
+ <View nativeID='question_actions' type='footer' style={{ flexDirection:'row', padding:12, borderBottomLeftRadius:22, borderBottomRightRadius:22 }}>
261
+ {poll && (!poll.seconds_allowed || poll_response) ?
262
+ <Button
263
+ style={{ marginRight:10, justifyContent:'center', padding:15, backgroundColor:Colors.text.warning, borderRadius:22, borderWidth:1, borderColor:Colors.text.warning }}
246
264
  onPress={() => handleCancel()}
247
265
  >
248
- <Icons.ListIcon size={18} color={Colors.shades.white} />
249
- </TouchableOpacity>
266
+ <Icons.ListIcon size={16} color={Colors.text.white} />
267
+ </Button>
250
268
  :<></>}
251
- {poll.status == 'active' && poll.seconds_allowed && !poll_response ?
269
+ {poll &&poll.status == 'active' && poll.seconds_allowed && !poll_response ?
252
270
  <View style={{ marginRight:5 }}>
253
271
  <ResponseTimer
254
272
  poll_id={poll.poll_id}
@@ -258,30 +276,23 @@ const PollCard = ({ poll_id, poll_response, action_loading, onSkip, onCancel, on
258
276
  </View>
259
277
  :
260
278
  <Button
261
- style={{flex:1, marginRight:5}}
262
- title_color={Colors.brand.electric}
279
+ style={{flex:1, marginRight:5, padding:15}}
280
+ type='action'
263
281
  title={poll_response?'Next':'Skip'}
264
- borderColor={Colors.brand.electric}
265
- backgroundColor={Colors.shades.white}
266
- borderRadius={22}
267
- borderWidth={1}
268
- padding={14}
269
282
  onPress={() => handleSkip()}
270
283
  />
271
284
  }
272
- {!poll_response ?
285
+ {poll && !poll_response && !loading ?
273
286
  <Button
274
- style={{flex:2}}
275
- title_color={Colors.shades.white}
287
+ style={{flex:2, padding:15, opacity: selected_option && !action_loading ? 1 : 0.5}}
288
+ loading={action_loading}
276
289
  disabled={selected_option&&!action_loading?false:true}
290
+ type='success'
277
291
  title={selected_option?`Submit!`:poll.status == 'active' ? 'Select Answer' : 'Not Active'}
278
- backgroundColor={selected_option&&!action_loading?Colors.utility.success:Colors.brand.slate}
279
- borderRadius={22}
280
292
  onPress={() => handleSubmitResponse()}
281
293
  />
282
294
  :<></>}
283
295
  </View>
284
- :<></>}
285
296
  </View>
286
297
 
287
298
  )
@@ -1,8 +1,9 @@
1
1
  import React, { useState } from "react";
2
- import { TextInput, TouchableOpacity, View } from "react-native"
2
+ import { TextInput } from "react-native"
3
3
  import type { PollOptionProps, PollResponseProps, PollSummaryProps } from "../../types";
4
- import Colors from "../../constants/colors";
5
- import { Button, Icons, Text } from "../../Components";
4
+ import { Icons } from "../../Components";
5
+ import { useColors } from "../../constants/useColors";
6
+ import { Button, Text, View } from "../../Components/Themed";
6
7
 
7
8
  type PollOptionCardProps = {
8
9
  poll_option:PollOptionProps,
@@ -14,16 +15,17 @@ type PollOptionCardProps = {
14
15
  onSelect: (PollOptionProps: PollOptionProps) => void
15
16
  }
16
17
  const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary, show_summary, onSelect, poll_response } : PollOptionCardProps) => {
18
+ const Colors = useColors();
17
19
  const [ option_width, setOptionWidth ] = useState(0);
18
20
  const [ input_locked, setInputLocked ] = useState(false);
19
21
  const [ input_value, setInputValue ] = useState('');
20
22
 
21
23
  const getResultColor = (result_ind?:'win'|'lose'|'draw') => {
22
24
  switch(result_ind){
23
- case 'win': return Colors.utility.success
24
- case 'lose': return Colors.utility.error
25
- case 'draw': return Colors.utility.warning
26
- default: return Colors.brand.slate
25
+ case 'win': return Colors.text.success
26
+ case 'lose': return Colors.text.error
27
+ case 'draw': return Colors.text.warning
28
+ default: return Colors.text.h1
27
29
  }
28
30
  }
29
31
 
@@ -41,39 +43,38 @@ const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary
41
43
  return (
42
44
  <View>
43
45
  {poll_option.option_type == 'select' ?
44
- <TouchableOpacity
45
- style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:show_result?getResultColor(poll_option.result_ind):Colors.shades.shade600, backgroundColor:draft_selected?Colors.highlights.highlight500Faded:undefined }}
46
+ <Button
47
+ style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:show_result?getResultColor(poll_option.result_ind):Colors.borders.light, backgroundColor:draft_selected?Colors.absolutes.highlights.highlight500Faded:undefined }}
46
48
  onPress={() => onSelect(poll_option)}
47
49
  onLayout={(ev) => {
48
50
  const { width } = ev.nativeEvent.layout
49
51
  setOptionWidth(width)
50
52
  }}
51
53
  >
52
- <Text style={{ flex:1 }} textAlign="center" size={14} color={show_result?getResultColor(poll_option.result_ind):Colors.brand.midnight} weight='bold'>{poll_option.option_name}</Text>
54
+ <Text style={{ flex:1 }} textAlign="center" size={14} color={show_result?getResultColor(poll_option.result_ind):Colors.text.h1} weight='bold'>{poll_option.option_name}</Text>
53
55
  {show_result && poll_option.result_ind ?
54
- <View>
56
+ <View transparent>
55
57
  {getResultIcon(poll_option.result_ind)}
56
58
  </View>
57
59
  :<></>}
58
60
  {show_summary && poll_summary?
59
- <View style={{ position: 'absolute', left:0, top:0, bottom:0, width:poll_summary.pct*option_width, borderRadius:22, backgroundColor:Colors.highlights.highlight400Faded }} />
61
+ <View transparent style={{ position: 'absolute', left:0, top:0, bottom:0, width:poll_summary.pct*option_width, borderRadius:22, backgroundColor:Colors.absolutes.highlights.highlight400Faded }} />
60
62
  :<></>}
61
63
  {show_summary && poll_summary ?
62
- <View style={{ position:'absolute', right:5, top:0, bottom:0, justifyContent:'center' }}>
63
- <Text weight='regular' size={10} color={Colors.brand.midnight}>{(poll_summary.pct * 100).toFixed(2)}%</Text>
64
+ <View transparent style={{ position:'absolute', right:5, top:0, bottom:0, justifyContent:'center' }}>
65
+ <Text weight='regular' size={10} color={Colors.text.h1}>{(poll_summary.pct * 100).toFixed(2)}%</Text>
64
66
  </View>
65
67
  :<></>}
66
- </TouchableOpacity>
68
+ </Button>
67
69
  :
68
70
  <View style={{ flexDirection:'row' }}>
69
- <View style={{ flex:1, flexDirection:'row', alignItems:'center', paddingRight:10, borderRadius:22, borderWidth: 1, borderColor: show_result?getResultColor(poll_response?.result_ind):Colors.shades.shade600 }}>
71
+ <View style={{ flex:1, flexDirection:'row', alignItems:'center', paddingRight:10, borderRadius:22, borderWidth: 1, borderColor: show_result?getResultColor(poll_response?.result_ind):Colors.borders.light }}>
70
72
  <TextInput
71
73
  style={{ flex:1, textAlign:'center', fontSize:14, padding:10, color:getResultColor(poll_response?.result_ind) }}
72
74
  keyboardType={poll_option.input_type == 'number' ? 'decimal-pad' : 'default'}
73
75
  editable={show_result?false:true}
74
76
  placeholder="Input Answer"
75
77
  value={poll_response ? poll_response.input_value : input_value}
76
- placeholderTextColor={Colors.shades.shade600}
77
78
  onChangeText={(text) => {
78
79
  if(draft_selected){ onSelect(poll_option) }
79
80
  setInputValue(text)
@@ -88,11 +89,9 @@ const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary
88
89
  </View>
89
90
  {!show_result ?
90
91
  <Button
91
- style={{ marginLeft:5 }}
92
- borderRadius={22}
92
+ style={{ marginLeft:5, opacity: input_locked?1:0.5 }}
93
93
  title={input_locked?'Locked In':'Lock It In'}
94
- backgroundColor={input_locked?Colors.brand.slate:Colors.brand.electric}
95
- title_color={Colors.shades.white}
94
+ type='action'
96
95
  onPress={() => {
97
96
  if(!input_value || input_value == ''){ return alert('Please enter valid value') }
98
97
  setInputLocked(true)
@@ -1,10 +1,10 @@
1
1
  import React, { useState } from 'react';
2
- import { View, TouchableOpacity, FlatList } from "react-native"
2
+ import { FlatList } from "react-native"
3
3
  import type { PollCampaignProps, PollProps, PollResponseProps } from "../../types"
4
- import { view_styles } from '../../constants/styles';
5
- import { Icons, Text } from '../../Components';
6
- import Colors from '../../constants/colors';
4
+ import { Icons } from '../../Components';
7
5
  import PollSelectCard from './PollSelectCard';
6
+ import { Button, Text, View } from '../../Components/Themed';
7
+ import { useColors } from '../../constants/useColors';
8
8
 
9
9
  type PollQuestionsSectionProps = {
10
10
  poll_campaign:PollCampaignProps,
@@ -14,6 +14,7 @@ type PollQuestionsSectionProps = {
14
14
  }
15
15
 
16
16
  const PollQuestionsSection = ({ poll_campaign, polls, poll_responses, onSelectPoll }:PollQuestionsSectionProps) => {
17
+ const Colors = useColors();
17
18
  const [ section_data, setSectionData ] = useState<{
18
19
  loading:boolean,
19
20
  expanded:boolean,
@@ -28,7 +29,7 @@ const PollQuestionsSection = ({ poll_campaign, polls, poll_responses, onSelectPo
28
29
  const my_response = poll_responses.find(r => r.poll_id == data.item.poll_id)
29
30
  const response_option = data.item.poll_options?.find(po => po.poll_option_id == my_response?.poll_option_id);
30
31
  return (
31
- <View style={{ borderBottomWidth:1, borderBottomColor:Colors.shades.shade600 }}>
32
+ <View transparent style={{ borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
32
33
  <PollSelectCard
33
34
  poll={data.item}
34
35
  disabled={false}
@@ -44,17 +45,17 @@ const PollQuestionsSection = ({ poll_campaign, polls, poll_responses, onSelectPo
44
45
  }
45
46
 
46
47
  return (
47
- <View style={{ ...view_styles.section }}>
48
- <TouchableOpacity style={{ ...view_styles.section_header }} onPress={() => setSectionData({ ...section_data, expanded: !expanded })}>
49
- <Icons.QuestionIcon size={18} color={Colors.brand.midnight} />
50
- <View style={{flex:1, marginLeft:10}}>
51
- <Text theme='header'>Questions</Text>
52
- <Text style={{ marginTop:3 }} theme='body'>Available questions can be found below</Text>
48
+ <View float>
49
+ <Button style={{ flexDirection:'row', alignItems:'center', padding:20, backgroundColor:Colors.views.header }} onPress={() => setSectionData({ ...section_data, expanded: !expanded })}>
50
+ <Icons.QuestionIcon size={18} color={Colors.text.h1} />
51
+ <View transparent style={{flex:1, marginLeft:10}}>
52
+ <Text theme='h1'>Questions</Text>
53
+ <Text style={{ marginTop:3 }} theme='description'>Available questions can be found below</Text>
53
54
  </View>
54
- <Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.brand.midnight} size={8} />
55
- </TouchableOpacity>
55
+ <Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.text.h1} size={8} />
56
+ </Button>
56
57
  {expanded ?
57
- <View style={{ ...view_styles.section_body }}>
58
+ <View transparent type='body' style={{ padding:10 }}>
58
59
  <FlatList
59
60
  data={polls.sort((a,b) => a.priority - b.priority)}
60
61
  renderItem={renderPolls}