be-components 0.7.3 → 0.7.5

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 (450) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +18 -0
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Authenticator/Components/AuthStrategyIdentifier.js +113 -0
  4. package/lib/commonjs/Authenticator/Components/AuthStrategyIdentifier.js.map +1 -0
  5. package/lib/commonjs/Authenticator/Components/StrategyForm.js +238 -71
  6. package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
  7. package/lib/commonjs/Authenticator/index.js +7 -4
  8. package/lib/commonjs/Authenticator/index.js.map +1 -1
  9. package/lib/commonjs/Checkout/api/index.js.map +1 -1
  10. package/lib/commonjs/Checkout/index.js.map +1 -1
  11. package/lib/commonjs/Competition/api/index.js +655 -0
  12. package/lib/commonjs/Competition/api/index.js.map +1 -0
  13. package/lib/commonjs/Competition/components/AthleteMarketCard.js +168 -0
  14. package/lib/commonjs/Competition/components/AthleteMarketCard.js.map +1 -0
  15. package/lib/commonjs/Competition/components/CompetitionCard.js +180 -0
  16. package/lib/commonjs/Competition/components/CompetitionCard.js.map +1 -0
  17. package/lib/commonjs/Competition/components/CompetitionInfoCard.js +264 -0
  18. package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -0
  19. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +281 -0
  20. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -0
  21. package/lib/commonjs/Competition/components/CompetitionPlay.js +1269 -0
  22. package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -0
  23. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +111 -0
  24. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -0
  25. package/lib/commonjs/Competition/components/CompetitionSelector.js +122 -0
  26. package/lib/commonjs/Competition/components/CompetitionSelector.js.map +1 -0
  27. package/lib/commonjs/Competition/components/CompetitionTypeCard.js +380 -0
  28. package/lib/commonjs/Competition/components/CompetitionTypeCard.js.map +1 -0
  29. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +237 -0
  30. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -0
  31. package/lib/commonjs/Competition/components/LeaderPicks.js +322 -0
  32. package/lib/commonjs/Competition/components/LeaderPicks.js.map +1 -0
  33. package/lib/commonjs/Competition/components/ManageSeasonForm.js +605 -0
  34. package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +1 -0
  35. package/lib/commonjs/Competition/components/MarketsCard.js +148 -0
  36. package/lib/commonjs/Competition/components/MarketsCard.js.map +1 -0
  37. package/lib/commonjs/Competition/components/MatchMarketCard.js +199 -0
  38. package/lib/commonjs/Competition/components/MatchMarketCard.js.map +1 -0
  39. package/lib/commonjs/Competition/components/NavOutPrompt.js +159 -0
  40. package/lib/commonjs/Competition/components/NavOutPrompt.js.map +1 -0
  41. package/lib/commonjs/Competition/components/SeasonInfoModal.js +400 -0
  42. package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +1 -0
  43. package/lib/commonjs/Competition/components/TeamEventCard.js +217 -0
  44. package/lib/commonjs/Competition/components/TeamEventCard.js.map +1 -0
  45. package/lib/commonjs/Competition/components/WagerPickForm.js +278 -0
  46. package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -0
  47. package/lib/commonjs/Competition/index.js +42 -0
  48. package/lib/commonjs/Competition/index.js.map +1 -0
  49. package/lib/commonjs/Components/Icons.js.map +1 -1
  50. package/lib/commonjs/Components/Jerseys.js +713 -0
  51. package/lib/commonjs/Components/Jerseys.js.map +1 -0
  52. package/lib/commonjs/Components/LinearDiagnal.js +1 -1
  53. package/lib/commonjs/Components/LinearDiagnal.js.map +1 -1
  54. package/lib/commonjs/Components/Switch.js +81 -0
  55. package/lib/commonjs/Components/Switch.js.map +1 -0
  56. package/lib/commonjs/Components/index.js +14 -0
  57. package/lib/commonjs/Components/index.js.map +1 -1
  58. package/lib/commonjs/Poll/api/index.js +277 -0
  59. package/lib/commonjs/Poll/api/index.js.map +1 -0
  60. package/lib/commonjs/Poll/components/CampaignPlay.js +553 -0
  61. package/lib/commonjs/Poll/components/CampaignPlay.js.map +1 -0
  62. package/lib/commonjs/Poll/components/CampaignProgressBar.js +118 -0
  63. package/lib/commonjs/Poll/components/CampaignProgressBar.js.map +1 -0
  64. package/lib/commonjs/Poll/components/CampaignResult.js +382 -0
  65. package/lib/commonjs/Poll/components/CampaignResult.js.map +1 -0
  66. package/lib/commonjs/Poll/components/CampaignSelector.js +124 -0
  67. package/lib/commonjs/Poll/components/CampaignSelector.js.map +1 -0
  68. package/lib/commonjs/Poll/components/PollCampaignCard.js +66 -0
  69. package/lib/commonjs/Poll/components/PollCampaignCard.js.map +1 -0
  70. package/lib/commonjs/Poll/components/PollCard.js +480 -0
  71. package/lib/commonjs/Poll/components/PollCard.js.map +1 -0
  72. package/lib/commonjs/Poll/components/PollOptionCard.js +158 -0
  73. package/lib/commonjs/Poll/components/PollOptionCard.js.map +1 -0
  74. package/lib/commonjs/Poll/components/PollSelectCard.js +189 -0
  75. package/lib/commonjs/Poll/components/PollSelectCard.js.map +1 -0
  76. package/lib/commonjs/Poll/components/ResponseTimer.js +48 -0
  77. package/lib/commonjs/Poll/components/ResponseTimer.js.map +1 -0
  78. package/lib/commonjs/Poll/components/WidgetHeader.js +83 -0
  79. package/lib/commonjs/Poll/components/WidgetHeader.js.map +1 -0
  80. package/lib/commonjs/Poll/flashmarket/index.js +354 -0
  81. package/lib/commonjs/Poll/flashmarket/index.js.map +1 -0
  82. package/lib/commonjs/Poll/index.js +46 -0
  83. package/lib/commonjs/Poll/index.js.map +1 -0
  84. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  85. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  86. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +3 -1
  87. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  88. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  89. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  90. package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
  91. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  92. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  93. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  94. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +5 -0
  95. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  96. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  97. package/lib/commonjs/ProfileManager/index.js +2 -0
  98. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  99. package/lib/commonjs/Wallet/api/index.js +4 -1
  100. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  101. package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -1
  102. package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -1
  103. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
  104. package/lib/commonjs/Wallet/components/FundAccountCard.js.map +1 -1
  105. package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -1
  106. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -1
  107. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -1
  108. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -1
  109. package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
  110. package/lib/commonjs/Wallet/components/WalletSettings.js.map +1 -1
  111. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
  112. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
  113. package/lib/commonjs/Wallet/index.js.map +1 -1
  114. package/lib/commonjs/index.js +14 -0
  115. package/lib/commonjs/index.js.map +1 -1
  116. package/lib/module/ApiOverrides/index.js +18 -0
  117. package/lib/module/ApiOverrides/index.js.map +1 -1
  118. package/lib/module/Authenticator/Components/AuthStrategyIdentifier.js +106 -0
  119. package/lib/module/Authenticator/Components/AuthStrategyIdentifier.js.map +1 -0
  120. package/lib/module/Authenticator/Components/StrategyForm.js +239 -72
  121. package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
  122. package/lib/module/Authenticator/index.js +7 -4
  123. package/lib/module/Authenticator/index.js.map +1 -1
  124. package/lib/module/Checkout/api/index.js.map +1 -1
  125. package/lib/module/Checkout/index.js.map +1 -1
  126. package/lib/module/Competition/api/index.js +649 -0
  127. package/lib/module/Competition/api/index.js.map +1 -0
  128. package/lib/module/Competition/components/AthleteMarketCard.js +161 -0
  129. package/lib/module/Competition/components/AthleteMarketCard.js.map +1 -0
  130. package/lib/module/Competition/components/CompetitionCard.js +173 -0
  131. package/lib/module/Competition/components/CompetitionCard.js.map +1 -0
  132. package/lib/module/Competition/components/CompetitionInfoCard.js +257 -0
  133. package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -0
  134. package/lib/module/Competition/components/CompetitionLeaderboard.js +272 -0
  135. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -0
  136. package/lib/module/Competition/components/CompetitionPlay.js +1260 -0
  137. package/lib/module/Competition/components/CompetitionPlay.js.map +1 -0
  138. package/lib/module/Competition/components/CompetitionSeasonCard.js +104 -0
  139. package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -0
  140. package/lib/module/Competition/components/CompetitionSelector.js +113 -0
  141. package/lib/module/Competition/components/CompetitionSelector.js.map +1 -0
  142. package/lib/module/Competition/components/CompetitionTypeCard.js +371 -0
  143. package/lib/module/Competition/components/CompetitionTypeCard.js.map +1 -0
  144. package/lib/module/Competition/components/EnterCompetitionPrompt.js +228 -0
  145. package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -0
  146. package/lib/module/Competition/components/LeaderPicks.js +313 -0
  147. package/lib/module/Competition/components/LeaderPicks.js.map +1 -0
  148. package/lib/module/Competition/components/ManageSeasonForm.js +596 -0
  149. package/lib/module/Competition/components/ManageSeasonForm.js.map +1 -0
  150. package/lib/module/Competition/components/MarketsCard.js +139 -0
  151. package/lib/module/Competition/components/MarketsCard.js.map +1 -0
  152. package/lib/module/Competition/components/MatchMarketCard.js +192 -0
  153. package/lib/module/Competition/components/MatchMarketCard.js.map +1 -0
  154. package/lib/module/Competition/components/NavOutPrompt.js +152 -0
  155. package/lib/module/Competition/components/NavOutPrompt.js.map +1 -0
  156. package/lib/module/Competition/components/SeasonInfoModal.js +391 -0
  157. package/lib/module/Competition/components/SeasonInfoModal.js.map +1 -0
  158. package/lib/module/Competition/components/TeamEventCard.js +210 -0
  159. package/lib/module/Competition/components/TeamEventCard.js.map +1 -0
  160. package/lib/module/Competition/components/WagerPickForm.js +269 -0
  161. package/lib/module/Competition/components/WagerPickForm.js.map +1 -0
  162. package/lib/module/Competition/index.js +33 -0
  163. package/lib/module/Competition/index.js.map +1 -0
  164. package/lib/module/Components/Icons.js.map +1 -1
  165. package/lib/module/Components/Jerseys.js +705 -0
  166. package/lib/module/Components/Jerseys.js.map +1 -0
  167. package/lib/module/Components/LinearDiagnal.js +2 -3
  168. package/lib/module/Components/LinearDiagnal.js.map +1 -1
  169. package/lib/module/Components/Switch.js +74 -0
  170. package/lib/module/Components/Switch.js.map +1 -0
  171. package/lib/module/Components/index.js +3 -1
  172. package/lib/module/Components/index.js.map +1 -1
  173. package/lib/module/Poll/api/index.js +271 -0
  174. package/lib/module/Poll/api/index.js.map +1 -0
  175. package/lib/module/Poll/components/CampaignPlay.js +545 -0
  176. package/lib/module/Poll/components/CampaignPlay.js.map +1 -0
  177. package/lib/module/Poll/components/CampaignProgressBar.js +110 -0
  178. package/lib/module/Poll/components/CampaignProgressBar.js.map +1 -0
  179. package/lib/module/Poll/components/CampaignResult.js +374 -0
  180. package/lib/module/Poll/components/CampaignResult.js.map +1 -0
  181. package/lib/module/Poll/components/CampaignSelector.js +115 -0
  182. package/lib/module/Poll/components/CampaignSelector.js.map +1 -0
  183. package/lib/module/Poll/components/PollCampaignCard.js +59 -0
  184. package/lib/module/Poll/components/PollCampaignCard.js.map +1 -0
  185. package/lib/module/Poll/components/PollCard.js +472 -0
  186. package/lib/module/Poll/components/PollCard.js.map +1 -0
  187. package/lib/module/Poll/components/PollOptionCard.js +149 -0
  188. package/lib/module/Poll/components/PollOptionCard.js.map +1 -0
  189. package/lib/module/Poll/components/PollSelectCard.js +182 -0
  190. package/lib/module/Poll/components/PollSelectCard.js.map +1 -0
  191. package/lib/module/Poll/components/ResponseTimer.js +39 -0
  192. package/lib/module/Poll/components/ResponseTimer.js.map +1 -0
  193. package/lib/module/Poll/components/WidgetHeader.js +76 -0
  194. package/lib/module/Poll/components/WidgetHeader.js.map +1 -0
  195. package/lib/module/Poll/flashmarket/index.js +345 -0
  196. package/lib/module/Poll/flashmarket/index.js.map +1 -0
  197. package/lib/module/Poll/index.js +37 -0
  198. package/lib/module/Poll/index.js.map +1 -0
  199. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  200. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  201. package/lib/module/ProfileManager/Components/CodeRedeem.js +3 -1
  202. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  203. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  204. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  205. package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
  206. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  207. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  208. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  209. package/lib/module/ProfileManager/Components/ProfileWizard.js +5 -0
  210. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  211. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  212. package/lib/module/ProfileManager/index.js +2 -0
  213. package/lib/module/ProfileManager/index.js.map +1 -1
  214. package/lib/module/Wallet/api/index.js +4 -1
  215. package/lib/module/Wallet/api/index.js.map +1 -1
  216. package/lib/module/Wallet/components/ACHAddCard.js.map +1 -1
  217. package/lib/module/Wallet/components/AddressManager.js.map +1 -1
  218. package/lib/module/Wallet/components/DepositCard.js.map +1 -1
  219. package/lib/module/Wallet/components/FundAccountCard.js.map +1 -1
  220. package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -1
  221. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -1
  222. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -1
  223. package/lib/module/Wallet/components/MyBalance.js.map +1 -1
  224. package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
  225. package/lib/module/Wallet/components/WalletSettings.js.map +1 -1
  226. package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
  227. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
  228. package/lib/module/Wallet/index.js.map +1 -1
  229. package/lib/module/index.js +3 -1
  230. package/lib/module/index.js.map +1 -1
  231. package/lib/typescript/src/ApiOverrides/index.d.ts +1 -0
  232. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  233. package/lib/typescript/src/Authenticator/Components/AuthStrategyIdentifier.d.ts +11 -0
  234. package/lib/typescript/src/Authenticator/Components/AuthStrategyIdentifier.d.ts.map +1 -0
  235. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts +4 -1
  236. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  237. package/lib/typescript/src/Authenticator/api/index.d.ts +2 -2
  238. package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
  239. package/lib/typescript/src/Authenticator/index.d.ts +2 -1
  240. package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
  241. package/lib/typescript/src/Checkout/api/index.d.ts +1 -2
  242. package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -1
  243. package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
  244. package/lib/typescript/src/Competition/api/index.d.ts +128 -0
  245. package/lib/typescript/src/Competition/api/index.d.ts.map +1 -0
  246. package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts +19 -0
  247. package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts.map +1 -0
  248. package/lib/typescript/src/Competition/components/CompetitionCard.d.ts +12 -0
  249. package/lib/typescript/src/Competition/components/CompetitionCard.d.ts.map +1 -0
  250. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts +16 -0
  251. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -0
  252. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts +14 -0
  253. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -0
  254. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts +20 -0
  255. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts.map +1 -0
  256. package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts +10 -0
  257. package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts.map +1 -0
  258. package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts +11 -0
  259. package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts.map +1 -0
  260. package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts +14 -0
  261. package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts.map +1 -0
  262. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +16 -0
  263. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -0
  264. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts +22 -0
  265. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts.map +1 -0
  266. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +10 -0
  267. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +1 -0
  268. package/lib/typescript/src/Competition/components/MarketsCard.d.ts +15 -0
  269. package/lib/typescript/src/Competition/components/MarketsCard.d.ts.map +1 -0
  270. package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts +21 -0
  271. package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts.map +1 -0
  272. package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts +23 -0
  273. package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts.map +1 -0
  274. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +14 -0
  275. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +1 -0
  276. package/lib/typescript/src/Competition/components/TeamEventCard.d.ts +17 -0
  277. package/lib/typescript/src/Competition/components/TeamEventCard.d.ts.map +1 -0
  278. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +15 -0
  279. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -0
  280. package/lib/typescript/src/Competition/index.d.ts +11 -0
  281. package/lib/typescript/src/Competition/index.d.ts.map +1 -0
  282. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  283. package/lib/typescript/src/Components/Jerseys.d.ts +16 -0
  284. package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -0
  285. package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -1
  286. package/lib/typescript/src/Components/Switch.d.ts +9 -0
  287. package/lib/typescript/src/Components/Switch.d.ts.map +1 -0
  288. package/lib/typescript/src/Components/index.d.ts +3 -1
  289. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  290. package/lib/typescript/src/Poll/api/index.d.ts +65 -0
  291. package/lib/typescript/src/Poll/api/index.d.ts.map +1 -0
  292. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts +14 -0
  293. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts.map +1 -0
  294. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts +12 -0
  295. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts.map +1 -0
  296. package/lib/typescript/src/Poll/components/CampaignResult.d.ts +13 -0
  297. package/lib/typescript/src/Poll/components/CampaignResult.d.ts.map +1 -0
  298. package/lib/typescript/src/Poll/components/CampaignSelector.d.ts +9 -0
  299. package/lib/typescript/src/Poll/components/CampaignSelector.d.ts.map +1 -0
  300. package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts +10 -0
  301. package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts.map +1 -0
  302. package/lib/typescript/src/Poll/components/PollCard.d.ts +16 -0
  303. package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -0
  304. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts +14 -0
  305. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts.map +1 -0
  306. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts +16 -0
  307. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts.map +1 -0
  308. package/lib/typescript/src/Poll/components/ResponseTimer.d.ts +9 -0
  309. package/lib/typescript/src/Poll/components/ResponseTimer.d.ts.map +1 -0
  310. package/lib/typescript/src/Poll/components/WidgetHeader.d.ts +13 -0
  311. package/lib/typescript/src/Poll/components/WidgetHeader.d.ts.map +1 -0
  312. package/lib/typescript/src/Poll/flashmarket/index.d.ts +10 -0
  313. package/lib/typescript/src/Poll/flashmarket/index.d.ts.map +1 -0
  314. package/lib/typescript/src/Poll/index.d.ts +13 -0
  315. package/lib/typescript/src/Poll/index.d.ts.map +1 -0
  316. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts +1 -1
  317. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  318. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +1 -2
  319. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  320. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts +9 -2
  321. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  322. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts +1 -1
  323. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  324. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts +1 -1
  325. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  326. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts +1 -1
  327. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  328. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts +1 -1
  329. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  330. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +1 -1
  331. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  332. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +1 -2
  333. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  334. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +10 -3
  335. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  336. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts +2 -2
  337. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
  338. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts +1 -2
  339. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  340. package/lib/typescript/src/ProfileManager/api/index.d.ts +2 -2
  341. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  342. package/lib/typescript/src/ProfileManager/index.d.ts +9 -2
  343. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  344. package/lib/typescript/src/Wallet/api/index.d.ts +2 -3
  345. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  346. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts +1 -2
  347. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -1
  348. package/lib/typescript/src/Wallet/components/AddressManager.d.ts +1 -2
  349. package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -1
  350. package/lib/typescript/src/Wallet/components/DepositCard.d.ts +1 -2
  351. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
  352. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts +1 -2
  353. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts.map +1 -1
  354. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +1 -2
  355. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -1
  356. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +1 -2
  357. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  358. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +1 -2
  359. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -1
  360. package/lib/typescript/src/Wallet/components/MyBalance.d.ts +1 -2
  361. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -1
  362. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts +1 -2
  363. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  364. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts +1 -2
  365. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts.map +1 -1
  366. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +1 -2
  367. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
  368. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +1 -2
  369. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -1
  370. package/lib/typescript/src/Wallet/index.d.ts +1 -2
  371. package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
  372. package/lib/typescript/src/index.d.ts +3 -1
  373. package/lib/typescript/src/index.d.ts.map +1 -1
  374. package/package.json +1 -1
  375. package/src/ApiOverrides/index.ts +19 -0
  376. package/src/Authenticator/Components/AuthStrategyIdentifier.tsx +72 -0
  377. package/src/Authenticator/Components/StrategyForm.tsx +208 -53
  378. package/src/Authenticator/api/index.ts +2 -2
  379. package/src/Authenticator/api/types.d.ts +3 -26
  380. package/src/Authenticator/index.tsx +10 -4
  381. package/src/Checkout/api/index.tsx +1 -2
  382. package/src/Checkout/index.tsx +1 -2
  383. package/src/Competition/api/index.ts +568 -0
  384. package/src/Competition/components/AthleteMarketCard.tsx +116 -0
  385. package/src/Competition/components/CompetitionCard.tsx +82 -0
  386. package/src/Competition/components/CompetitionInfoCard.tsx +149 -0
  387. package/src/Competition/components/CompetitionLeaderboard.tsx +183 -0
  388. package/src/Competition/components/CompetitionPlay.tsx +936 -0
  389. package/src/Competition/components/CompetitionSeasonCard.tsx +48 -0
  390. package/src/Competition/components/CompetitionSelector.tsx +91 -0
  391. package/src/Competition/components/CompetitionTypeCard.tsx +211 -0
  392. package/src/Competition/components/EnterCompetitionPrompt.tsx +127 -0
  393. package/src/Competition/components/LeaderPicks.tsx +214 -0
  394. package/src/Competition/components/ManageSeasonForm.tsx +271 -0
  395. package/src/Competition/components/MarketsCard.tsx +108 -0
  396. package/src/Competition/components/MatchMarketCard.tsx +126 -0
  397. package/src/Competition/components/NavOutPrompt.tsx +87 -0
  398. package/src/Competition/components/SeasonInfoModal.tsx +212 -0
  399. package/src/Competition/components/TeamEventCard.tsx +136 -0
  400. package/src/Competition/components/WagerPickForm.tsx +114 -0
  401. package/src/Competition/index.tsx +36 -0
  402. package/src/Components/Icons.tsx +0 -2
  403. package/src/Components/Jerseys.tsx +268 -0
  404. package/src/Components/LinearDiagnal.tsx +2 -3
  405. package/src/Components/Switch.tsx +55 -0
  406. package/src/Components/index.tsx +5 -1
  407. package/src/Poll/api/index.ts +212 -0
  408. package/src/Poll/components/CampaignPlay.tsx +407 -0
  409. package/src/Poll/components/CampaignProgressBar.tsx +70 -0
  410. package/src/Poll/components/CampaignResult.tsx +180 -0
  411. package/src/Poll/components/CampaignSelector.tsx +96 -0
  412. package/src/Poll/components/PollCampaignCard.tsx +35 -0
  413. package/src/Poll/components/PollCard.tsx +335 -0
  414. package/src/Poll/components/PollOptionCard.tsx +110 -0
  415. package/src/Poll/components/PollSelectCard.tsx +106 -0
  416. package/src/Poll/components/ResponseTimer.tsx +37 -0
  417. package/src/Poll/components/WidgetHeader.tsx +46 -0
  418. package/src/Poll/flashmarket/index.tsx +231 -0
  419. package/src/Poll/index.tsx +45 -0
  420. package/src/ProfileManager/Components/BasicInfoManager.tsx +1 -1
  421. package/src/ProfileManager/Components/BasicStatus.tsx +1 -2
  422. package/src/ProfileManager/Components/CodeRedeem.tsx +10 -3
  423. package/src/ProfileManager/Components/DOBManager.tsx +1 -1
  424. package/src/ProfileManager/Components/EmailManager.tsx +1 -1
  425. package/src/ProfileManager/Components/PasswordManager.tsx +2 -1
  426. package/src/ProfileManager/Components/PhoneManager.tsx +1 -1
  427. package/src/ProfileManager/Components/ProfilePicManager.tsx +1 -1
  428. package/src/ProfileManager/Components/ProfileWelcome.tsx +1 -2
  429. package/src/ProfileManager/Components/ProfileWizard.tsx +14 -3
  430. package/src/ProfileManager/Components/SettingsManager.tsx +2 -2
  431. package/src/ProfileManager/Components/VouchCard.tsx +1 -2
  432. package/src/ProfileManager/api/index.ts +2 -2
  433. package/src/ProfileManager/api/types.d.ts +0 -35
  434. package/src/ProfileManager/index.tsx +11 -3
  435. package/src/Wallet/api/index.ts +6 -4
  436. package/src/Wallet/components/ACHAddCard.tsx +1 -2
  437. package/src/Wallet/components/AddressManager.tsx +1 -2
  438. package/src/Wallet/components/DepositCard.tsx +1 -2
  439. package/src/Wallet/components/FundAccountCard.tsx +1 -2
  440. package/src/Wallet/components/ManageAccountCard.tsx +1 -2
  441. package/src/Wallet/components/ManualACHAdd.tsx +1 -2
  442. package/src/Wallet/components/ManualCardAdd.tsx +1 -2
  443. package/src/Wallet/components/MyBalance.tsx +1 -2
  444. package/src/Wallet/components/WalletActionSelector.tsx +1 -2
  445. package/src/Wallet/components/WalletSettings.tsx +1 -2
  446. package/src/Wallet/components/WalletSetup.tsx +1 -2
  447. package/src/Wallet/components/WithdrawCard.tsx +1 -2
  448. package/src/Wallet/index.tsx +1 -2
  449. package/src/index.tsx +5 -2
  450. package/src/types.d.ts +486 -1
