be-components 0.7.3 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) 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/index.js.map +1 -1
  4. package/lib/commonjs/Checkout/api/index.js.map +1 -1
  5. package/lib/commonjs/Checkout/index.js.map +1 -1
  6. package/lib/commonjs/Competition/api/index.js +655 -0
  7. package/lib/commonjs/Competition/api/index.js.map +1 -0
  8. package/lib/commonjs/Competition/components/AthleteMarketCard.js +168 -0
  9. package/lib/commonjs/Competition/components/AthleteMarketCard.js.map +1 -0
  10. package/lib/commonjs/Competition/components/CompetitionCard.js +180 -0
  11. package/lib/commonjs/Competition/components/CompetitionCard.js.map +1 -0
  12. package/lib/commonjs/Competition/components/CompetitionInfoCard.js +264 -0
  13. package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -0
  14. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +281 -0
  15. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -0
  16. package/lib/commonjs/Competition/components/CompetitionPlay.js +1269 -0
  17. package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -0
  18. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +111 -0
  19. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -0
  20. package/lib/commonjs/Competition/components/CompetitionSelector.js +122 -0
  21. package/lib/commonjs/Competition/components/CompetitionSelector.js.map +1 -0
  22. package/lib/commonjs/Competition/components/CompetitionTypeCard.js +380 -0
  23. package/lib/commonjs/Competition/components/CompetitionTypeCard.js.map +1 -0
  24. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +237 -0
  25. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -0
  26. package/lib/commonjs/Competition/components/LeaderPicks.js +322 -0
  27. package/lib/commonjs/Competition/components/LeaderPicks.js.map +1 -0
  28. package/lib/commonjs/Competition/components/ManageSeasonForm.js +605 -0
  29. package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +1 -0
  30. package/lib/commonjs/Competition/components/MarketsCard.js +148 -0
  31. package/lib/commonjs/Competition/components/MarketsCard.js.map +1 -0
  32. package/lib/commonjs/Competition/components/MatchMarketCard.js +199 -0
  33. package/lib/commonjs/Competition/components/MatchMarketCard.js.map +1 -0
  34. package/lib/commonjs/Competition/components/NavOutPrompt.js +159 -0
  35. package/lib/commonjs/Competition/components/NavOutPrompt.js.map +1 -0
  36. package/lib/commonjs/Competition/components/SeasonInfoModal.js +400 -0
  37. package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +1 -0
  38. package/lib/commonjs/Competition/components/TeamEventCard.js +217 -0
  39. package/lib/commonjs/Competition/components/TeamEventCard.js.map +1 -0
  40. package/lib/commonjs/Competition/components/WagerPickForm.js +278 -0
  41. package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -0
  42. package/lib/commonjs/Competition/index.js +42 -0
  43. package/lib/commonjs/Competition/index.js.map +1 -0
  44. package/lib/commonjs/Components/Icons.js.map +1 -1
  45. package/lib/commonjs/Components/Jerseys.js +713 -0
  46. package/lib/commonjs/Components/Jerseys.js.map +1 -0
  47. package/lib/commonjs/Components/LinearDiagnal.js +1 -1
  48. package/lib/commonjs/Components/LinearDiagnal.js.map +1 -1
  49. package/lib/commonjs/Components/Switch.js +81 -0
  50. package/lib/commonjs/Components/Switch.js.map +1 -0
  51. package/lib/commonjs/Components/index.js +14 -0
  52. package/lib/commonjs/Components/index.js.map +1 -1
  53. package/lib/commonjs/Poll/api/index.js +240 -0
  54. package/lib/commonjs/Poll/api/index.js.map +1 -0
  55. package/lib/commonjs/Poll/components/CampaignPlay.js +553 -0
  56. package/lib/commonjs/Poll/components/CampaignPlay.js.map +1 -0
  57. package/lib/commonjs/Poll/components/CampaignProgressBar.js +118 -0
  58. package/lib/commonjs/Poll/components/CampaignProgressBar.js.map +1 -0
  59. package/lib/commonjs/Poll/components/CampaignResult.js +382 -0
  60. package/lib/commonjs/Poll/components/CampaignResult.js.map +1 -0
  61. package/lib/commonjs/Poll/components/CampaignSelector.js +124 -0
  62. package/lib/commonjs/Poll/components/CampaignSelector.js.map +1 -0
  63. package/lib/commonjs/Poll/components/PollCampaignCard.js +66 -0
  64. package/lib/commonjs/Poll/components/PollCampaignCard.js.map +1 -0
  65. package/lib/commonjs/Poll/components/PollCard.js +480 -0
  66. package/lib/commonjs/Poll/components/PollCard.js.map +1 -0
  67. package/lib/commonjs/Poll/components/PollOptionCard.js +158 -0
  68. package/lib/commonjs/Poll/components/PollOptionCard.js.map +1 -0
  69. package/lib/commonjs/Poll/components/PollSelectCard.js +189 -0
  70. package/lib/commonjs/Poll/components/PollSelectCard.js.map +1 -0
  71. package/lib/commonjs/Poll/components/ResponseTimer.js +48 -0
  72. package/lib/commonjs/Poll/components/ResponseTimer.js.map +1 -0
  73. package/lib/commonjs/Poll/components/WidgetHeader.js +83 -0
  74. package/lib/commonjs/Poll/components/WidgetHeader.js.map +1 -0
  75. package/lib/commonjs/Poll/index.js +31 -0
  76. package/lib/commonjs/Poll/index.js.map +1 -0
  77. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  78. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  79. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +3 -1
  80. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  81. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  82. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  83. package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
  84. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  85. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  86. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  87. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +5 -0
  88. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  89. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  90. package/lib/commonjs/ProfileManager/index.js +2 -0
  91. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  92. package/lib/commonjs/Wallet/api/index.js +4 -1
  93. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  94. package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -1
  95. package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -1
  96. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
  97. package/lib/commonjs/Wallet/components/FundAccountCard.js.map +1 -1
  98. package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -1
  99. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -1
  100. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -1
  101. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -1
  102. package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
  103. package/lib/commonjs/Wallet/components/WalletSettings.js.map +1 -1
  104. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
  105. package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
  106. package/lib/commonjs/Wallet/index.js.map +1 -1
  107. package/lib/commonjs/index.js +14 -0
  108. package/lib/commonjs/index.js.map +1 -1
  109. package/lib/module/ApiOverrides/index.js +18 -0
  110. package/lib/module/ApiOverrides/index.js.map +1 -1
  111. package/lib/module/Authenticator/index.js.map +1 -1
  112. package/lib/module/Checkout/api/index.js.map +1 -1
  113. package/lib/module/Checkout/index.js.map +1 -1
  114. package/lib/module/Competition/api/index.js +649 -0
  115. package/lib/module/Competition/api/index.js.map +1 -0
  116. package/lib/module/Competition/components/AthleteMarketCard.js +161 -0
  117. package/lib/module/Competition/components/AthleteMarketCard.js.map +1 -0
  118. package/lib/module/Competition/components/CompetitionCard.js +173 -0
  119. package/lib/module/Competition/components/CompetitionCard.js.map +1 -0
  120. package/lib/module/Competition/components/CompetitionInfoCard.js +257 -0
  121. package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -0
  122. package/lib/module/Competition/components/CompetitionLeaderboard.js +272 -0
  123. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -0
  124. package/lib/module/Competition/components/CompetitionPlay.js +1260 -0
  125. package/lib/module/Competition/components/CompetitionPlay.js.map +1 -0
  126. package/lib/module/Competition/components/CompetitionSeasonCard.js +104 -0
  127. package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -0
  128. package/lib/module/Competition/components/CompetitionSelector.js +113 -0
  129. package/lib/module/Competition/components/CompetitionSelector.js.map +1 -0
  130. package/lib/module/Competition/components/CompetitionTypeCard.js +371 -0
  131. package/lib/module/Competition/components/CompetitionTypeCard.js.map +1 -0
  132. package/lib/module/Competition/components/EnterCompetitionPrompt.js +228 -0
  133. package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -0
  134. package/lib/module/Competition/components/LeaderPicks.js +313 -0
  135. package/lib/module/Competition/components/LeaderPicks.js.map +1 -0
  136. package/lib/module/Competition/components/ManageSeasonForm.js +596 -0
  137. package/lib/module/Competition/components/ManageSeasonForm.js.map +1 -0
  138. package/lib/module/Competition/components/MarketsCard.js +139 -0
  139. package/lib/module/Competition/components/MarketsCard.js.map +1 -0
  140. package/lib/module/Competition/components/MatchMarketCard.js +192 -0
  141. package/lib/module/Competition/components/MatchMarketCard.js.map +1 -0
  142. package/lib/module/Competition/components/NavOutPrompt.js +152 -0
  143. package/lib/module/Competition/components/NavOutPrompt.js.map +1 -0
  144. package/lib/module/Competition/components/SeasonInfoModal.js +391 -0
  145. package/lib/module/Competition/components/SeasonInfoModal.js.map +1 -0
  146. package/lib/module/Competition/components/TeamEventCard.js +210 -0
  147. package/lib/module/Competition/components/TeamEventCard.js.map +1 -0
  148. package/lib/module/Competition/components/WagerPickForm.js +269 -0
  149. package/lib/module/Competition/components/WagerPickForm.js.map +1 -0
  150. package/lib/module/Competition/index.js +33 -0
  151. package/lib/module/Competition/index.js.map +1 -0
  152. package/lib/module/Components/Icons.js.map +1 -1
  153. package/lib/module/Components/Jerseys.js +705 -0
  154. package/lib/module/Components/Jerseys.js.map +1 -0
  155. package/lib/module/Components/LinearDiagnal.js +2 -3
  156. package/lib/module/Components/LinearDiagnal.js.map +1 -1
  157. package/lib/module/Components/Switch.js +74 -0
  158. package/lib/module/Components/Switch.js.map +1 -0
  159. package/lib/module/Components/index.js +3 -1
  160. package/lib/module/Components/index.js.map +1 -1
  161. package/lib/module/Poll/api/index.js +234 -0
  162. package/lib/module/Poll/api/index.js.map +1 -0
  163. package/lib/module/Poll/components/CampaignPlay.js +545 -0
  164. package/lib/module/Poll/components/CampaignPlay.js.map +1 -0
  165. package/lib/module/Poll/components/CampaignProgressBar.js +110 -0
  166. package/lib/module/Poll/components/CampaignProgressBar.js.map +1 -0
  167. package/lib/module/Poll/components/CampaignResult.js +374 -0
  168. package/lib/module/Poll/components/CampaignResult.js.map +1 -0
  169. package/lib/module/Poll/components/CampaignSelector.js +115 -0
  170. package/lib/module/Poll/components/CampaignSelector.js.map +1 -0
  171. package/lib/module/Poll/components/PollCampaignCard.js +59 -0
  172. package/lib/module/Poll/components/PollCampaignCard.js.map +1 -0
  173. package/lib/module/Poll/components/PollCard.js +472 -0
  174. package/lib/module/Poll/components/PollCard.js.map +1 -0
  175. package/lib/module/Poll/components/PollOptionCard.js +149 -0
  176. package/lib/module/Poll/components/PollOptionCard.js.map +1 -0
  177. package/lib/module/Poll/components/PollSelectCard.js +182 -0
  178. package/lib/module/Poll/components/PollSelectCard.js.map +1 -0
  179. package/lib/module/Poll/components/ResponseTimer.js +39 -0
  180. package/lib/module/Poll/components/ResponseTimer.js.map +1 -0
  181. package/lib/module/Poll/components/WidgetHeader.js +76 -0
  182. package/lib/module/Poll/components/WidgetHeader.js.map +1 -0
  183. package/lib/module/Poll/index.js +22 -0
  184. package/lib/module/Poll/index.js.map +1 -0
  185. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  186. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  187. package/lib/module/ProfileManager/Components/CodeRedeem.js +3 -1
  188. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  189. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  190. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  191. package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
  192. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  193. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  194. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  195. package/lib/module/ProfileManager/Components/ProfileWizard.js +5 -0
  196. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  197. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  198. package/lib/module/ProfileManager/index.js +2 -0
  199. package/lib/module/ProfileManager/index.js.map +1 -1
  200. package/lib/module/Wallet/api/index.js +4 -1
  201. package/lib/module/Wallet/api/index.js.map +1 -1
  202. package/lib/module/Wallet/components/ACHAddCard.js.map +1 -1
  203. package/lib/module/Wallet/components/AddressManager.js.map +1 -1
  204. package/lib/module/Wallet/components/DepositCard.js.map +1 -1
  205. package/lib/module/Wallet/components/FundAccountCard.js.map +1 -1
  206. package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -1
  207. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -1
  208. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -1
  209. package/lib/module/Wallet/components/MyBalance.js.map +1 -1
  210. package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
  211. package/lib/module/Wallet/components/WalletSettings.js.map +1 -1
  212. package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
  213. package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
  214. package/lib/module/Wallet/index.js.map +1 -1
  215. package/lib/module/index.js +3 -1
  216. package/lib/module/index.js.map +1 -1
  217. package/lib/typescript/src/ApiOverrides/index.d.ts +1 -0
  218. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  219. package/lib/typescript/src/Authenticator/api/index.d.ts +2 -2
  220. package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
  221. package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
  222. package/lib/typescript/src/Checkout/api/index.d.ts +1 -2
  223. package/lib/typescript/src/Checkout/api/index.d.ts.map +1 -1
  224. package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
  225. package/lib/typescript/src/Competition/api/index.d.ts +128 -0
  226. package/lib/typescript/src/Competition/api/index.d.ts.map +1 -0
  227. package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts +19 -0
  228. package/lib/typescript/src/Competition/components/AthleteMarketCard.d.ts.map +1 -0
  229. package/lib/typescript/src/Competition/components/CompetitionCard.d.ts +12 -0
  230. package/lib/typescript/src/Competition/components/CompetitionCard.d.ts.map +1 -0
  231. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts +16 -0
  232. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -0
  233. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts +14 -0
  234. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -0
  235. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts +20 -0
  236. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts.map +1 -0
  237. package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts +10 -0
  238. package/lib/typescript/src/Competition/components/CompetitionSeasonCard.d.ts.map +1 -0
  239. package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts +11 -0
  240. package/lib/typescript/src/Competition/components/CompetitionSelector.d.ts.map +1 -0
  241. package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts +14 -0
  242. package/lib/typescript/src/Competition/components/CompetitionTypeCard.d.ts.map +1 -0
  243. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +16 -0
  244. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -0
  245. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts +22 -0
  246. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts.map +1 -0
  247. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +10 -0
  248. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +1 -0
  249. package/lib/typescript/src/Competition/components/MarketsCard.d.ts +15 -0
  250. package/lib/typescript/src/Competition/components/MarketsCard.d.ts.map +1 -0
  251. package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts +21 -0
  252. package/lib/typescript/src/Competition/components/MatchMarketCard.d.ts.map +1 -0
  253. package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts +23 -0
  254. package/lib/typescript/src/Competition/components/NavOutPrompt.d.ts.map +1 -0
  255. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +14 -0
  256. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +1 -0
  257. package/lib/typescript/src/Competition/components/TeamEventCard.d.ts +17 -0
  258. package/lib/typescript/src/Competition/components/TeamEventCard.d.ts.map +1 -0
  259. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +15 -0
  260. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -0
  261. package/lib/typescript/src/Competition/index.d.ts +11 -0
  262. package/lib/typescript/src/Competition/index.d.ts.map +1 -0
  263. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  264. package/lib/typescript/src/Components/Jerseys.d.ts +16 -0
  265. package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -0
  266. package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -1
  267. package/lib/typescript/src/Components/Switch.d.ts +9 -0
  268. package/lib/typescript/src/Components/Switch.d.ts.map +1 -0
  269. package/lib/typescript/src/Components/index.d.ts +3 -1
  270. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  271. package/lib/typescript/src/Poll/api/index.d.ts +61 -0
  272. package/lib/typescript/src/Poll/api/index.d.ts.map +1 -0
  273. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts +14 -0
  274. package/lib/typescript/src/Poll/components/CampaignPlay.d.ts.map +1 -0
  275. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts +12 -0
  276. package/lib/typescript/src/Poll/components/CampaignProgressBar.d.ts.map +1 -0
  277. package/lib/typescript/src/Poll/components/CampaignResult.d.ts +13 -0
  278. package/lib/typescript/src/Poll/components/CampaignResult.d.ts.map +1 -0
  279. package/lib/typescript/src/Poll/components/CampaignSelector.d.ts +9 -0
  280. package/lib/typescript/src/Poll/components/CampaignSelector.d.ts.map +1 -0
  281. package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts +10 -0
  282. package/lib/typescript/src/Poll/components/PollCampaignCard.d.ts.map +1 -0
  283. package/lib/typescript/src/Poll/components/PollCard.d.ts +16 -0
  284. package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -0
  285. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts +14 -0
  286. package/lib/typescript/src/Poll/components/PollOptionCard.d.ts.map +1 -0
  287. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts +16 -0
  288. package/lib/typescript/src/Poll/components/PollSelectCard.d.ts.map +1 -0
  289. package/lib/typescript/src/Poll/components/ResponseTimer.d.ts +9 -0
  290. package/lib/typescript/src/Poll/components/ResponseTimer.d.ts.map +1 -0
  291. package/lib/typescript/src/Poll/components/WidgetHeader.d.ts +13 -0
  292. package/lib/typescript/src/Poll/components/WidgetHeader.d.ts.map +1 -0
  293. package/lib/typescript/src/Poll/index.d.ts +7 -0
  294. package/lib/typescript/src/Poll/index.d.ts.map +1 -0
  295. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts +1 -1
  296. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  297. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +1 -2
  298. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  299. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts +9 -2
  300. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  301. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts +1 -1
  302. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  303. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts +1 -1
  304. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  305. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts +1 -1
  306. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  307. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts +1 -1
  308. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  309. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +1 -1
  310. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  311. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +1 -2
  312. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  313. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +10 -3
  314. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  315. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts +2 -2
  316. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
  317. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts +1 -2
  318. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  319. package/lib/typescript/src/ProfileManager/api/index.d.ts +2 -2
  320. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  321. package/lib/typescript/src/ProfileManager/index.d.ts +9 -2
  322. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  323. package/lib/typescript/src/Wallet/api/index.d.ts +2 -3
  324. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  325. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts +1 -2
  326. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -1
  327. package/lib/typescript/src/Wallet/components/AddressManager.d.ts +1 -2
  328. package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -1
  329. package/lib/typescript/src/Wallet/components/DepositCard.d.ts +1 -2
  330. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
  331. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts +1 -2
  332. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts.map +1 -1
  333. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts +1 -2
  334. package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -1
  335. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts +1 -2
  336. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  337. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts +1 -2
  338. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -1
  339. package/lib/typescript/src/Wallet/components/MyBalance.d.ts +1 -2
  340. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -1
  341. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts +1 -2
  342. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
  343. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts +1 -2
  344. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts.map +1 -1
  345. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +1 -2
  346. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
  347. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts +1 -2
  348. package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -1
  349. package/lib/typescript/src/Wallet/index.d.ts +1 -2
  350. package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
  351. package/lib/typescript/src/index.d.ts +3 -1
  352. package/lib/typescript/src/index.d.ts.map +1 -1
  353. package/package.json +1 -1
  354. package/src/ApiOverrides/index.ts +19 -0
  355. package/src/Authenticator/api/index.ts +2 -2
  356. package/src/Authenticator/api/types.d.ts +1 -25
  357. package/src/Authenticator/index.tsx +2 -1
  358. package/src/Checkout/api/index.tsx +1 -2
  359. package/src/Checkout/index.tsx +1 -2
  360. package/src/Competition/api/index.ts +568 -0
  361. package/src/Competition/components/AthleteMarketCard.tsx +116 -0
  362. package/src/Competition/components/CompetitionCard.tsx +82 -0
  363. package/src/Competition/components/CompetitionInfoCard.tsx +149 -0
  364. package/src/Competition/components/CompetitionLeaderboard.tsx +183 -0
  365. package/src/Competition/components/CompetitionPlay.tsx +936 -0
  366. package/src/Competition/components/CompetitionSeasonCard.tsx +48 -0
  367. package/src/Competition/components/CompetitionSelector.tsx +91 -0
  368. package/src/Competition/components/CompetitionTypeCard.tsx +211 -0
  369. package/src/Competition/components/EnterCompetitionPrompt.tsx +127 -0
  370. package/src/Competition/components/LeaderPicks.tsx +214 -0
  371. package/src/Competition/components/ManageSeasonForm.tsx +271 -0
  372. package/src/Competition/components/MarketsCard.tsx +108 -0
  373. package/src/Competition/components/MatchMarketCard.tsx +126 -0
  374. package/src/Competition/components/NavOutPrompt.tsx +87 -0
  375. package/src/Competition/components/SeasonInfoModal.tsx +212 -0
  376. package/src/Competition/components/TeamEventCard.tsx +136 -0
  377. package/src/Competition/components/WagerPickForm.tsx +114 -0
  378. package/src/Competition/index.tsx +36 -0
  379. package/src/Components/Icons.tsx +0 -2
  380. package/src/Components/Jerseys.tsx +268 -0
  381. package/src/Components/LinearDiagnal.tsx +2 -3
  382. package/src/Components/Switch.tsx +55 -0
  383. package/src/Components/index.tsx +5 -1
  384. package/src/Poll/api/index.ts +178 -0
  385. package/src/Poll/components/CampaignPlay.tsx +407 -0
  386. package/src/Poll/components/CampaignProgressBar.tsx +70 -0
  387. package/src/Poll/components/CampaignResult.tsx +180 -0
  388. package/src/Poll/components/CampaignSelector.tsx +96 -0
  389. package/src/Poll/components/PollCampaignCard.tsx +35 -0
  390. package/src/Poll/components/PollCard.tsx +335 -0
  391. package/src/Poll/components/PollOptionCard.tsx +110 -0
  392. package/src/Poll/components/PollSelectCard.tsx +106 -0
  393. package/src/Poll/components/ResponseTimer.tsx +37 -0
  394. package/src/Poll/components/WidgetHeader.tsx +46 -0
  395. package/src/Poll/index.tsx +25 -0
  396. package/src/ProfileManager/Components/BasicInfoManager.tsx +1 -1
  397. package/src/ProfileManager/Components/BasicStatus.tsx +1 -2
  398. package/src/ProfileManager/Components/CodeRedeem.tsx +10 -3
  399. package/src/ProfileManager/Components/DOBManager.tsx +1 -1
  400. package/src/ProfileManager/Components/EmailManager.tsx +1 -1
  401. package/src/ProfileManager/Components/PasswordManager.tsx +2 -1
  402. package/src/ProfileManager/Components/PhoneManager.tsx +1 -1
  403. package/src/ProfileManager/Components/ProfilePicManager.tsx +1 -1
  404. package/src/ProfileManager/Components/ProfileWelcome.tsx +1 -2
  405. package/src/ProfileManager/Components/ProfileWizard.tsx +14 -3
  406. package/src/ProfileManager/Components/SettingsManager.tsx +2 -2
  407. package/src/ProfileManager/Components/VouchCard.tsx +1 -2
  408. package/src/ProfileManager/api/index.ts +2 -2
  409. package/src/ProfileManager/api/types.d.ts +0 -35
  410. package/src/ProfileManager/index.tsx +11 -3
  411. package/src/Wallet/api/index.ts +6 -4
  412. package/src/Wallet/components/ACHAddCard.tsx +1 -2
  413. package/src/Wallet/components/AddressManager.tsx +1 -2
  414. package/src/Wallet/components/DepositCard.tsx +1 -2
  415. package/src/Wallet/components/FundAccountCard.tsx +1 -2
  416. package/src/Wallet/components/ManageAccountCard.tsx +1 -2
  417. package/src/Wallet/components/ManualACHAdd.tsx +1 -2
  418. package/src/Wallet/components/ManualCardAdd.tsx +1 -2
  419. package/src/Wallet/components/MyBalance.tsx +1 -2
  420. package/src/Wallet/components/WalletActionSelector.tsx +1 -2
  421. package/src/Wallet/components/WalletSettings.tsx +1 -2
  422. package/src/Wallet/components/WalletSetup.tsx +1 -2
  423. package/src/Wallet/components/WithdrawCard.tsx +1 -2
  424. package/src/Wallet/index.tsx +1 -2
  425. package/src/index.tsx +5 -2
  426. package/src/types.d.ts +483 -0
@@ -0,0 +1,936 @@
1
+ import { ActivityIndicator, FlatList, Image, ImageBackground, ScrollView, TouchableOpacity, View } from "react-native"
2
+ import type { AthleteProps, CodeRequestProps, CompanyProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, LeagueProps, MarketProps, MyPlayerProps, PlayerBalanceProps, PlayerPickProps, PlayerReferralProps, PromoProps, PublicPlayerProps, RewardOptionProps, TeamProps } from "../../types";
3
+ import Colors from '../../constants/colors';
4
+ import React, { useEffect, useState } from "react"
5
+ import TeamEventCard from './TeamEventCard';
6
+ import NavOutPrompt from './NavOutPrompt';
7
+ import AthleteMarketCard from './AthleteMarketCard';
8
+ import MatchMarketCard from './MatchMarketCard';
9
+ import CompetitionInfoCard from './CompetitionInfoCard';
10
+ import CompetitionLeaderboard from './CompetitionLeaderboard';
11
+ import LeaderPicks from './LeaderPicks';
12
+ import WagerPickForm from './WagerPickForm';
13
+ import EnterCompetitionPrompt from './EnterCompetitionPrompt';
14
+ import SeasonInfoModal from './SeasonInfoModal';
15
+ import CompetitionTypeCard from './CompetitionTypeCard';
16
+
17
+ import type { EventProps, MatchProps, TournamentProps } from "../../types";
18
+ import { CompetitionApi, CompetitionHelpers, CompetitionMatchApi, CompetitionPlayerApi, PlayerPicksApi } from "../api";
19
+ import { AuthenticateApi } from "../../Authenticator/api";
20
+ import moment from "moment-mini";
21
+ import { view_styles } from "../../constants/styles";
22
+ import LinearGradient from "react-native-linear-gradient";
23
+ import { Icons, Text } from "../../Components";
24
+ import LinearDiagnal from "../../Components/LinearDiagnal";
25
+ import SpringView from "../../Components/Spring";
26
+ import type { BEEventProps } from "../../Observer/api/types";
27
+
28
+ type CompetitionPlayProps = {
29
+ player_id?:string,
30
+ competition_id:string,
31
+ company?:CompanyProps,
32
+ onEvent?:(event:BEEventProps) => void,
33
+ height:number,
34
+ width:number,
35
+ source?:string,
36
+ onGoBack?:() => void,
37
+ hide_player?:boolean,
38
+ onRequestAuthentication: () => void,
39
+ back_allowed?:boolean
40
+ onChangeCompetition?: (competition_id:string) => void
41
+ }
42
+ const CompetitionPlay = ( { player_id, company, source, back_allowed, onGoBack, competition_id, width, height, hide_player, onChangeCompetition, onRequestAuthentication }:CompetitionPlayProps ) => {
43
+
44
+ const [ loading, setLoading ] = useState(false);
45
+ const [ code_details ] = useState<{
46
+ promo?:PromoProps,
47
+ code_request?: CodeRequestProps,
48
+ player_referral?:PlayerReferralProps,
49
+ referrer?:PublicPlayerProps,
50
+ reward_option?:RewardOptionProps
51
+ }>({});
52
+ const [ my_data, setMyData ] = useState<{
53
+ player?:MyPlayerProps,
54
+ player_balance?:PlayerBalanceProps,
55
+ player_picks:PlayerPickProps[]
56
+ }>({
57
+ player_picks: []
58
+ })
59
+ const [ competition_data, setCompetitionData ] = useState<{
60
+ loading:boolean,
61
+ competition?:CompetitionProps,
62
+ tournaments:TournamentProps[],
63
+ matches:MatchProps[],
64
+ events:EventProps[],
65
+ athletes:AthleteProps[],
66
+ teams:TeamProps[],
67
+ markets:MarketProps[],
68
+ leagues:LeagueProps[],
69
+ competition_payout_types:CompetitionPayoutTypeProps[],
70
+ competition_players:CompetitionPlayerProps[],
71
+ competition_matches:CompetitionMatchProps[],
72
+ competition_match_markets:CompetitionMatchMarketProps[],
73
+ competition_types:CompetitionTypeProps[],
74
+ competition_result_types:CompetitionResultTypeProps[],
75
+ competition_type?:CompetitionTypeProps,
76
+ competition_result_type?:CompetitionResultTypeProps,
77
+ competition_season?:CompetitionSeasonProps,
78
+
79
+ }>({
80
+ loading:false,
81
+ tournaments:[],
82
+ events:[],
83
+ athletes: [],
84
+ teams: [],
85
+ matches: [],
86
+ leagues: [],
87
+ markets:[],
88
+ competition_types:[],
89
+ competition_result_types:[],
90
+ competition_payout_types:[],
91
+ competition_matches:[],
92
+ competition_players:[],
93
+ competition_match_markets:[],
94
+
95
+ })
96
+ const [ profile_visible, setProfileVisible ] = useState(false);
97
+ const [ show_rules, setShowRules ] = useState(false);
98
+ const [ nav_out_prompt, setNavOutPrompt ] = useState<{
99
+ visible:boolean,
100
+ title?:string,
101
+ hide_accept?:boolean,
102
+ url?:string,
103
+ image_url?:string,
104
+ body?:string,
105
+ accept_title?: string,
106
+ cancel_title?:string
107
+ }>({
108
+ visible: false
109
+ });
110
+ const [ show_season, setShowSeason ] = useState(false);
111
+ const [ show_enter_prompt, setShowEnterPrompt ] = useState(false);
112
+ const [ complete_loaded, setCompleteLoaded ] = useState(false);
113
+ const [ show_completed, setShowCompleted ] = useState(false);
114
+ const [ expanded_markets, setExpandedMarkets ] = useState<string[]>([]);
115
+ const [ draft_player_pick, setDraftPlayerPick ] = useState<{draft_pick?:PlayerPickProps, event_title?:string, event_start?:string}>({});
116
+ const [ viewing_leader, setViewingLeader ] = useState<PublicPlayerProps | undefined>(undefined);
117
+ const [ show_full_leaderboard, setShowFullLeaderboard ] = useState(false);
118
+ const [ pick_loading, setPickLoading ] = useState<undefined|string>(undefined)
119
+
120
+ const {
121
+ competition,
122
+ leagues,
123
+ markets,
124
+ events,
125
+ athletes,
126
+ tournaments,
127
+ matches,
128
+ competition_players,
129
+ competition_result_type,
130
+ competition_payout_types,
131
+ competition_season,
132
+ competition_types,
133
+ competition_result_types,
134
+ competition_type,
135
+ competition_matches,
136
+ competition_match_markets
137
+ } = competition_data;
138
+
139
+ const {
140
+ player,
141
+ player_balance,
142
+ player_picks
143
+ } = my_data;
144
+
145
+ const events_array = Object.values(events)
146
+
147
+ const authenticated_competition_player = competition_players.find(cp => cp.player_id == player?.player_id);
148
+
149
+ const can_leave = competition?.entered && moment().isBefore(moment(competition.scheduled_datetime)) && player_picks.length == 0 && !loading
150
+ const ip_unique_team_events = [ ... new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.status == 'inprogress').map(cm => cm.event_id)) ]
151
+ const ip_team_event_ids = events_array.filter(e => ip_unique_team_events.includes(e.event_id)).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id)
152
+
153
+ const closed_unique_team_events = [ ... new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.status == 'closed').map(cm => cm.event_id)) ]
154
+ const closed_team_event_ids = events_array.filter(e => closed_unique_team_events.includes(e.event_id)).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id)
155
+
156
+
157
+ const unique_tournaments = [ ... new Set(Object.values(matches).map(m => m.tournament_id))]
158
+
159
+ useEffect(() => {
160
+ if(!competition_id){ return }
161
+ getCompetitionFromServer(competition_id)
162
+ },[ competition_id, player_id ])
163
+
164
+ useEffect(() => {
165
+ if(!competition_id){ return }
166
+ if(!player_id){ setMyData({ player_picks: [] }) }
167
+ else { getPlayerData(competition_id, player_id, 0) }
168
+ },[player_id])
169
+
170
+ const getPlayerData = async(competition_id:string, player_id:string, offset:number) => {
171
+ const pps = await PlayerPicksApi.getPlayerPicksByCompetition(competition_id, player_id, offset)
172
+ const player_balance = await CompetitionApi.getMyBalance();
173
+ const me = await CompetitionApi.getMyDetails();
174
+ setMyData({ player:me, player_balance, player_picks:pps })
175
+ }
176
+
177
+ useEffect(() => {
178
+ if(!player){ return }
179
+ if(!competition_type || !competition){ return }
180
+ if(competition_type.type == 'pick'){
181
+ //Need to determine if we need to show complete label!
182
+ if(player_picks.length == competition.max_pick_count){
183
+ handleEndCompetition()
184
+ }
185
+ }
186
+ },[player_picks.length])
187
+
188
+ const handleEndCompetition = async() => {
189
+ if(!competition){ return }
190
+ if(competition?.status == 'closed'){ return }
191
+ if(source == 'bettoredge'){
192
+ return setNavOutPrompt({
193
+ visible: true,
194
+ title:'Your picks are set!',
195
+ image_url: competition.image?.url ?? company?.company_image?.url,
196
+ body: 'Way to go! All your pick are locked. Feel free to edit your picks up until the start time of each contest',
197
+ hide_accept: true,
198
+ cancel_title: 'CLOSE'
199
+ })
200
+ }
201
+ let company_short_name = 'be'
202
+ if(company){ company_short_name = company.short_name }
203
+ let url = `https://share.mybe.app/c/${company_short_name}?type=c&id=${competition.competition_id}&utm_source=widget`
204
+ try {
205
+ const player_token = await AuthenticateApi.getShortToken()
206
+ url += `&token=${player_token.token}`
207
+ } catch (e) {
208
+ console.log(e)
209
+ }
210
+
211
+
212
+ setNavOutPrompt({
213
+ visible: true,
214
+ url,
215
+ title:'Your picks are set!',
216
+ image_url: competition.image?.url ?? company?.company_image?.url,
217
+ body: 'Want even more ways to win? Checkout BettorEdge where you can play more competitions like this, track results and even bet real money on the games!',
218
+ accept_title: 'Take Me There!',
219
+ cancel_title: 'No Thanks'
220
+ })
221
+ }
222
+
223
+ const handleProfile = async(status:string) => {
224
+ if(!player || !competition){ return }
225
+ if(source == 'bettoredge'){ return }
226
+ let company_short_name = 'be'
227
+ if(company){ company_short_name = company.short_name }
228
+ let url = `https://share.mybe.app/c/${company_short_name}?type=c&id=${competition.competition_id}&utm_source=widget`
229
+ try {
230
+ const player_token = await AuthenticateApi.getShortToken()
231
+ url += `&token=${player_token.token}`
232
+ } catch (e) {
233
+ console.log(e)
234
+ }
235
+ if(status != 'verified'){
236
+ setNavOutPrompt({
237
+ title: 'Verify me on BettorEdge!',
238
+ url,
239
+ image_url: player.profile_pic,
240
+ body: 'In order to use real-money, you must verify that you are of legal age with our partner BettorEdge',
241
+ accept_title: 'Verify at BettorEdge',
242
+ visible:true
243
+ })
244
+ } else {
245
+ setNavOutPrompt({
246
+ title: 'Manage my profile at BettorEdge',
247
+ url,
248
+ image_url: player.profile_pic,
249
+ body: 'See your competition performance and history at BettorEdge.',
250
+ accept_title: 'Manage Profile',
251
+ visible:true
252
+ })
253
+
254
+ }
255
+
256
+ }
257
+
258
+ //This will snag all the data we need to launch the competition
259
+ const getCompetitionFromServer = async(competition_id:string) => {
260
+ setCompetitionData({ ...competition_data, loading:true });
261
+ const { competition_types, competition_result_types, competition_payout_types } = await CompetitionApi.getCompetitionOptions();
262
+ const ls = await CompetitionApi.getLeagues()
263
+ const cms_response = await CompetitionApi.getCompetitionMatchesByCompetitionId(competition_id)
264
+
265
+
266
+
267
+ //Lets get the additional data needed!
268
+ let athletes: AthleteProps[] = []
269
+ let teams: TeamProps[] = []
270
+ let events:EventProps[] = []
271
+ let tournaments:TournamentProps[] = []
272
+ let matches: MatchProps[] = []
273
+ const markets = await CompetitionApi.getMarkets();
274
+ let athlete_ids = cms_response.competition_matches.filter(cm => cm.side_type_override == 'athlete' && cm.side_id_override).map(cm => cm.side_id_override ?? '');
275
+ let team_ids = cms_response.competition_matches.filter(cm => cm.side_type_override == 'team' && cm.side_id_override).map(cm => cm.side_id_override ?? '');
276
+ const event_ids = cms_response.competition_matches.filter(cm => cm.event_type == 'team').map(cm => cm.event_id)
277
+ event_ids.map(eid => {
278
+ let side_id_cm = cms_response.competition_matches.find(cm => cm.event_type == 'team' && cm.event_id == eid && cm.side_id_override)
279
+ if(side_id_cm){ expanded_markets.push(eid) }
280
+ })
281
+ setExpandedMarkets(expanded_markets)
282
+ const match_ids = cms_response.competition_matches.filter(cm => cm.event_type == 'match').map(cm => cm.event_id)
283
+ if(event_ids.length > 0){ events = await CompetitionMatchApi.getEventsByEventIds(event_ids) }
284
+ if(match_ids.length > 0){ matches = await CompetitionMatchApi.getMatchesByMatchIds(match_ids) }
285
+ if(matches.length > 0){
286
+ let tournament_ids = matches.map(m => m.tournament_id)
287
+ tournaments = await CompetitionMatchApi.getTournamentsByTournamentIds(tournament_ids)
288
+ let new_athlete_ids:string[] = []
289
+ let new_team_ids: string[] = []
290
+ matches.filter(m => m.participant_type == 'athlete').map(m => m.participants.map(p => new_athlete_ids.push(p)))
291
+ matches.filter(m => m.participant_type == 'team').map(m => m.participants.map(p => new_team_ids.push(p)))
292
+ athlete_ids = athlete_ids.concat(new_athlete_ids);
293
+ team_ids = team_ids.concat(new_team_ids)
294
+ }
295
+ if(athlete_ids.length > 0){ athletes = await CompetitionMatchApi.getAthletesByIds(athlete_ids) }
296
+ if(team_ids.length > 0){ teams = await CompetitionMatchApi.getTeamsByIds(team_ids) }
297
+ const cps = await CompetitionPlayerApi.getCompetitionPlayersByCompetition(competition_id, 0, 'active')
298
+ const c = await CompetitionApi.getCompetitionById(competition_id)
299
+ setCompetitionData({
300
+ loading:false,
301
+ competition: c,
302
+ competition_matches: cms_response.competition_matches,
303
+ competition_match_markets: cms_response.competition_match_markets,
304
+ events,
305
+ athletes,
306
+ teams,
307
+ tournaments,
308
+ leagues: ls,
309
+ competition_types:competition_types,
310
+ competition_result_types:competition_result_types,
311
+ matches,
312
+ competition_payout_types,
313
+ competition_players: cps,
314
+ competition_type: competition_types.find(ct => ct.competition_type_id == c.competition_type_id),
315
+ competition_result_type:competition_result_types.find(crt => crt.competition_result_type_id == c.competition_result_type_id),
316
+ markets
317
+ })
318
+ setLoading(false);
319
+ }
320
+
321
+ const handleEnterPrompt = () => {
322
+ if(!player_id){ return onRequestAuthentication(); }
323
+ return setShowEnterPrompt(true);
324
+ }
325
+
326
+ const handleEnterCompetition = async(promo_balance?:boolean) => {
327
+ if(loading){ return }
328
+ setShowEnterPrompt(false);
329
+ setLoading(true);
330
+
331
+ const response = await CompetitionPlayerApi.joinCompetition({
332
+ ...CompetitionHelpers.getCompetitionPlayer(competition_id),
333
+ promo_balance
334
+ })
335
+ setCompetitionData({
336
+ ...competition_data,
337
+ competition: response.competition,
338
+ competition_players: competition_players.filter(cp => cp.competition_player_id != response.competition_player.competition_player_id).concat(response.competition_player)
339
+ })
340
+ setLoading(false);
341
+ }
342
+
343
+ const handleLeaveCompetition = async() => {
344
+ if(!authenticated_competition_player){ return }
345
+ setLoading(true);
346
+ const response = await CompetitionPlayerApi.leaveCompetition(authenticated_competition_player)
347
+ setCompetitionData({
348
+ ...competition_data,
349
+ competition: response.competition,
350
+ competition_players: competition_players.filter(cp => cp.competition_player_id != response.competition_player.competition_player_id).concat(response.competition_player)
351
+ })
352
+ setLoading(false)
353
+ }
354
+
355
+ const handleShowComplete = async() => {
356
+ setShowCompleted(!show_completed)
357
+ if(!complete_loaded){
358
+ await CompetitionMatchApi.getCompetitionMatchesByCompetitionId(competition_id, 'closed')
359
+ setCompleteLoaded(true)
360
+ }
361
+ }
362
+
363
+ const handlePick = async(pp:PlayerPickProps, event_title:string, event_start:string) => {
364
+ if(!competition){ return }
365
+ if(!player_id){
366
+ return onRequestAuthentication()
367
+ }
368
+ if(!authenticated_competition_player){ return setShowEnterPrompt(true); }
369
+ if(!competition_type){ return alert('Unable to process pick') }
370
+
371
+ setPickLoading(pp.competition_match_id)
372
+ //If the pick needs to be removed
373
+ if(pp.player_pick_id && pp.player_pick_id != ''){
374
+ const rem_pp = await PlayerPicksApi.removePlayerPick(pp.player_pick_id)
375
+ setMyData({
376
+ ...my_data,
377
+ player_picks: player_picks.filter(ps => ps.player_pick_id != rem_pp.player_pick.player_pick_id)
378
+ })
379
+ setPickLoading(undefined)
380
+ return
381
+ }
382
+
383
+ //If this is a new pick
384
+ //First check to see if they already have one on the market / event combo
385
+ let existing_pick = player_picks.find(p => p.competition_match_id == pp.competition_match_id && p.market_id == pp.market_id)
386
+ if(existing_pick){
387
+ setPickLoading(undefined)
388
+ return alert('Can only pick one side of each market. Remove the other side before selecting this one.')
389
+ }
390
+
391
+ if(competition_type.type == 'pick'){
392
+ if(player_picks.length >= competition.max_pick_count){
393
+ setPickLoading(undefined)
394
+ return alert('Already reached maximum picks')
395
+
396
+ }
397
+ const new_pp = await PlayerPicksApi.createPlayerPick(pp)
398
+ setMyData({
399
+ ...my_data,
400
+ player_picks: player_picks.filter(ps => ps.player_pick_id != new_pp.player_pick.player_pick_id).concat(new_pp.player_pick)
401
+ })
402
+ setPickLoading(undefined)
403
+ }
404
+ if(competition_type.type == 'wager'){
405
+ setPickLoading(undefined)
406
+ setDraftPlayerPick({ draft_pick: pp, event_start, event_title })
407
+ }
408
+ }
409
+
410
+ const handleWagerSubmit = async(pp:PlayerPickProps) => {
411
+ setPickLoading(pp.competition_match_id)
412
+ const new_pp = await PlayerPicksApi.createPlayerPick(pp)
413
+ setMyData({
414
+ ...my_data,
415
+ player_picks: player_picks.filter(ps => ps.player_pick_id != new_pp.player_pick.player_pick_id).concat(new_pp.player_pick)
416
+ })
417
+ setDraftPlayerPick({})
418
+ setPickLoading(undefined)
419
+ }
420
+
421
+ const renderAthleteEvents = (data: { item:CompetitionMatchProps, index:number }) => {
422
+ const event = events.find(e => e.event_id == data.item.event_id);
423
+ if(!event || !competition || !competition_type){ return <></> }
424
+ const athlete = athletes.find(a => a.athlete_id == data.item.side_id_override);
425
+ if(!athlete){ return <></> }
426
+ const match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == data.item.competition_match_id)
427
+ const event_picks = player_picks.filter(pp => pp.competition_match_id == data.item.competition_match_id)
428
+ const isLoading = pick_loading == data.item.competition_match_id ? true : false
429
+ if(match_markets.length != 2){ return <></> }
430
+ return (
431
+ <View style={{ minWidth:150, flex:1, flexGrow:1, margin:5, borderWidth:1, borderColor:Colors.shades.shade600, borderRadius:8, backgroundColor:Colors.shades.white, ...view_styles.float }}>
432
+ <AthleteMarketCard
433
+ event={event}
434
+ athlete={athlete}
435
+ competition={competition}
436
+ competition_type={competition_type}
437
+ markets={markets}
438
+ competition_match={data.item}
439
+ mode='play'
440
+ orientation="vertical"
441
+ onPick={(pp, event_title, event_start) => handlePick(pp, event_title, event_start)}
442
+ competition_match_markets={match_markets}
443
+ player_picks={event_picks}
444
+ loading={isLoading}
445
+ />
446
+ </View>
447
+ )
448
+ }
449
+
450
+ const renderEvents = (data:{ item:CompetitionMatchProps, index:number }) => {
451
+ const event = events.find(e => e.event_id == data.item.event_id);
452
+ if(!event || !competition || !competition_type){ return <></> }
453
+ const match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == data.item.competition_match_id);
454
+ const event_picks = player_picks.filter(pp => pp.competition_match_id == data.item.competition_match_id);
455
+ const isLoading = pick_loading == data.item.competition_match_id ? true : false
456
+ return (
457
+ <View style={{ flex:1, flexGrow:1, margin:5 }}>
458
+ <TeamEventCard
459
+ event={event}
460
+ markets={markets}
461
+ competition={competition}
462
+ competition_type={competition_type}
463
+ player_picks={event_picks}
464
+ mode='play'
465
+ loading={isLoading}
466
+ onPick={(pp, event_title, event_start) => handlePick(pp, event_title, event_start)}
467
+ competition_match={data.item}
468
+ competition_match_markets={match_markets}
469
+ />
470
+ </View>
471
+ )
472
+ }
473
+
474
+ const renderNonPrimaryMarkets = (data:{ item:string, index: number, event_id:string, event_type:string }) => {
475
+ const market = markets.find(m => m.market_id == data.item);
476
+ if(!market){ return <></> }
477
+
478
+ const athlete_non_primary_matches = competition_matches.filter(cm => cm.market_id_override == data.item && cm.side_type_override == 'athlete' && cm.event_id == data.event_id && cm.event_type == data.event_type);
479
+
480
+ return (
481
+ <View>
482
+ <LinearDiagnal label_size={12} label={market.description} left_color={Colors.brand.midnight} right_color={Colors.brand.midnightTopGradient}/>
483
+ <View style={{ flexDirection:'row', flexWrap:'wrap', justifyContent:'center', paddingTop:10, paddingBottom:10 }}>
484
+ {athlete_non_primary_matches.map((cm,i) => {
485
+ return renderAthleteEvents({ item: cm, index:i })
486
+ })}
487
+ </View>
488
+ </View>
489
+ )
490
+ }
491
+
492
+ const renderMatchEvents = (data: { item: CompetitionMatchProps, index:number }) => {
493
+ const match = matches.find(m => m.match_id == data.item.event_id);
494
+ if(!match || !competition || !competition_type){ return <></> }
495
+ const away_athlete = athletes.find(a => a.athlete_id == match.participants[0])
496
+ const home_athlete = athletes.find(a => a.athlete_id == match.participants[1])
497
+ const match_markets = competition_match_markets.filter(cmm => cmm.competition_match_id == data.item.competition_match_id)
498
+ const event_picks = player_picks.filter(pp => pp.competition_match_id == data.item.competition_match_id)
499
+ const isLoading = pick_loading == data.item.competition_match_id ? true : false
500
+
501
+ return (
502
+ <View style={{ minWidth:200, flex:1, flexGrow:1, margin:5, borderWidth:1, borderColor:Colors.shades.shade600, borderRadius:8, backgroundColor:Colors.shades.white, ...view_styles.float }}>
503
+ <MatchMarketCard
504
+ competition={competition}
505
+ competition_type={competition_type}
506
+ match={match}
507
+ away_athlete={away_athlete}
508
+ home_athlete={home_athlete}
509
+ markets={markets}
510
+ competition_match={data.item}
511
+ competition_match_markets={match_markets}
512
+ player_picks={event_picks}
513
+ loading={isLoading}
514
+ onPick={(pp, event_title, event_start) => handlePick(pp, event_title, event_start)}
515
+ mode='play'
516
+ />
517
+ </View>
518
+ )
519
+ }
520
+
521
+
522
+ const renderTournaments = (data: {item:string, index:number}) => {
523
+ const tournament = tournaments.find(t => t.tournament_id == data.item)
524
+ if(!tournament){ return <></> }
525
+ const tournament_matches = Object.values(matches).filter(m => m.tournament_id == data.item).sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())
526
+ if(tournament_matches.length == 0){ return <></> }
527
+
528
+ //Now lets get all the competition_matches that include these match ids
529
+ const match_matches = competition_matches.filter(cm => cm.event_type == 'match' && tournament_matches.map(tm => tm.match_id.toString()).includes(cm.event_id).toString())
530
+
531
+ const league = leagues.find(l => l.league_id == tournament.league_id);
532
+ //const expanded = expanded_markets.includes(data.item) ? true : false
533
+ return (
534
+ <LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[Colors.shades.white, '#F8F8F8']} style={{ minWidth:350, flex:1, flexGrow:1, margin:10, borderWidth:1, borderColor:Colors.shades.shade100, borderRadius:8, ...view_styles.float }}>
535
+ <View style={{ padding:10, flexDirection:'row', borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
536
+ {league ?
537
+ <Text size={14} color={Colors.brand.midnight} weight='bold'>{league.league_name}: </Text>
538
+ :<></>}
539
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='bold'>{tournament.tournament_name}</Text>
540
+ <Text size={14} color={Colors.brand.midnight} weight='regular'>{tournament.scheduled_datetime == 'scheduled' ? moment(tournament.scheduled_datetime).format('MM/DD @ hh:mm a'): tournament.time_detail}</Text>
541
+ </View>
542
+
543
+ <LinearDiagnal label_size={12} label="Matches" left_color={Colors.brand.midnight} right_color={Colors.brand.midnightTopGradient}/>
544
+ <View style={{ flexDirection:'row', flexWrap:'wrap', justifyContent:'center', paddingTop:10, paddingBottom:10 }}>
545
+ {match_matches.map((cm, i) => {
546
+ return renderMatchEvents({ item: cm, index: i })
547
+ })}
548
+ </View>
549
+ </LinearGradient>
550
+ )
551
+ }
552
+
553
+ const renderTeamEvents = (data: {item:string, index:number}) => {
554
+ const event = events.find(e => e.event_id == data.item)//[data.item]
555
+ if(!event){ return <></> }
556
+ const league = leagues.find(l => l.league_id == event.league_id);
557
+ const team_primary_matches = competition_matches.filter(cm => cm.event_type == 'team' && cm.event_id == data.item && !cm.market_id_override);
558
+ const non_primary_markets = [ ... new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.event_id == data.item && cm.market_id_override).map(cm => cm.market_id_override ?? ''))]
559
+ const expanded = expanded_markets.includes(data.item) ? true : false
560
+ return (
561
+ <LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[Colors.shades.white, '#F8F8F8']} style={{ minWidth:350, flex:1, flexGrow:1, margin:10, borderWidth:1, borderColor:Colors.shades.shade100, borderRadius:8, ...view_styles.float }}>
562
+ <View style={{ padding:10, flexDirection:'row', borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
563
+ {league ?
564
+ <Text size={14} color={Colors.brand.midnight} weight='bold'>{league.league_name}: </Text>
565
+ :<></>}
566
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='bold'>{event.event_title}</Text>
567
+ <Text size={14} color={Colors.brand.midnight} weight='regular'>{event.time_detail == 'scheduled' ? moment(event.scheduled_datetime).format('MM/DD @ hh:mm a'): event.time_detail}</Text>
568
+ </View>
569
+
570
+ <LinearDiagnal label_size={12} label="Primary Markets" left_color={Colors.brand.midnight} right_color={Colors.brand.midnightTopGradient}/>
571
+ {team_primary_matches.map((cm, i) => {
572
+ return renderEvents({ item: cm, index: i })
573
+ })}
574
+ {non_primary_markets.length > 0 ?
575
+ <View style={{ borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
576
+ {expanded ?
577
+ <View>
578
+ {non_primary_markets.map((id, i) => {
579
+ return renderNonPrimaryMarkets({ item:id, index:i, event_id: data.item, event_type: 'team' })
580
+ })}
581
+ </View>
582
+ :<></>}
583
+ <TouchableOpacity style={{ flexDirection:'row', alignItems:'center', padding:15, borderTopWidth:1, borderColor:Colors.shades.shade600 }} onPress={() => expanded ? setExpandedMarkets(expanded_markets.filter(m => m != data.item)): setExpandedMarkets(expanded_markets.concat(data.item))}>
584
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='semibold'>{expanded?'Hide Markets':`${non_primary_markets.length} More Markets` }</Text>
585
+ <Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.brand.midnight} size={8}/>
586
+ </TouchableOpacity>
587
+ </View>
588
+ :<></>}
589
+ </LinearGradient>
590
+ )
591
+ }
592
+
593
+
594
+ if(loading || !competition || !competition_type || !competition_result_type){
595
+ return (
596
+ <View style={{ flex:1, backgroundColor:Colors.shades.white }}>
597
+ {company ?
598
+ <View style={{ flexDirection:'row', alignItems:'center', padding:15, backgroundColor:company?.brand_primary ?? Colors.shades.shade100 }}>
599
+ {back_allowed ?
600
+ <TouchableOpacity style={{ paddingRight:20 }} onPress={() => onGoBack ? onGoBack() : console.log('')}>
601
+ <Icons.ChevronIcon direction="left" size={14} color={company?.brand_secondary ?? Colors.brand.midnight} />
602
+ </TouchableOpacity>
603
+ :<></>}
604
+ <Text style={{ flex:1 }} size={14} color={company?.brand_secondary ?? Colors.brand.midnight} weight='bold' textAlign="center">Brought to you by {company?company.company_name:'BettorEdge'}</Text>
605
+ </View>
606
+ :<></>}
607
+ <ActivityIndicator style={{ padding:20 }} size='large' color={Colors.brand.midnight} />
608
+ </View>
609
+ )
610
+ }
611
+
612
+
613
+ return (
614
+ <View style={{ flex:1, backgroundColor:Colors.shades.shade100 }}>
615
+ <ScrollView style={{ flex:1 }}>
616
+ {company ?
617
+ <View style={{ flexDirection:'row', alignItems:'center', padding:15, backgroundColor:company?.brand_primary ?? Colors.shades.shade100 }}>
618
+ {back_allowed ?
619
+ <TouchableOpacity style={{ paddingRight:20 }} onPress={() => onGoBack ? onGoBack() : console.log('')}>
620
+ <Icons.ChevronIcon direction="left" size={14} color={company?.brand_secondary ?? Colors.brand.midnight} />
621
+ </TouchableOpacity>
622
+ :<></>}
623
+ <Text style={{ flex:1 }} size={14} color={company?.brand_secondary ?? Colors.brand.midnight} weight='bold' textAlign="center">Brought to you by {company?company.company_name:'BettorEdge'}</Text>
624
+ </View>
625
+ :<></>}
626
+ <View nativeID="cometition_header" style={{ minWidth:300, backgroundColor:Colors.brand.midnight }}>
627
+ <CompetitionInfoCard
628
+ player={player}
629
+ competition={competition}
630
+ competition_type={competition_type}
631
+ onEnter={() => handleEnterPrompt()}
632
+ can_leave={can_leave}
633
+ onViewRules={() => setShowRules(true)}
634
+ onViewPrize={() => {
635
+ setNavOutPrompt({
636
+ visible: true,
637
+ cancel_title: 'CLOSE',
638
+ title: 'Competition Additional Prize!',
639
+ body: competition.prize_override,
640
+ image_url: competition.prize_image?.url,
641
+ hide_accept: true
642
+ })
643
+ }}
644
+ onLeave={() => handleLeaveCompetition()}
645
+ onViewEvents={() => console.log('VIEW!')}
646
+
647
+ />
648
+ </View>
649
+ {competition_season ?
650
+ <TouchableOpacity style={{ backgroundColor:Colors.incentive.gold, padding:10 }} onPress={() => setShowSeason(true)}>
651
+ <Text size={18} color={Colors.shades.white} weight='bold'>Competition Season</Text>
652
+ <View nativeID="competition_leaderboard" style={{ marginTop:5, flexDirection:'row', alignItems:'center'}}>
653
+ <View style={{ padding:5 }}>
654
+ <Image
655
+ source={{ uri: competition_season.image?.url }}
656
+ style={{ height:50, width:75, borderRadius:8 }}
657
+ resizeMode="cover"
658
+ />
659
+ </View>
660
+ <View style={{ flex:1 }}>
661
+ <Text size={14} color={Colors.shades.white} weight='semibold'>{competition_season.season_name}</Text>
662
+ <Text style={{ marginTop:3 }} size={14} color={Colors.shades.white} weight='regular'>{competition_season.season_description}</Text>
663
+ </View>
664
+ <View style={{ padding:5 }}>
665
+ <Icons.ChevronIcon direction="right" color={Colors.shades.white} size={16}/>
666
+ </View>
667
+ </View>
668
+ </TouchableOpacity>
669
+ :<></>}
670
+ <View nativeID="competition_leaderboard" style={{ minWidth:300, padding:10 }}>
671
+ <Text size={18} color={Colors.brand.midnight} weight='bold'>Competition Leaderboard</Text>
672
+ <View style={{ marginTop:10 }}>
673
+ <CompetitionLeaderboard
674
+ competition={competition}
675
+ competition_type={competition_type}
676
+ height={height}
677
+ onLeaderSelect={(player) => setViewingLeader(player)}
678
+ view_mode="short"
679
+ onSeeFull={() => setShowFullLeaderboard(true)}
680
+ viewer_id={player?.player_id}
681
+ />
682
+ </View>
683
+ </View>
684
+ <View nativeID="competition_picks" style={{ backgroundColor:Colors.shades.white, marginTop:5 }}>
685
+ {competition?.status != 'closed' ?
686
+ <View nativeID="upcoming_picks">
687
+ <View style={{flexDirection:'row', alignItems:'center', justifyContent:'space-between', marginBottom:15}} >
688
+ <ImageBackground style={{ flex:1, flexDirection:'row', alignItems:'center', width:width }} resizeMode="cover" source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1691609143/diagnal_header_l4kw7u.png' }}>
689
+ <View style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10 }}>
690
+ <Text size={18} color={Colors.shades.white} weight='bold'>Upcoming Events</Text>
691
+ <View style={{marginLeft:8, borderRadius:100, height:24, width:24, backgroundColor:Colors.highlights.highlight200, justifyContent:'center', alignItems:'center'}}>
692
+ <Text size={12} color={Colors.shades.white} weight='bold' textAlign='center'>{player_picks.filter(pp => pp.status == 'inprogress').length}</Text>
693
+ </View>
694
+ </View>
695
+ {authenticated_competition_player ?
696
+ <SpringView
697
+ slide="horizontal"
698
+ from={200}
699
+ to={0}
700
+ style={{ flex:1, flexDirection:'row', borderTopLeftRadius:22, borderBottomLeftRadius:22, padding:10, alignItems:'center', backgroundColor:Colors.utility.success, ...view_styles.float }}
701
+ >
702
+ { competition_type?.type == 'wager' ?
703
+ <Text style={{ flex:1 }} size={14} color={Colors.shades.white} weight='semibold' textAlign="right">{authenticated_competition_player.wager_based_balance.toFixed(2)} Remaining</Text>
704
+ :
705
+ <Text style={{ flex:1 }} size={14} color={Colors.shades.white} weight='semibold' textAlign="right">{competition.max_pick_count - player_picks.length} Picks Remaining</Text>
706
+ }
707
+ </SpringView>
708
+ :<></>}
709
+ </ImageBackground>
710
+ </View>
711
+ <FlatList
712
+ data={ip_team_event_ids}
713
+ renderItem={renderTeamEvents}
714
+ keyExtractor={(item) => item}
715
+ />
716
+ <FlatList
717
+ data={unique_tournaments}
718
+ renderItem={renderTournaments}
719
+ keyExtractor={(item) => item}
720
+ />
721
+ </View>
722
+ :<></>}
723
+ <View nativeID="closed_picks">
724
+ <TouchableOpacity style={{ padding:10, marginBottom:15, flexDirection:'row', alignItems:'center', justifyContent:'space-between', backgroundColor:Colors.brand.midnight, marginTop:15 }} onPress={() => handleShowComplete()}>
725
+ <View style={{flexDirection:'row', alignItems:'center'}}>
726
+ <Text size={18} color={Colors.shades.white} weight='bold'>Completed</Text>
727
+ <View style={{marginLeft:8, borderRadius:100, height:24, width:24, backgroundColor:Colors.highlights.highlight200, justifyContent:'center', alignItems:'center'}}>
728
+ <Text size={12} color={Colors.shades.white} weight='bold' textAlign='center'>{player_picks.filter(p => p.status === 'closed').length}</Text>
729
+ </View>
730
+ </View>
731
+ <Icons.ChevronIcon color={Colors.shades.white} direction={show_completed?'up':'down'} size={14} />
732
+ </TouchableOpacity>
733
+ {show_completed ?
734
+ <View>
735
+ <FlatList
736
+ data={closed_team_event_ids}
737
+ renderItem={renderTeamEvents}
738
+ keyExtractor={(item) => item}
739
+ />
740
+ </View>
741
+ :<></>}
742
+ </View>
743
+ </View>
744
+ </ScrollView>
745
+ {player && !hide_player ?
746
+ <View style={{ flexDirection:'row', padding:10, backgroundColor:Colors.shades.shade100, borderBottomLeftRadius:22, borderBottomRightRadius:22 }}>
747
+ <TouchableOpacity style={{ flex:1, flexDirection:'row', alignItems:'center' }} onPress={() => setProfileVisible(!profile_visible)}>
748
+ <View>
749
+ <Image
750
+ source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1689262384/default-avatar_bbkn2t.png' }}
751
+ style={{ height:40, width:40, borderRadius:100 }}
752
+ resizeMode='cover'
753
+ />
754
+ </View>
755
+ <View style={{ flex:1, flexDirection:'row', marginLeft:10 }}>
756
+ <View>
757
+ <Text size={12} color={Colors.brand.midnight} weight='regular'>Playing as</Text>
758
+ <Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='bold'>{player.username}</Text>
759
+ </View>
760
+ </View>
761
+ </TouchableOpacity>
762
+ {player_balance ?
763
+ <View>
764
+ <Text size={12} color={Colors.brand.midnight} textAlign="right">{competition.market_type == 'FOR_MONEY' ? 'USD' : 'Edge Coins'}</Text>
765
+ <Text style={{ marginTop:3 }} size={14} color={Colors.brand.midnight} weight='bold' textAlign="right">{competition.market_type == 'FOR_MONEY' ? `$${player_balance.balance.toFixed(2)}`:`E${player_balance.free_market_balance.toFixed(2)}`}</Text>
766
+ </View>
767
+ :<></>}
768
+ </View>
769
+ :<></>}
770
+ {show_full_leaderboard ?
771
+ <View
772
+ style={{ flex:1, position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded }}>
773
+ <SpringView
774
+ slide='vertical'
775
+ to={0}
776
+ from={1000}
777
+ >
778
+ <CompetitionLeaderboard
779
+ competition={competition}
780
+ competition_type={competition_type}
781
+ height={height}
782
+ onSeeFull={() => setShowFullLeaderboard(false)}
783
+ view_mode="full"
784
+ onLeaderSelect={(player) => setViewingLeader(player)}
785
+ viewer_id={player?.player_id}
786
+ />
787
+ </SpringView>
788
+ </View>
789
+ :<></>}
790
+ {viewing_leader ?
791
+ <View
792
+ style={{ flex:1, position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded }}>
793
+ <SpringView
794
+ slide='vertical'
795
+ to={0}
796
+ style={{ flex:1 }}
797
+ from={1000}
798
+ >
799
+ <LeaderPicks
800
+ height={height}
801
+ markets={markets}
802
+ competition_type={competition_type}
803
+ competition_matches={competition_matches}
804
+ competition_match_markets={competition_match_markets}
805
+ events={events}
806
+ matches={matches}
807
+ tournaments={tournaments}
808
+ athletes={athletes}
809
+ teams={[]}
810
+ competition={competition}
811
+ leader={viewing_leader}
812
+ onClose={() => setViewingLeader(undefined)}
813
+ />
814
+ </SpringView>
815
+ </View>
816
+ :<></>}
817
+ {draft_player_pick?.draft_pick ?
818
+ <View
819
+ style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
820
+ <SpringView
821
+ slide='vertical'
822
+ to={0}
823
+ from={200}
824
+ >
825
+ <WagerPickForm
826
+ event_start={draft_player_pick.event_start ?? ''}
827
+ event_title={draft_player_pick.event_title ?? ''}
828
+ width={width}
829
+ balance={authenticated_competition_player?.wager_based_balance ?? 0}
830
+ loading={pick_loading}
831
+ player_pick={draft_player_pick.draft_pick}
832
+ onCancel={() => setDraftPlayerPick({})}
833
+ onSubmit={(pp) => handleWagerSubmit(pp)}
834
+ />
835
+ </SpringView>
836
+ </View>
837
+ :<></>}
838
+ {show_season && competition_season && competition.competition_season_id ?
839
+ <View
840
+ style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
841
+ <SpringView
842
+ slide='vertical'
843
+ to={0}
844
+ from={1000}
845
+ >
846
+ <SeasonInfoModal
847
+ competition_season={competition_season}
848
+ competition_types={competition_types}
849
+ competition_result_types={competition_result_types}
850
+ width={width}
851
+ height={height}
852
+ onSelectCompetition={(competition) => {
853
+ setShowSeason(false);
854
+ if(onChangeCompetition){ return onChangeCompetition(competition.competition_id) }
855
+ }}
856
+ onClose={() => setShowSeason(false)}
857
+ />
858
+ </SpringView>
859
+ </View>
860
+ :<></>}
861
+ {show_enter_prompt ?
862
+ <View
863
+ style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
864
+ <SpringView
865
+ slide='vertical'
866
+ to={0}
867
+ from={200}
868
+ >
869
+ <EnterCompetitionPrompt
870
+ player={player}
871
+ width={width}
872
+ competition={competition}
873
+ competition_type={competition_type}
874
+ competition_result_type={competition_result_type}
875
+ onVerify={() => handleProfile('unverified')}
876
+ onCancel={() => setShowEnterPrompt(false)}
877
+ onEnter={(promo_balance) => handleEnterCompetition(promo_balance)}
878
+ />
879
+ </SpringView>
880
+ </View>
881
+ :<></>}
882
+ {show_rules ?
883
+ <View
884
+ style={{ position:'absolute', top:0, right:0, left:0, bottom:0, padding:10, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
885
+ <SpringView
886
+ slide='vertical'
887
+ to={0}
888
+ from={1000}
889
+ >
890
+ <CompetitionTypeCard
891
+ visible={show_rules ? true : false}
892
+ init_view="type"
893
+ onClose={() => setShowRules(false)}
894
+ competition={competition}
895
+ competition_type={competition_type}
896
+ competition_result_type={competition_result_type}
897
+ competition_payout_types={competition_payout_types}
898
+
899
+
900
+ />
901
+ </SpringView>
902
+ </View>
903
+ :<></>}
904
+ {nav_out_prompt.visible ?
905
+ <View
906
+ style={{ flex:1, position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
907
+ <SpringView
908
+ slide='vertical'
909
+ to={0}
910
+ from={1000}
911
+ >
912
+ <NavOutPrompt
913
+ accept_title={nav_out_prompt.accept_title}
914
+ body={nav_out_prompt.body ?? ''}
915
+ cancel_title={nav_out_prompt.cancel_title}
916
+ code_details={code_details}
917
+ title={nav_out_prompt.title ?? ''}
918
+ max_width={width* 0.8}
919
+ hide_accept={nav_out_prompt.hide_accept}
920
+ image_url={nav_out_prompt.image_url}
921
+ onCancel={() => setNavOutPrompt({ visible: false })}
922
+ onAccept={() => {
923
+ if(nav_out_prompt.url){
924
+ window.open(nav_out_prompt.url, '_blank')
925
+ }
926
+ setNavOutPrompt({ visible: false })
927
+ }}
928
+ />
929
+ </SpringView>
930
+ </View>
931
+ :<></>}
932
+ </View>
933
+ )
934
+ }
935
+
936
+ export default CompetitionPlay