@@ -0,0 +1,335 @@
1
+ import React from 'react';
2
+ import { ActivityIndicator, FlatList, Image, ScrollView, TouchableOpacity, View } from 'react-native';
3
+ import { useEffect, useState } from 'react';
4
+ import PollOptionCard from './PollOptionCard';
5
+ import ResponseTimer from './ResponseTimer';
6
+ import type { PollOptionProps, PollProps, PollResponseProps, PollSummaryProps } from '../../types';
7
+ import { PollApi, PollResponseApi } from '../api';
8
+ import { Button, Icons, Text } from '../../Components';
9
+ import Colors from '../../constants/colors';
10
+
11
+ type PollCardProps = {
12
+ poll:PollProps,
13
+ question_number?:number,
14
+ onCancel:() => void,
15
+ view?:string,
16
+ onResponse:(response:PollResponseProps) => void,
17
+ total_questions?:number,
18
+ onShowAuthenticate: () => void,
19
+ onSkip: () => void,
20
+ onSeeResults?: () => void
21
+ }
22
+
23
+ const DEFAULT_POLL_STATE = { server_checked:false, responded:false, poll_response:undefined, poll_options:[], poll_summaries:[] }
24
+
25
+ const PollCard = ({ poll, question_number, total_questions, onSkip, onCancel, onSeeResults, onResponse }: PollCardProps) => {
26
+ const [ loading, setLoading ] = useState(false);
27
+ const [ submit_loading, setSubmitLoading ] = useState(false);
28
+ const [ poll_width, setPollWidth ] = useState(0);
29
+ const [ option_selected, setOptionSelected ] = useState<undefined|PollOptionProps>(undefined);
30
+ const [ poll_data, setPollData ] = useState<{
31
+ server_checked?:boolean,
32
+ responded:boolean,
33
+ poll_response?:PollResponseProps,
34
+ poll_options:PollOptionProps[],
35
+ poll_summaries:PollSummaryProps[]
36
+ }>({
37
+ server_checked:false,
38
+ responded:false,
39
+ poll_options:[],
40
+ poll_summaries:[]
41
+ })
42
+ const { poll_options, poll_summaries, poll_response, responded, server_checked } = poll_data;
43
+ const total_responses = poll_summaries.reduce((a,b) => a + b.count, 0)
44
+
45
+ const correct_option = poll_options.find(po => po.result_ind == 'win')
46
+ const selected_option = poll_options.find(po => po.poll_option_id == poll_response?.poll_option_id)
47
+
48
+ const last_question = question_number && total_questions && question_number == total_questions ? true : false
49
+
50
+ useEffect(() => {
51
+ if(!poll){ return }
52
+ getPollFromServer(poll.poll_id)
53
+ },[poll])
54
+
55
+ const getPollFromServer = async(poll_id:string) => {
56
+ setLoading(true);
57
+ let poll_response = await PollResponseApi.getResponseByPollId(poll_id)
58
+ const pos_resp = await PollApi.getPollById(poll_id)
59
+ setPollData({
60
+ server_checked: true,
61
+ responded: poll_response ? true : false,
62
+ poll_response,
63
+ poll_options:pos_resp.poll_options,
64
+ poll_summaries: pos_resp.poll_summaries
65
+ })
66
+ setLoading(false);
67
+ }
68
+
69
+ const handleCancel = () => {
70
+ setOptionSelected(undefined)
71
+
72
+ onCancel()
73
+ }
74
+
75
+ const handleSkip = () => {
76
+ //if(!is_authenticated){ return onShowAuthenticate() }
77
+ setPollData(DEFAULT_POLL_STATE)
78
+ setOptionSelected(undefined)
79
+ if(last_question && onSeeResults){ return onSeeResults() }
80
+ onSkip()
81
+
82
+ }
83
+
84
+ const handleSubmitResponse = async() => {
85
+ //if(!is_authenticated){ return onShowAuthenticate() }
86
+ if(submit_loading){ return }
87
+ if(!poll || !server_checked || !option_selected){ return }
88
+ if(responded || poll_response){ return }
89
+ let option = poll_options.find(po => po.poll_option_id == option_selected.poll_option_id)
90
+ if(!option){ return }
91
+ //We are good to log the response!
92
+ let draft_response:PollResponseProps = {
93
+ poll_id:poll.poll_id,
94
+ poll_option_id:option.poll_option_id,
95
+ stake: poll.minimum_stake,
96
+ market_type: 'FREE',
97
+ poll_response_id: '',
98
+ player_id: '',
99
+ winnings: 0,
100
+ response_body: {},
101
+ status: 'pending',
102
+ create_datetime: '',
103
+ last_update_datetime: ''
104
+ }
105
+ if(option.option_type == 'input'){
106
+ draft_response.input_value = option_selected.option_value
107
+ }
108
+ try {
109
+ setSubmitLoading(true)
110
+ let poll_response = await PollResponseApi.createPollResponse(draft_response)
111
+ onResponse(poll_response)
112
+ setPollData({
113
+ ...poll_data,
114
+ server_checked: true,
115
+ responded: poll_response?true:false,
116
+ poll_response
117
+ })
118
+
119
+ setOptionSelected(undefined)
120
+ setSubmitLoading(false)
121
+ } catch (e) {
122
+ setSubmitLoading(false)
123
+ setOptionSelected(undefined)
124
+ }
125
+ }
126
+
127
+ const handleTimesUp = async() => {
128
+ if(option_selected){
129
+ return handleSubmitResponse()
130
+ }
131
+ if(!poll || poll.status != 'active'){ return }
132
+ if(!server_checked){ return }
133
+ if(responded){ return }
134
+ const draft_response:PollResponseProps = {
135
+ poll_id:poll.poll_id,
136
+ poll_option_id:'0',
137
+ stake: poll.minimum_stake,
138
+ market_type: 'FREE',
139
+ poll_response_id: '',
140
+ player_id: '',
141
+ winnings: 0,
142
+ timed_out: true,
143
+ response_body: {},
144
+ status: 'pending',
145
+ create_datetime: '',
146
+ last_update_datetime: ''
147
+ }
148
+ setSubmitLoading(true)
149
+ let poll_response = await PollResponseApi.createPollResponse(draft_response)
150
+ onResponse(poll_response);
151
+ setSubmitLoading(false)
152
+ setPollData({
153
+ ...poll_data,
154
+ server_checked: true,
155
+ responded: poll_response ? true : false,
156
+ poll_response
157
+ })
158
+ }
159
+
160
+ const renderPollOptions = (data: { item:PollOptionProps, index:number }) => {
161
+ const poll_summary = poll_summaries.find(ps => ps.poll_option_id == data.item.poll_option_id);
162
+ const draft_selected = option_selected?.poll_option_id == data.item.poll_option_id ? true : false;
163
+ return (
164
+ <View style={{ margin:5, flex:1 }}>
165
+ <PollOptionCard
166
+ poll_summary={poll_summary}
167
+ draft_selected={draft_selected}
168
+ poll_response={poll_response}
169
+ poll_option={data.item}
170
+ show_summary={(server_checked && responded) && poll.show_responses ? true : false}
171
+ onSelect={(poll_option) => {
172
+ if(responded){ return }
173
+ if(poll?.status !== 'active'){ return }
174
+ if(draft_selected){ setOptionSelected(undefined) }
175
+ else { setOptionSelected(poll_option)} }
176
+ }
177
+ />
178
+ </View>
179
+ )
180
+ }
181
+
182
+ if(!poll){
183
+ return <></>
184
+ }
185
+ return (
186
+ <View nativeID='poll' style={{ flex:1 }} onLayout={(ev) => {
187
+ const { width } = ev.nativeEvent.layout
188
+ setPollWidth(width)
189
+ }}>
190
+ <ScrollView style={{ flex:1 }}>
191
+ {server_checked && !responded ?
192
+ <View nativeID='question_image'>
193
+ {poll?.poll_image?.url ?
194
+ <Image
195
+ source={{ uri:poll.poll_image.url, width:poll_width, height: poll_width*0.5 }}
196
+ resizeMode='contain'
197
+ />
198
+ :<></>}
199
+ </View>
200
+ :<></>}
201
+ <View nativeID='question_details' style={{padding:20}}>
202
+ {question_number ?
203
+ <View nativeID='question_progress' style={{ marginBottom:10, flexDirection:'row' }}>
204
+ <Text style={{ flex:1 }} size={12} color={Colors.brand.midnight} weight='semibold'>Question {question_number}{total_questions?` of ${total_questions}`:''}</Text>
205
+ </View>
206
+ :<></>}
207
+ <View nativeID='question' style={{ marginBottom:10 }}>
208
+ <Text size={16} color={Colors.brand.midnight} weight='bold'>{poll.poll_question}</Text>
209
+ </View>
210
+ </View>
211
+ { poll.status == 'active' && server_checked && !responded ?
212
+ <View nativeID='question_respond_options' style={{ flex:1 }}>
213
+ <FlatList
214
+ data={poll_options.sort((a,b) => a.priority - b.priority)}
215
+ renderItem={renderPollOptions}
216
+ numColumns={2}
217
+ keyExtractor={(item) => item.poll_option_id.toString()}
218
+ />
219
+ </View>
220
+ : server_checked ?
221
+ <View nativeID='question_answer' style={{ flex:1 }}>
222
+ {selected_option ?
223
+ <View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
224
+ <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>MY SELECTED ANSWER</Text>
225
+ <PollOptionCard
226
+ show_result={true}
227
+ show_summary={false}
228
+ poll_response={poll_response}
229
+ onSelect={() => console.log('Hey')}
230
+ poll_option={selected_option}
231
+ />
232
+ </View>
233
+ : (!responded || poll_response?.timed_out) ?
234
+ <View style={{ marginBottom:10, padding:10 }}>
235
+ <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>MY SELECTED ANSWER</Text>
236
+ <View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.utility.error }}>
237
+ <Text style={{ flex:1 }} size={14} color={Colors.utility.error} textAlign='center' weight='semibold'>Timed Out</Text>
238
+ <Icons.CloseIcon color={Colors.utility.error} size={12}/>
239
+ </View>
240
+ </View>
241
+ :<></>}
242
+ {poll.poll_type == 'select' && correct_option ?
243
+ <View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
244
+ <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>CORRECT ANSWER</Text>
245
+ <PollOptionCard
246
+ show_summary={false}
247
+ show_result={true}
248
+ onSelect={() => console.log('Hey')}
249
+ poll_option={correct_option}
250
+ />
251
+ </View>
252
+ :poll.poll_type == 'input' && poll.winning_value ?
253
+ <View style={{ marginBottom:10, padding:10 }}>
254
+ <Text style={{ marginBottom:5 }} size={14} color={Colors.brand.slate} weight='semibold'>CORRECT ANSWER</Text>
255
+ <View style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:22, borderWidth:1, borderColor:Colors.utility.success }}>
256
+ <Text style={{ flex:1 }} size={14} color={Colors.utility.success} textAlign='center' weight='semibold'>{poll.winning_value}</Text>
257
+ <Icons.CheckIcon color={Colors.utility.success} size={12}/>
258
+ </View>
259
+ </View>
260
+ :<></>}
261
+ {poll.poll_type == 'select' ?
262
+ <View nativeID='option_results' style={{ backgroundColor:Colors.shades.shade100, padding:10, borderRadius:8 }}>
263
+ <View style={{ flexDirection:'row', alignItems:'center', marginBottom:5 }}>
264
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.slate} weight='semibold'>PUBLIC RESULTS</Text>
265
+ <View style={{ borderRadius:22, padding:10, backgroundColor:Colors.accents.accent100 }}>
266
+ <Text size={14} color={Colors.brand.midnight} weight='regular'>{total_responses} Responses</Text>
267
+ </View>
268
+ </View>
269
+ {!poll.show_responses ?
270
+ <Text style={{ marginBottom:5 }} color={Colors.utility.warning} size={12} >Responses are hidden until closed</Text>
271
+ :<></>}
272
+ <FlatList
273
+ data={poll_options}
274
+ renderItem={renderPollOptions}
275
+ keyExtractor={(item) => item.poll_option_id.toString()}
276
+ />
277
+ </View>
278
+ :<></>}
279
+ </View>
280
+ :
281
+ <View style={{ padding:20 }}>
282
+ <ActivityIndicator color={Colors.brand.midnight} size='large' style={{ alignSelf:'center' }}/>
283
+ </View>
284
+ }
285
+ </ScrollView>
286
+ {!loading ?
287
+ <View nativeID='question_actions' style={{ marginTop:20, borderRadius:22, flexDirection:'row', padding:10, backgroundColor:Colors.shades.shade100 }}>
288
+ {!poll.seconds_allowed || responded ?
289
+ <TouchableOpacity
290
+ style={{ marginRight:10, justifyContent:'center', paddingLeft:20, paddingRight:20, backgroundColor:Colors.utility.warning, borderRadius:22, borderWidth:1, borderColor:Colors.utility.warning }}
291
+ onPress={() => handleCancel()}
292
+ >
293
+ <Icons.ListIcon size={18} color={Colors.shades.white} />
294
+ </TouchableOpacity>
295
+ :<></>}
296
+ {poll.status == 'active' && poll.seconds_allowed && server_checked && !responded ?
297
+ <View style={{ marginRight:5 }}>
298
+ <ResponseTimer
299
+ poll_id={poll.poll_id}
300
+ seconds={poll.seconds_allowed}
301
+ onTimesUp={() => handleTimesUp()}
302
+ />
303
+ </View>
304
+ :
305
+ <Button
306
+ style={{flex:1, marginRight:5}}
307
+ title_color={Colors.brand.electric}
308
+ title={responded?'Next':'Skip'}
309
+ borderColor={Colors.brand.electric}
310
+ backgroundColor={Colors.shades.white}
311
+ borderRadius={22}
312
+ borderWidth={1}
313
+ padding={14}
314
+ onPress={() => handleSkip()}
315
+ />
316
+ }
317
+ {server_checked && !responded ?
318
+ <Button
319
+ style={{flex:2}}
320
+ title_color={Colors.shades.white}
321
+ disabled={option_selected&&!submit_loading?false:true}
322
+ title={option_selected?`Submit!`:poll.status == 'active' ? 'Select Answer' : 'Not Active'}
323
+ backgroundColor={option_selected&&!submit_loading?Colors.utility.success:Colors.brand.slate}
324
+ borderRadius={22}
325
+ onPress={() => handleSubmitResponse()}
326
+ />
327
+ :<></>}
328
+ </View>
329
+ :<></>}
330
+ </View>
331
+
332
+ )
333
+ }
334
+
335
+ export default PollCard
@@ -0,0 +1,110 @@
1
+ import React, { useState } from "react";
2
+ import { TextInput, TouchableOpacity, View } from "react-native"
3
+ import type { PollOptionProps, PollResponseProps, PollSummaryProps } from "../../types";
4
+ import Colors from "../../constants/colors";
5
+ import { Button, Icons, Text } from "../../Components";
6
+
7
+ type PollOptionCardProps = {
8
+ poll_option:PollOptionProps,
9
+ draft_selected?:boolean,
10
+ show_result?:boolean,
11
+ poll_response?:PollResponseProps,
12
+ poll_summary?:PollSummaryProps,
13
+ show_summary:boolean,
14
+ onSelect: (PollOptionProps: PollOptionProps) => void
15
+ }
16
+ const PollOptionCard = ({ draft_selected, show_result, poll_option, poll_summary, show_summary, onSelect, poll_response } : PollOptionCardProps) => {
17
+ const [ option_width, setOptionWidth ] = useState(0);
18
+ const [ input_locked, setInputLocked ] = useState(false);
19
+ const [ input_value, setInputValue ] = useState('');
20
+
21
+ const getResultColor = (result_ind?:'win'|'lose'|'draw') => {
22
+ 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
27
+ }
28
+ }
29
+
30
+ const getResultIcon = (result_ind:'win'|'lose'|'draw') => {
31
+ let color = getResultColor(result_ind)
32
+ switch(result_ind){
33
+ case 'win':
34
+ return <Icons.CheckIcon color={color} size={12} />
35
+ case 'lose':
36
+ return <Icons.CloseIcon color={color} size={12} />
37
+ default: return <></>
38
+ }
39
+ }
40
+
41
+ return (
42
+ <View>
43
+ {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
+ onPress={() => onSelect(poll_option)}
47
+ onLayout={(ev) => {
48
+ const { width } = ev.nativeEvent.layout
49
+ setOptionWidth(width)
50
+ }}
51
+ >
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>
53
+ {show_result && poll_option.result_ind ?
54
+ <View>
55
+ {getResultIcon(poll_option.result_ind)}
56
+ </View>
57
+ :<></>}
58
+ {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 }} />
60
+ :<></>}
61
+ {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>
65
+ :<></>}
66
+ </TouchableOpacity>
67
+ :
68
+ <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 }}>
70
+ <TextInput
71
+ style={{ flex:1, textAlign:'center', fontSize:14, padding:10, color:getResultColor(poll_response?.result_ind) }}
72
+ keyboardType={poll_option.input_type == 'number' ? 'decimal-pad' : 'default'}
73
+ editable={show_result?false:true}
74
+ placeholder="Input Answer"
75
+ value={poll_response ? poll_response.input_value : input_value}
76
+ placeholderTextColor={Colors.shades.shade600}
77
+ onChangeText={(text) => {
78
+ if(draft_selected){ onSelect(poll_option) }
79
+ setInputValue(text)
80
+ setInputLocked(false);
81
+ }}
82
+ />
83
+ {show_result && poll_response?.result_ind ?
84
+ <View>
85
+ {getResultIcon(poll_response.result_ind)}
86
+ </View>
87
+ :<></>}
88
+ </View>
89
+ {!show_result ?
90
+ <Button
91
+ style={{ marginLeft:5 }}
92
+ borderRadius={22}
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}
96
+ onPress={() => {
97
+ if(!input_value || input_value == ''){ return alert('Please enter valid value') }
98
+ setInputLocked(true)
99
+ onSelect({ ...poll_option, option_value: input_value })
100
+ }}
101
+ />
102
+ :<></>}
103
+ </View>
104
+
105
+ }
106
+ </View>
107
+ )
108
+ }
109
+
110
+ export default PollOptionCard
@@ -0,0 +1,106 @@
1
+ import React from 'react';
2
+ import { TouchableOpacity, View } from "react-native"
3
+ import type { PollCampaignProps, PollOptionProps, PollProps, PollResponseProps } from "../../types"
4
+ import Colors from "../../constants/colors"
5
+ import { Icons, Text } from "../../Components"
6
+
7
+ type PollSelectCardProps = {
8
+ selected?:boolean,
9
+ poll_campaign:PollCampaignProps,
10
+ poll:PollProps,
11
+ disabled?:boolean,
12
+ index:number,
13
+ show_response?:boolean,
14
+ response_option?:PollOptionProps,
15
+ poll_response?:PollResponseProps,
16
+ onSelect:(poll:PollProps) => void
17
+ }
18
+
19
+ const PollSelectCard = ({ index, poll, disabled, selected, poll_campaign, poll_response, show_response, response_option, onSelect }:PollSelectCardProps) => {
20
+
21
+ const getResultColor = () => {
22
+ switch(poll_response?.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
27
+ }
28
+ }
29
+
30
+ const getStatusColor = () => {
31
+ switch(poll.status) {
32
+ case 'closed': return Colors.highlights.highlight300Faded
33
+ case 'active': return Colors.highlights.highlight400Faded
34
+ default: return Colors.highlights.highlight500Faded
35
+ }
36
+ }
37
+
38
+
39
+ const getResultIcon = () => {
40
+ let color = getResultColor()
41
+ switch(poll_response?.result_ind){
42
+ case 'win':
43
+ return <Icons.CheckIcon color={color} size={16} />
44
+ case 'lose':
45
+ return <Icons.CloseIcon color={color} size={12} />
46
+ default:
47
+ if(poll.status == 'closed'){
48
+ return <Icons.CloseIcon color={color} size={10} />
49
+ }
50
+ return <></>
51
+ }
52
+ }
53
+
54
+ const getStatusIcon = () => {
55
+ //let color = getResultColor()
56
+ switch(poll.status){
57
+ case 'closed':
58
+ return <Icons.LockClosedIcon color={Colors.brand.midnight} size={14} />
59
+ case 'active':
60
+ return <Icons.InProgressIcon color={Colors.brand.midnight} size={14} />
61
+ default:
62
+ return <Icons.PausedIcon color={Colors.brand.midnight} size={14} />
63
+ }
64
+ }
65
+
66
+ return (
67
+ <TouchableOpacity disabled={disabled} style={{ padding:10, borderRadius:22, backgroundColor:selected?Colors.highlights.highlight500Faded:undefined, flexDirection:'row' }} onPress={() => onSelect(poll)}>
68
+ <View style={{ height:20, width:20, borderRadius:100, backgroundColor:Colors.shades.white, marginRight:10, justifyContent:'center' }}>
69
+ <Text size={12} color={Colors.brand.midnight} weight='bold' textAlign='center'>{(index + 1).toString()}</Text>
70
+ </View>
71
+ <View style={{ flex:1 }}>
72
+ {poll_campaign.campaign_type == 'trivia' && !poll_response && poll.status != 'closed' ?
73
+ <Text size={14} color={Colors.brand.midnight} weight='bold'>{poll.hidden_clue?`Hint: ${poll.hidden_clue}`:`Question Hidden`}</Text>
74
+ :
75
+ <Text size={14} color={Colors.brand.midnight} weight='bold'>{poll.poll_question}</Text>
76
+ }
77
+ {poll.status == 'closed' || show_response ?
78
+ <View style={{ marginTop:10, flexDirection:'row' }}>
79
+ {response_option && poll.poll_type == 'select' ?
80
+ <Text style={{ flex:1 }} size={12} color={Colors.brand.slate}>My Answer: <Text size={12} color={Colors.brand.midnight} weight='semibold'>{response_option.option_name}</Text></Text>
81
+ : response_option && poll.poll_type == 'input' ?
82
+ <Text style={{ flex:1 }} size={12} color={Colors.brand.slate}>My Answer: <Text size={12} color={Colors.brand.midnight} weight='semibold'>{poll_response?.input_value}</Text></Text>
83
+ :poll.status == 'closed' || poll_response?.timed_out ?
84
+ <Text style={{ flex:1 }} size={12} color={Colors.brand.midnight} weight='light'>TIMED OUT</Text>
85
+ :<></>}
86
+ <View style={{ marginLeft:5 }}>
87
+ {getResultIcon()}
88
+ </View>
89
+ </View>
90
+ :
91
+ <View style={{flexDirection:'row', alignItems:'center'}}>
92
+ <Text style={{ flex:1 }} size={12} color={Colors.brand.midnight} weight='light'>{poll.poll_type == 'select' ? 'Multiple Choice': 'Type Answer'}</Text>
93
+ <View style={{ flexDirection:'row', alignItems:'center', padding:10, backgroundColor:getStatusColor(), borderRadius:22 }}>
94
+ {getStatusIcon()}
95
+ {poll.seconds_allowed && poll.status != 'closed' ?
96
+ <Text style={{ marginLeft:5 }} size={12} color={Colors.brand.midnight} weight='bold'>{poll.seconds_allowed} Sec</Text>
97
+ :<></>}
98
+ </View>
99
+ </View>
100
+ }
101
+ </View>
102
+ </TouchableOpacity>
103
+ )
104
+ }
105
+
106
+ export default PollSelectCard
@@ -0,0 +1,37 @@
1
+ import React, { useEffect, useState } from "react"
2
+ import { View } from "react-native"
3
+ import { Text } from "../../Components"
4
+ import Colors from "../../constants/colors"
5
+
6
+ type ResponseTimerProps = {
7
+ poll_id:string,
8
+ seconds: number,
9
+ onTimesUp: () => void
10
+ }
11
+ const ResponseTimer = ({ seconds, onTimesUp }:ResponseTimerProps) => {
12
+ const [ seconds_remaining, setSecondsRemaining ] = useState(seconds);
13
+ const [ times_up, setTimesUp ] = useState(false);
14
+
15
+ useEffect(() => {
16
+ if(seconds_remaining > 0){
17
+ setTimeout(() => setSecondsRemaining(seconds_remaining - 1), 1000);
18
+ } else {
19
+ setTimesUp(true)
20
+ }
21
+ },[seconds_remaining])
22
+
23
+
24
+ useEffect(() => {
25
+ if(!times_up){ return }
26
+ onTimesUp()
27
+ },[times_up])
28
+
29
+ return (
30
+ <View style={{ width:50, padding:10, borderRadius:22, backgroundColor:seconds_remaining < 5 ? Colors.utility.error : seconds_remaining < 10 ? Colors.utility.warning : Colors.utility.success }}>
31
+ <Text textAlign="center" size={14} color={Colors.shades.white} weight='bold'>{seconds_remaining}</Text>
32
+ </View>
33
+ )
34
+ }
35
+
36
+ export default ResponseTimer
37
+
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { Image, TouchableOpacity, View } from "react-native"
3
+ import { Icons, Text } from '../../Components';
4
+ import Colors from '../../constants/colors';
5
+
6
+ type WidgetHeaderProps = {
7
+ back_visible?:boolean,
8
+ image?:{ url:string }
9
+ title:string,
10
+ sub_title?:string
11
+ onBack: () => void
12
+ }
13
+
14
+ const WidgetHeader = ({ back_visible, title, sub_title, image, onBack }:WidgetHeaderProps) => {
15
+
16
+ return (
17
+ <View style={{ flexDirection:'row' }}>
18
+ {back_visible ?
19
+ <TouchableOpacity style={{ justifyContent:'center', alignItems:'center', flex:1 }} onPress={() => onBack()}>
20
+ <Icons.ChevronIcon direction="left" color={Colors.shades.white} size={12} />
21
+ </TouchableOpacity>
22
+ :<View style={{ flex:1 }} />}
23
+ <View nativeID="header" style={{ flex:8 }}>
24
+ <View nativeID="company" style={{ padding:20 }}>
25
+ <Text size={18} color={Colors.shades.white} weight='bold' textAlign="center">{title}</Text>
26
+ {sub_title ?
27
+ <Text style={{ marginTop:3 }} size={12} color={Colors.shades.white} weight='regular' textAlign="center">{sub_title}</Text>
28
+ :<></>}
29
+ </View>
30
+ </View>
31
+ {image ?
32
+ <View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
33
+ <Image
34
+ source={{ uri: image.url }}
35
+ style={{ height:30, width:30 }}
36
+ resizeMode="contain"
37
+ />
38
+ </View>
39
+ :
40
+ <View style={{ flex:1 }} />
41
+ }
42
+ </View>
43
+ )
44
+ }
45
+
46
+ export default WidgetHeader