be-components 6.7.8 → 6.8.0

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 (255) hide show
  1. package/lib/commonjs/Authenticator/index.js +1 -0
  2. package/lib/commonjs/Authenticator/index.js.map +1 -1
  3. package/lib/commonjs/Competition/components/CompetitionInfoCard.js +13 -0
  4. package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -1
  5. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +1 -1
  6. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
  7. package/lib/commonjs/Competition/index.js +26 -43
  8. package/lib/commonjs/Competition/index.js.map +1 -1
  9. package/lib/commonjs/CompetitionManager/api/index.js +57 -11
  10. package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
  11. package/lib/commonjs/CompetitionManager/components/AdminCompetitionList.js +406 -287
  12. package/lib/commonjs/CompetitionManager/components/AdminCompetitionList.js.map +1 -1
  13. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js +11 -3
  14. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js.map +1 -1
  15. package/lib/commonjs/CompetitionManager/components/CompanySelector.js +94 -0
  16. package/lib/commonjs/CompetitionManager/components/CompanySelector.js.map +1 -0
  17. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +135 -107
  18. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  19. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js +5 -5
  20. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js.map +1 -1
  21. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +80 -34
  22. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  23. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js +12 -8
  24. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -1
  25. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +36 -30
  26. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  27. package/lib/commonjs/CompetitionManager/components/ContestSelector.js +4 -2
  28. package/lib/commonjs/CompetitionManager/components/ContestSelector.js.map +1 -1
  29. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +37 -33
  30. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  31. package/lib/commonjs/CompetitionManager/components/GroupSelector.js +94 -0
  32. package/lib/commonjs/CompetitionManager/components/GroupSelector.js.map +1 -0
  33. package/lib/commonjs/CompetitionManager/components/MarketSelector.js +21 -12
  34. package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -1
  35. package/lib/commonjs/CompetitionManager/components/PlayerSelector.js +4 -1
  36. package/lib/commonjs/CompetitionManager/components/PlayerSelector.js.map +1 -1
  37. package/lib/commonjs/CompetitionManager/index.js +44 -49
  38. package/lib/commonjs/CompetitionManager/index.js.map +1 -1
  39. package/lib/commonjs/Components/Toggle.js +2 -1
  40. package/lib/commonjs/Components/Toggle.js.map +1 -1
  41. package/lib/commonjs/CreateEngagement/api/index.js +192 -0
  42. package/lib/commonjs/CreateEngagement/api/index.js.map +1 -0
  43. package/lib/commonjs/CreateEngagement/index.js +1400 -0
  44. package/lib/commonjs/CreateEngagement/index.js.map +1 -0
  45. package/lib/commonjs/MarketComponents/api/index.js +51 -1
  46. package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
  47. package/lib/commonjs/MarketComponents/components/LeagueSchedule.js +210 -0
  48. package/lib/commonjs/MarketComponents/components/LeagueSchedule.js.map +1 -0
  49. package/lib/commonjs/constants/useColors.js +1 -1
  50. package/lib/commonjs/constants/useColors.js.map +1 -1
  51. package/lib/commonjs/index.js +7 -0
  52. package/lib/commonjs/index.js.map +1 -1
  53. package/lib/commonjs/types.d.js.map +1 -1
  54. package/lib/module/Authenticator/index.js +1 -0
  55. package/lib/module/Authenticator/index.js.map +1 -1
  56. package/lib/module/Competition/components/CompetitionInfoCard.js +13 -0
  57. package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -1
  58. package/lib/module/Competition/components/CompetitionLeaderboard.js +1 -1
  59. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
  60. package/lib/module/Competition/index.js +26 -43
  61. package/lib/module/Competition/index.js.map +1 -1
  62. package/lib/module/CompetitionManager/api/index.js +57 -11
  63. package/lib/module/CompetitionManager/api/index.js.map +1 -1
  64. package/lib/module/CompetitionManager/components/AdminCompetitionList.js +391 -272
  65. package/lib/module/CompetitionManager/components/AdminCompetitionList.js.map +1 -1
  66. package/lib/module/CompetitionManager/components/AthleteSelector.js +11 -3
  67. package/lib/module/CompetitionManager/components/AthleteSelector.js.map +1 -1
  68. package/lib/module/CompetitionManager/components/CompanySelector.js +87 -0
  69. package/lib/module/CompetitionManager/components/CompanySelector.js.map +1 -0
  70. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +135 -107
  71. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  72. package/lib/module/CompetitionManager/components/CompetitionHeader.js +5 -5
  73. package/lib/module/CompetitionManager/components/CompetitionHeader.js.map +1 -1
  74. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +80 -34
  75. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  76. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js +12 -8
  77. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -1
  78. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +36 -30
  79. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  80. package/lib/module/CompetitionManager/components/ContestSelector.js +4 -2
  81. package/lib/module/CompetitionManager/components/ContestSelector.js.map +1 -1
  82. package/lib/module/CompetitionManager/components/ContestSettingsForm.js +37 -33
  83. package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  84. package/lib/module/CompetitionManager/components/GroupSelector.js +87 -0
  85. package/lib/module/CompetitionManager/components/GroupSelector.js.map +1 -0
  86. package/lib/module/CompetitionManager/components/MarketSelector.js +21 -12
  87. package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -1
  88. package/lib/module/CompetitionManager/components/PlayerSelector.js +4 -1
  89. package/lib/module/CompetitionManager/components/PlayerSelector.js.map +1 -1
  90. package/lib/module/CompetitionManager/index.js +45 -50
  91. package/lib/module/CompetitionManager/index.js.map +1 -1
  92. package/lib/module/Components/Toggle.js +2 -1
  93. package/lib/module/Components/Toggle.js.map +1 -1
  94. package/lib/module/CreateEngagement/api/index.js +186 -0
  95. package/lib/module/CreateEngagement/api/index.js.map +1 -0
  96. package/lib/module/CreateEngagement/index.js +1392 -0
  97. package/lib/module/CreateEngagement/index.js.map +1 -0
  98. package/lib/module/MarketComponents/api/index.js +51 -1
  99. package/lib/module/MarketComponents/api/index.js.map +1 -1
  100. package/lib/module/MarketComponents/components/LeagueSchedule.js +202 -0
  101. package/lib/module/MarketComponents/components/LeagueSchedule.js.map +1 -0
  102. package/lib/module/constants/useColors.js +1 -1
  103. package/lib/module/constants/useColors.js.map +1 -1
  104. package/lib/module/index.js +2 -1
  105. package/lib/module/index.js.map +1 -1
  106. package/lib/module/types.d.js.map +1 -1
  107. package/lib/typescript/lib/commonjs/Authenticator/index.d.ts.map +1 -1
  108. package/lib/typescript/lib/commonjs/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  109. package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
  110. package/lib/typescript/lib/commonjs/CompetitionManager/api/index.d.ts +9 -4
  111. package/lib/typescript/lib/commonjs/CompetitionManager/api/index.d.ts.map +1 -1
  112. package/lib/typescript/lib/commonjs/CompetitionManager/components/AdminCompetitionList.d.ts +4 -3
  113. package/lib/typescript/lib/commonjs/CompetitionManager/components/AdminCompetitionList.d.ts.map +1 -1
  114. package/lib/typescript/lib/commonjs/CompetitionManager/components/AthleteSelector.d.ts +3 -1
  115. package/lib/typescript/lib/commonjs/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  116. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompanySelector.d.ts +8 -0
  117. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompanySelector.d.ts.map +1 -0
  118. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts +2 -2
  119. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  120. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionHeader.d.ts +2 -1
  121. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  122. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts +3 -2
  123. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  124. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  125. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  126. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  127. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  128. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  129. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  130. package/lib/typescript/lib/commonjs/CompetitionManager/components/GroupSelector.d.ts +8 -0
  131. package/lib/typescript/lib/commonjs/CompetitionManager/components/GroupSelector.d.ts.map +1 -0
  132. package/lib/typescript/lib/commonjs/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  133. package/lib/typescript/lib/commonjs/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  134. package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts +4 -1
  135. package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts.map +1 -1
  136. package/lib/typescript/lib/commonjs/Components/Toggle.d.ts +2 -1
  137. package/lib/typescript/lib/commonjs/Components/Toggle.d.ts.map +1 -1
  138. package/lib/typescript/lib/commonjs/CreateEngagement/api/index.d.ts +39 -0
  139. package/lib/typescript/lib/commonjs/CreateEngagement/api/index.d.ts.map +1 -0
  140. package/lib/typescript/lib/commonjs/CreateEngagement/index.d.ts +18 -0
  141. package/lib/typescript/lib/commonjs/CreateEngagement/index.d.ts.map +1 -0
  142. package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts +8 -0
  143. package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts.map +1 -1
  144. package/lib/typescript/lib/commonjs/MarketComponents/components/LeagueSchedule.d.ts +8 -0
  145. package/lib/typescript/lib/commonjs/MarketComponents/components/LeagueSchedule.d.ts.map +1 -0
  146. package/lib/typescript/lib/commonjs/index.d.ts +1 -0
  147. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  148. package/lib/typescript/lib/module/Authenticator/index.d.ts.map +1 -1
  149. package/lib/typescript/lib/module/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  150. package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
  151. package/lib/typescript/lib/module/CompetitionManager/api/index.d.ts +9 -4
  152. package/lib/typescript/lib/module/CompetitionManager/api/index.d.ts.map +1 -1
  153. package/lib/typescript/lib/module/CompetitionManager/components/AdminCompetitionList.d.ts +5 -5
  154. package/lib/typescript/lib/module/CompetitionManager/components/AdminCompetitionList.d.ts.map +1 -1
  155. package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts +3 -1
  156. package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  157. package/lib/typescript/lib/module/CompetitionManager/components/CompanySelector.d.ts +8 -0
  158. package/lib/typescript/lib/module/CompetitionManager/components/CompanySelector.d.ts.map +1 -0
  159. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts +2 -2
  160. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  161. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts +2 -1
  162. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  163. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts +3 -2
  164. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  165. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  166. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  167. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  168. package/lib/typescript/lib/module/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  169. package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  170. package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  171. package/lib/typescript/lib/module/CompetitionManager/components/GroupSelector.d.ts +8 -0
  172. package/lib/typescript/lib/module/CompetitionManager/components/GroupSelector.d.ts.map +1 -0
  173. package/lib/typescript/lib/module/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  174. package/lib/typescript/lib/module/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  175. package/lib/typescript/lib/module/CompetitionManager/index.d.ts +4 -1
  176. package/lib/typescript/lib/module/CompetitionManager/index.d.ts.map +1 -1
  177. package/lib/typescript/lib/module/Components/Toggle.d.ts +2 -1
  178. package/lib/typescript/lib/module/Components/Toggle.d.ts.map +1 -1
  179. package/lib/typescript/lib/module/CreateEngagement/api/index.d.ts +38 -0
  180. package/lib/typescript/lib/module/CreateEngagement/api/index.d.ts.map +1 -0
  181. package/lib/typescript/lib/module/CreateEngagement/index.d.ts +18 -0
  182. package/lib/typescript/lib/module/CreateEngagement/index.d.ts.map +1 -0
  183. package/lib/typescript/lib/module/MarketComponents/api/index.d.ts +8 -0
  184. package/lib/typescript/lib/module/MarketComponents/api/index.d.ts.map +1 -1
  185. package/lib/typescript/lib/module/MarketComponents/components/LeagueSchedule.d.ts +8 -0
  186. package/lib/typescript/lib/module/MarketComponents/components/LeagueSchedule.d.ts.map +1 -0
  187. package/lib/typescript/lib/module/index.d.ts +2 -1
  188. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  189. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  190. package/lib/typescript/src/Competition/index.d.ts +1 -1
  191. package/lib/typescript/src/Competition/index.d.ts.map +1 -1
  192. package/lib/typescript/src/CompetitionManager/api/index.d.ts +13 -5
  193. package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
  194. package/lib/typescript/src/CompetitionManager/components/AdminCompetitionList.d.ts +5 -1
  195. package/lib/typescript/src/CompetitionManager/components/AdminCompetitionList.d.ts.map +1 -1
  196. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts +4 -2
  197. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  198. package/lib/typescript/src/CompetitionManager/components/CompanySelector.d.ts +10 -0
  199. package/lib/typescript/src/CompetitionManager/components/CompanySelector.d.ts.map +1 -0
  200. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +1 -2
  201. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  202. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts +3 -1
  203. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  204. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +4 -3
  205. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  206. package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  207. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  208. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  209. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  210. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  211. package/lib/typescript/src/CompetitionManager/components/GroupSelector.d.ts +10 -0
  212. package/lib/typescript/src/CompetitionManager/components/GroupSelector.d.ts.map +1 -0
  213. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  214. package/lib/typescript/src/CompetitionManager/index.d.ts +5 -1
  215. package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -1
  216. package/lib/typescript/src/Components/Toggle.d.ts +2 -1
  217. package/lib/typescript/src/Components/Toggle.d.ts.map +1 -1
  218. package/lib/typescript/src/CreateEngagement/api/index.d.ts +29 -0
  219. package/lib/typescript/src/CreateEngagement/api/index.d.ts.map +1 -0
  220. package/lib/typescript/src/CreateEngagement/index.d.ts +21 -0
  221. package/lib/typescript/src/CreateEngagement/index.d.ts.map +1 -0
  222. package/lib/typescript/src/MarketComponents/api/index.d.ts +8 -0
  223. package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -1
  224. package/lib/typescript/src/MarketComponents/components/LeagueSchedule.d.ts +10 -0
  225. package/lib/typescript/src/MarketComponents/components/LeagueSchedule.d.ts.map +1 -0
  226. package/lib/typescript/src/index.d.ts +2 -1
  227. package/lib/typescript/src/index.d.ts.map +1 -1
  228. package/package.json +1 -1
  229. package/src/Authenticator/index.tsx +1 -1
  230. package/src/Competition/components/CompetitionInfoCard.tsx +4 -0
  231. package/src/Competition/components/CompetitionLeaderboard.tsx +1 -1
  232. package/src/Competition/index.tsx +16 -29
  233. package/src/CompetitionManager/api/index.ts +49 -6
  234. package/src/CompetitionManager/components/AdminCompetitionList.tsx +247 -176
  235. package/src/CompetitionManager/components/AthleteSelector.tsx +14 -5
  236. package/src/CompetitionManager/components/CompanySelector.tsx +58 -0
  237. package/src/CompetitionManager/components/CompetitionContestsForm.tsx +96 -84
  238. package/src/CompetitionManager/components/CompetitionHeader.tsx +5 -4
  239. package/src/CompetitionManager/components/CompetitionInfoForm.tsx +59 -29
  240. package/src/CompetitionManager/components/CompetitionMatchMarketCard.tsx +9 -14
  241. package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +30 -36
  242. package/src/CompetitionManager/components/ContestSelector.tsx +2 -2
  243. package/src/CompetitionManager/components/ContestSettingsForm.tsx +24 -25
  244. package/src/CompetitionManager/components/GroupSelector.tsx +57 -0
  245. package/src/CompetitionManager/components/MarketSelector.tsx +14 -13
  246. package/src/CompetitionManager/components/PlayerSelector.tsx +1 -1
  247. package/src/CompetitionManager/index.tsx +49 -33
  248. package/src/Components/Toggle.tsx +3 -2
  249. package/src/CreateEngagement/api/index.ts +138 -0
  250. package/src/CreateEngagement/index.tsx +878 -0
  251. package/src/MarketComponents/api/index.ts +60 -1
  252. package/src/MarketComponents/components/LeagueSchedule.tsx +161 -0
  253. package/src/constants/useColors.tsx +1 -1
  254. package/src/index.tsx +2 -0
  255. package/src/types.d.ts +8 -2
@@ -0,0 +1,1392 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Button, Text, TextInput, View } from "../Components/Themed";
3
+ import { FlatList, Image } from 'react-native';
4
+ import { CreateEngagementApi, CreateEngagementHelpers } from './api';
5
+ import { Icons } from '../Components';
6
+ import { useColors } from '../constants/useColors';
7
+ import ImageUploader from '../Components/ImageUploader';
8
+ import moment from 'moment-mini';
9
+ import LeagueSchedule from '../MarketComponents/components/LeagueSchedule';
10
+ const sections = ['header', 'intro', 'step', 'info', 'groups', 'companies', 'create', 'image', 'success'];
11
+ const steps = [{
12
+ step_key: 'intro',
13
+ num: 1,
14
+ title: 'BettorEdge Engagements',
15
+ description: 'Create an engagement and share with friends to play along'
16
+ }, {
17
+ step_key: 'options',
18
+ num: 2,
19
+ title: 'Engagement Types',
20
+ description: 'Select an engagement type below to get started!'
21
+ }, {
22
+ step_key: 'group',
23
+ num: 3,
24
+ title: 'Add Group',
25
+ description: 'Select one of your groups to add this engagement to!'
26
+ }, {
27
+ step_key: 'company',
28
+ num: 4,
29
+ title: 'Add Company',
30
+ description: 'Select one of your companie to add this engagement to!'
31
+ }, {
32
+ step_key: 'image',
33
+ num: 5,
34
+ title: 'Add an Image!',
35
+ description: 'Add an image to your engagement to make it stand out!'
36
+ }, {
37
+ step_key: 'create',
38
+ num: 6,
39
+ title: 'Create Engagement',
40
+ description: 'Complete the step below to create this BettorEdge Engagement!'
41
+ }, {
42
+ step_key: 'success',
43
+ num: 7,
44
+ title: 'Engagement Successfully Created!',
45
+ description: 'Your engagement is in pending status. You can activate it when ready from your dashboard or the engagement screen!'
46
+ }];
47
+ const CreateEngagement = ({
48
+ float,
49
+ player,
50
+ init_engagement,
51
+ onFocusPostiion,
52
+ group_id,
53
+ company_id,
54
+ header_style,
55
+ footer_style,
56
+ onClose,
57
+ onCreateCompetition,
58
+ onCreateBracketCompetition,
59
+ onCreateSquaresCompetition,
60
+ onCreateFlashMarket
61
+ }) => {
62
+ const Colors = useColors();
63
+ const [size, setSize] = useState({
64
+ width: 0,
65
+ height: 0
66
+ });
67
+ const [draft_squares, setDraftSquares] = useState(undefined);
68
+ const [pending_engagement, setPendingEngagement] = useState({
69
+ create_loading: false
70
+ });
71
+ const [draft_competition, setDraftCompetition] = useState(undefined);
72
+ const [draft_image, setDraftImage] = useState(undefined);
73
+ const [active_step, setActiveStep] = useState(steps[0]);
74
+ const [state, setState] = useState({
75
+ loading: false,
76
+ groups: [],
77
+ companies: []
78
+ });
79
+ const {
80
+ active_engagment,
81
+ groups,
82
+ companies,
83
+ active_company,
84
+ active_group
85
+ } = state;
86
+ useEffect(() => {
87
+ CreateEngagementApi.setEnvironment();
88
+ loadStaticData();
89
+ }, [player?.player_id]);
90
+ const loadStaticData = async () => {
91
+ setState({
92
+ ...state,
93
+ loading: true
94
+ });
95
+ let my_grups = await CreateEngagementApi.getMyGroups(0);
96
+ let my_comps = await CreateEngagementApi.getMyCompanies();
97
+ let act_group = my_grups.groups.find(g => g.group_id == group_id);
98
+ let act_company = my_comps.companies.find(c => c.company_id == company_id);
99
+ setState({
100
+ ...state,
101
+ active_group: act_group,
102
+ active_engagment: init_engagement ? init_engagement : active_engagment,
103
+ active_company: act_company,
104
+ groups: my_grups.groups,
105
+ companies: my_comps.companies,
106
+ loading: false
107
+ });
108
+ };
109
+ const errors = CreateEngagementHelpers.isStepValid(active_step, active_engagment, draft_competition, draft_squares);
110
+ const handleNextStep = async () => {
111
+ if (errors.length > 0) {
112
+ return alert(errors.map(e => e));
113
+ }
114
+ let next_step = steps[active_step.num];
115
+ //if(!next_step){ return }
116
+ switch (active_step.step_key) {
117
+ case 'intro':
118
+ if (!next_step) {
119
+ return;
120
+ }
121
+ return setActiveStep(next_step);
122
+ case 'options':
123
+ let group_step = steps.find(s => s.step_key == 'group');
124
+ let company_step = steps.find(s => s.step_key == 'company');
125
+ let create_step = steps.find(s => s.step_key == 'create');
126
+ if (group_step && groups.length > 0) {
127
+ return setActiveStep(group_step);
128
+ }
129
+ if (company_step && companies.length > 0) {
130
+ return setActiveStep(company_step);
131
+ }
132
+ if (!create_step) {
133
+ return;
134
+ }
135
+ return setActiveStep(create_step);
136
+ case 'group':
137
+ let n_company_step = steps.find(s => s.step_key == 'company');
138
+ let n_create_step = steps.find(s => s.step_key == 'create');
139
+ if (n_company_step && companies.length > 0) {
140
+ return setActiveStep(n_company_step);
141
+ }
142
+ if (!n_create_step) {
143
+ return;
144
+ }
145
+ return setActiveStep(n_create_step);
146
+ case 'company':
147
+ if (!next_step) {
148
+ return;
149
+ }
150
+ return setActiveStep(next_step);
151
+ case 'image':
152
+ if (!next_step) {
153
+ return;
154
+ }
155
+ return setActiveStep(next_step);
156
+ case 'create':
157
+ switch (active_engagment) {
158
+ case 'competition':
159
+ if (!draft_competition) {
160
+ return;
161
+ }
162
+ if (errors.length > 0) {
163
+ return alert(errors.map(e => e));
164
+ }
165
+ if (!draft_competition.competition_type) {
166
+ return;
167
+ }
168
+ if (!draft_competition.competition_result_type) {
169
+ return;
170
+ }
171
+ setPendingEngagement({
172
+ ...pending_engagement,
173
+ create_loading: true
174
+ });
175
+ let new_competition = await CreateEngagementApi.createCompetition(draft_competition.competition_name, draft_competition.competition_description, draft_competition.competition_type.competition_type_id, draft_competition.competition_result_type.competition_result_type_id, active_company?.company_id, active_group?.group_id, draft_competition.pacer_id, draft_competition.competition_template_id, undefined, draft_image);
176
+ setPendingEngagement({
177
+ ...pending_engagement,
178
+ create_loading: false,
179
+ competition: new_competition
180
+ });
181
+ break;
182
+ case 'squares':
183
+ if (!draft_squares) {
184
+ return alert('Unable to process');
185
+ }
186
+ if (errors.length > 0) {
187
+ return alert(errors.map(e => e));
188
+ }
189
+ setPendingEngagement({
190
+ ...pending_engagement,
191
+ create_loading: true
192
+ });
193
+ const new_squares_comp = await CreateEngagementApi.createSquaresCompetition({
194
+ ...draft_squares,
195
+ image: draft_image,
196
+ company_id: active_company?.company_id,
197
+ group_id: active_group?.group_id
198
+ });
199
+ setPendingEngagement({
200
+ ...pending_engagement,
201
+ create_loading: false,
202
+ squares_competition: new_squares_comp
203
+ });
204
+ break;
205
+ default:
206
+ return;
207
+ //We cdont have one!
208
+ }
209
+ if (next_step) {
210
+ setActiveStep(next_step);
211
+ }
212
+ return;
213
+ case 'success':
214
+ switch (active_engagment) {
215
+ case 'competition':
216
+ if (!pending_engagement.competition) {
217
+ return alert('Unable to process');
218
+ }
219
+ return onCreateCompetition(pending_engagement.competition);
220
+ case 'bracket':
221
+ if (!pending_engagement.bracket_competition) {
222
+ return alert('Unable to process');
223
+ }
224
+ return onCreateBracketCompetition(pending_engagement.bracket_competition);
225
+ case 'squares':
226
+ if (!pending_engagement.squares_competition) {
227
+ return alert('Unable to process');
228
+ }
229
+ return onCreateSquaresCompetition(pending_engagement.squares_competition);
230
+ case 'flash':
231
+ if (!pending_engagement.poll) {
232
+ return alert('Unable to process');
233
+ }
234
+ return onCreateFlashMarket(pending_engagement.poll);
235
+ default:
236
+ return alert('Unable to process');
237
+ }
238
+ default:
239
+ return;
240
+ }
241
+ };
242
+ const renderSections = data => {
243
+ switch (data.item) {
244
+ case 'intro':
245
+ if (active_step.step_key != 'intro') {
246
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
247
+ }
248
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Image, {
249
+ source: {
250
+ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/w_1000,ar_16:9,c_fill,g_auto,e_sharpen/v1757428505/ChatGPT_Image_Sep_9_2025_09_34_28_AM_vzjage.png'
251
+ },
252
+ style: {
253
+ width: size.width,
254
+ height: size.width * 0.5
255
+ },
256
+ resizeMode: "cover"
257
+ }));
258
+ case 'header':
259
+ return /*#__PURE__*/React.createElement(View, {
260
+ type: "header",
261
+ style: {
262
+ flexDirection: 'row',
263
+ alignItems: 'center',
264
+ padding: 10,
265
+ ...header_style
266
+ }
267
+ }, draft_image?.url ? /*#__PURE__*/React.createElement(Image, {
268
+ source: {
269
+ uri: draft_image?.url
270
+ },
271
+ style: {
272
+ height: 50,
273
+ width: 50
274
+ },
275
+ resizeMode: "cover"
276
+ }) : active_engagment == 'competition' ? /*#__PURE__*/React.createElement(Icons.PickEmIcon, {
277
+ size: 20,
278
+ color: Colors.text.h1
279
+ }) : active_engagment == 'bracket' ? /*#__PURE__*/React.createElement(Icons.BracketIcon, {
280
+ size: 20,
281
+ color: Colors.text.h1
282
+ }) : active_engagment == 'squares' ? /*#__PURE__*/React.createElement(Icons.SquaresIcon, {
283
+ size: 20,
284
+ color: Colors.text.h1
285
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
286
+ transparent: true,
287
+ style: {
288
+ flex: 1,
289
+ marginLeft: 10,
290
+ marginRight: 10
291
+ }
292
+ }, /*#__PURE__*/React.createElement(Text, {
293
+ theme: "h1"
294
+ }, "Create ", active_engagment ? active_engagment : 'Engagement'), /*#__PURE__*/React.createElement(Text, {
295
+ theme: "description"
296
+ }, "Follow the steps below to create your engagement")), /*#__PURE__*/React.createElement(Button, {
297
+ title: "X",
298
+ float: true,
299
+ title_color: Colors.text.error,
300
+ onPress: () => onClose()
301
+ }));
302
+ case 'step':
303
+ return /*#__PURE__*/React.createElement(View, {
304
+ style: {
305
+ padding: 20
306
+ }
307
+ }, /*#__PURE__*/React.createElement(Text, {
308
+ theme: "h1",
309
+ size: 38
310
+ }, active_step.title), /*#__PURE__*/React.createElement(Text, {
311
+ theme: "description",
312
+ color: errors.length > 0 ? Colors.text.warning : Colors.text.success,
313
+ size: 16,
314
+ style: {
315
+ marginTop: 10
316
+ }
317
+ }, active_step.description));
318
+ case 'info':
319
+ switch (active_step.step_key) {
320
+ case 'intro':
321
+ return /*#__PURE__*/React.createElement(IntroInfo, null);
322
+ case 'options':
323
+ return /*#__PURE__*/React.createElement(View, {
324
+ style: {
325
+ padding: 10
326
+ }
327
+ }, /*#__PURE__*/React.createElement(EngagementOptions, {
328
+ active_engagement: active_engagment,
329
+ onSelectEngagement: e => {
330
+ if (e == active_engagment) {
331
+ return setState({
332
+ ...state,
333
+ active_engagment: undefined
334
+ });
335
+ }
336
+ return setState({
337
+ ...state,
338
+ active_engagment: e
339
+ });
340
+ }
341
+ }));
342
+ default:
343
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
344
+ }
345
+ case 'success':
346
+ if (active_step.step_key != 'success') {
347
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
348
+ }
349
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Image, {
350
+ source: {
351
+ uri: draft_image?.url
352
+ },
353
+ style: {
354
+ width: size.width,
355
+ height: size.width
356
+ },
357
+ resizeMode: "contain"
358
+ }));
359
+ case 'image':
360
+ if (active_step.step_key != 'image') {
361
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
362
+ }
363
+ return /*#__PURE__*/React.createElement(View, {
364
+ style: {
365
+ justifyContent: 'center',
366
+ alignItems: 'center'
367
+ }
368
+ }, /*#__PURE__*/React.createElement(ImageUploader, {
369
+ public_id: `${(Math.random() * 10000000).toFixed()}_${active_engagment}_pic`,
370
+ onFinishUpload: obj => setDraftImage({
371
+ ...obj,
372
+ url: obj.secure_url
373
+ })
374
+ }, draft_image ? /*#__PURE__*/React.createElement(Image, {
375
+ source: {
376
+ uri: draft_image.url
377
+ },
378
+ style: {
379
+ width: size.width,
380
+ height: size.width
381
+ },
382
+ resizeMode: "cover"
383
+ }) : /*#__PURE__*/React.createElement(Icons.ImageIcon, {
384
+ size: 150,
385
+ color: Colors.text.h1
386
+ }), /*#__PURE__*/React.createElement(Text, {
387
+ textAlign: "center",
388
+ style: {
389
+ marginTop: 15
390
+ },
391
+ theme: "h1",
392
+ color: Colors.text.action
393
+ }, draft_image ? 'CHANGE IMAGE' : "ADD AN IMAGE")));
394
+ case 'groups':
395
+ if (active_step.step_key != 'group') {
396
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
397
+ }
398
+ return /*#__PURE__*/React.createElement(GroupSelector, {
399
+ groups: groups,
400
+ active_group: active_group,
401
+ onSelectGroup: g => setState({
402
+ ...state,
403
+ active_group: g
404
+ })
405
+ });
406
+ case 'companies':
407
+ if (active_step.step_key != 'company') {
408
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
409
+ }
410
+ return /*#__PURE__*/React.createElement(CompanySelector, {
411
+ companies: companies,
412
+ active_company: active_company,
413
+ onSelectCompany: c => setState({
414
+ ...state,
415
+ active_company: c
416
+ })
417
+ });
418
+ case 'create':
419
+ if (active_step.step_key != 'create') {
420
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
421
+ }
422
+ switch (active_engagment) {
423
+ case 'competition':
424
+ return /*#__PURE__*/React.createElement(CreateCompetition, {
425
+ onUpdateDraft: d => setDraftCompetition(d),
426
+ onFocusPosition: onFocusPostiion
427
+ });
428
+ case 'squares':
429
+ return /*#__PURE__*/React.createElement(CreateSquares, {
430
+ onUpdateDraft: d => setDraftSquares(d),
431
+ onFocusPosition: onFocusPostiion
432
+ });
433
+ default:
434
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
435
+ }
436
+ default:
437
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
438
+ }
439
+ };
440
+ return /*#__PURE__*/React.createElement(View, {
441
+ float: float,
442
+ style: {
443
+ flex: 1
444
+ },
445
+ onLayout: ev => {
446
+ const {
447
+ height,
448
+ width
449
+ } = ev.nativeEvent.layout;
450
+ setSize({
451
+ height,
452
+ width
453
+ });
454
+ }
455
+ }, /*#__PURE__*/React.createElement(View, {
456
+ style: {
457
+ flex: 1
458
+ }
459
+ }, /*#__PURE__*/React.createElement(FlatList, {
460
+ data: sections,
461
+ key: 'create_engagement_list',
462
+ keyExtractor: item => item,
463
+ renderItem: renderSections
464
+ })), active_step.step_key == 'intro' ? /*#__PURE__*/React.createElement(View, {
465
+ type: "footer",
466
+ style: {
467
+ flexDirection: 'row',
468
+ alignItems: 'center',
469
+ padding: 10,
470
+ ...footer_style
471
+ }
472
+ }, /*#__PURE__*/React.createElement(Button, {
473
+ style: {
474
+ flex: 1
475
+ },
476
+ title: "GET STARTED",
477
+ type: "success",
478
+ onPress: () => handleNextStep()
479
+ })) : active_step.step_key == 'success' ? /*#__PURE__*/React.createElement(View, {
480
+ type: "footer",
481
+ style: {
482
+ flexDirection: 'row',
483
+ alignItems: 'center',
484
+ padding: 10,
485
+ ...footer_style
486
+ }
487
+ }, /*#__PURE__*/React.createElement(Button, {
488
+ style: {
489
+ flex: 1
490
+ },
491
+ title: "GO TO YOUR ENGAGEMENT",
492
+ type: "success",
493
+ onPress: () => handleNextStep()
494
+ })) : /*#__PURE__*/React.createElement(View, {
495
+ type: "footer",
496
+ style: {
497
+ flexDirection: 'row',
498
+ alignItems: 'center',
499
+ padding: 10
500
+ }
501
+ }, /*#__PURE__*/React.createElement(Button, {
502
+ float: true,
503
+ style: {
504
+ height: 50,
505
+ width: 50,
506
+ padding: 0,
507
+ justifyContent: 'center',
508
+ alignItems: 'center',
509
+ borderRadius: 100
510
+ },
511
+ onPress: () => {
512
+ let prev_step = steps.find(s => s.num == active_step.num - 1);
513
+ if (prev_step?.step_key == 'group' && groups.length == 0) {
514
+ prev_step = steps.find(s => s.step_key == 'options');
515
+ }
516
+ if (prev_step?.step_key == 'company' && companies.length == 0) {
517
+ prev_step = steps.find(s => s.step_key == 'options');
518
+ }
519
+ if (!prev_step) {
520
+ return alert('Unable to do it');
521
+ }
522
+ setActiveStep(prev_step);
523
+ }
524
+ }, /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
525
+ direction: "left",
526
+ size: 14,
527
+ color: Colors.text.h1
528
+ })), /*#__PURE__*/React.createElement(View, {
529
+ style: {
530
+ flex: 1
531
+ }
532
+ }), /*#__PURE__*/React.createElement(Button, {
533
+ float: true,
534
+ disabled: pending_engagement.create_loading ? true : false,
535
+ loading: pending_engagement.create_loading,
536
+ style: {
537
+ padding: active_step.step_key == 'create' ? 10 : 0,
538
+ height: active_step.step_key == 'create' ? undefined : 50,
539
+ width: active_step.step_key == 'create' ? undefined : 50,
540
+ justifyContent: 'center',
541
+ alignItems: 'center',
542
+ borderRadius: 100,
543
+ opacity: errors.length == 0 && !pending_engagement.create_loading ? 1 : 0.5
544
+ },
545
+ onPress: () => handleNextStep()
546
+ }, active_step.step_key == 'create' ? /*#__PURE__*/React.createElement(Text, {
547
+ theme: "h1",
548
+ color: errors.length > 0 ? Colors.text.warning : Colors.text.success
549
+ }, "CREATE") : /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
550
+ direction: "right",
551
+ size: 14,
552
+ color: errors.length == 0 ? Colors.text.success : Colors.text.h1
553
+ }))));
554
+ };
555
+ export default CreateEngagement;
556
+ const IntroInfo = () => {
557
+ return /*#__PURE__*/React.createElement(View, {
558
+ style: {
559
+ padding: 20
560
+ }
561
+ }, /*#__PURE__*/React.createElement(Text, {
562
+ theme: "h1"
563
+ }, "\uD83C\uDFAE Make It Yours \u2013 Create custom pick-ems, competitions, or games in just a few steps"), /*#__PURE__*/React.createElement(Text, {
564
+ theme: "h1",
565
+ style: {
566
+ marginTop: 20
567
+ }
568
+ }, "\uD83D\uDC65 Play With Friends \u2013 Invite your group or the whole BettorEdge community"), /*#__PURE__*/React.createElement(Text, {
569
+ theme: "h1",
570
+ style: {
571
+ marginTop: 20
572
+ }
573
+ }, "\uD83D\uDCCA Track & Compete \u2013 See results, leaderboards, and bragging rights update in real time"));
574
+ };
575
+ const EngagementOptions = ({
576
+ active_engagement,
577
+ onSelectEngagement
578
+ }) => {
579
+ const Colors = useColors();
580
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Button, {
581
+ key: "competition",
582
+ float: true,
583
+ style: {
584
+ padding: 10,
585
+ margin: 10,
586
+ flexDirection: 'row',
587
+ alignItems: 'center',
588
+ borderColor: active_engagement == 'competition' ? Colors.text.success : Colors.borders.light
589
+ },
590
+ onPress: () => onSelectEngagement('competition')
591
+ }, /*#__PURE__*/React.createElement(Icons.PickEmIcon, {
592
+ size: 50,
593
+ color: active_engagement == 'competition' ? Colors.text.success : Colors.text.h1
594
+ }), /*#__PURE__*/React.createElement(View, {
595
+ transparent: true,
596
+ style: {
597
+ flex: 1,
598
+ marginLeft: 10
599
+ }
600
+ }, /*#__PURE__*/React.createElement(Text, {
601
+ theme: "h1",
602
+ color: active_engagement == 'competition' ? Colors.text.success : Colors.text.h1
603
+ }, "BettorEdge Competition"), /*#__PURE__*/React.createElement(Text, {
604
+ theme: "description",
605
+ color: active_engagement == 'competition' ? Colors.text.success : Colors.text.h1,
606
+ style: {
607
+ marginTop: 4
608
+ }
609
+ }, "Create a pick-em or wager based competition. Players will pick or wager multiple outcomes. Get more right and climb the leaderboard for large payouts"))), /*#__PURE__*/React.createElement(Button, {
610
+ key: "squares",
611
+ float: true,
612
+ style: {
613
+ padding: 10,
614
+ margin: 10,
615
+ flexDirection: 'row',
616
+ alignItems: 'center',
617
+ borderColor: active_engagement == 'squares' ? Colors.text.success : Colors.borders.light
618
+ },
619
+ onPress: () => onSelectEngagement('squares')
620
+ }, /*#__PURE__*/React.createElement(Icons.SquaresIcon, {
621
+ size: 50,
622
+ color: active_engagement == 'squares' ? Colors.text.success : Colors.text.h1
623
+ }), /*#__PURE__*/React.createElement(View, {
624
+ transparent: true,
625
+ style: {
626
+ flex: 1,
627
+ marginLeft: 10
628
+ }
629
+ }, /*#__PURE__*/React.createElement(Text, {
630
+ theme: "h1",
631
+ color: active_engagement == 'squares' ? Colors.text.success : Colors.text.h1
632
+ }, "Auction Squares"), /*#__PURE__*/React.createElement(Text, {
633
+ theme: "description",
634
+ color: active_engagement == 'squares' ? Colors.text.success : Colors.text.h1,
635
+ style: {
636
+ marginTop: 4
637
+ }
638
+ }, "Create an auction squares game. Bid on squares until the auction ends. Buy and sell squares throughout the game."))), /*#__PURE__*/React.createElement(Button, {
639
+ key: "bracket",
640
+ float: true,
641
+ style: {
642
+ padding: 10,
643
+ margin: 10,
644
+ flexDirection: 'row',
645
+ alignItems: 'center',
646
+ borderColor: active_engagement == 'bracket' ? Colors.text.success : Colors.borders.light
647
+ },
648
+ onPress: () => onSelectEngagement('bracket')
649
+ }, /*#__PURE__*/React.createElement(Icons.BracketIcon, {
650
+ size: 50,
651
+ color: active_engagement == 'bracket' ? Colors.text.success : Colors.text.h1
652
+ }), /*#__PURE__*/React.createElement(View, {
653
+ transparent: true,
654
+ style: {
655
+ flex: 1,
656
+ marginLeft: 10
657
+ }
658
+ }, /*#__PURE__*/React.createElement(Text, {
659
+ theme: "h1",
660
+ color: active_engagement == 'bracket' ? Colors.text.success : Colors.text.h1
661
+ }, "Bracket Challenge"), /*#__PURE__*/React.createElement(Text, {
662
+ theme: "description",
663
+ color: active_engagement == 'bracket' ? Colors.text.success : Colors.text.h1,
664
+ style: {
665
+ marginTop: 4
666
+ }
667
+ }, "Create a bracket. Make picks until the championship. Pick more correctly and win!"))), /*#__PURE__*/React.createElement(Button, {
668
+ key: "flash",
669
+ float: true,
670
+ style: {
671
+ padding: 10,
672
+ margin: 10,
673
+ flexDirection: 'row',
674
+ alignItems: 'center',
675
+ borderColor: active_engagement == 'flash' ? Colors.text.success : Colors.borders.light
676
+ },
677
+ onPress: () => onSelectEngagement('flash')
678
+ }, /*#__PURE__*/React.createElement(Icons.FlameIcon, {
679
+ size: 50,
680
+ color: active_engagement == 'flash' ? Colors.text.success : Colors.text.h1
681
+ }), /*#__PURE__*/React.createElement(View, {
682
+ transparent: true,
683
+ style: {
684
+ flex: 1,
685
+ marginLeft: 10
686
+ }
687
+ }, /*#__PURE__*/React.createElement(Text, {
688
+ theme: "h1",
689
+ color: active_engagement == 'flash' ? Colors.text.success : Colors.text.h1
690
+ }, "Custom Market"), /*#__PURE__*/React.createElement(Text, {
691
+ theme: "description",
692
+ color: active_engagement == 'flash' ? Colors.text.success : Colors.text.h1,
693
+ style: {
694
+ marginTop: 4
695
+ }
696
+ }, "Create a custom flash market. Players bet on the perimutuel outcomes, get it right and get paid!"))));
697
+ };
698
+ const GroupSelector = ({
699
+ active_group,
700
+ groups,
701
+ onSelectGroup
702
+ }) => {
703
+ const Colors = useColors();
704
+ const [visible, setVisible] = useState(false);
705
+ const renderGroups = data => {
706
+ return /*#__PURE__*/React.createElement(Button, {
707
+ transparent: true,
708
+ style: {
709
+ flexDirection: 'row',
710
+ alignItems: 'center',
711
+ padding: 10,
712
+ borderRadius: 0,
713
+ borderBottomWidth: 1,
714
+ borderColor: Colors.borders.light
715
+ },
716
+ onPress: () => {
717
+ setVisible(false);
718
+ onSelectGroup(data.item);
719
+ }
720
+ }, /*#__PURE__*/React.createElement(Image, {
721
+ source: {
722
+ uri: data.item.group_image?.url
723
+ },
724
+ style: {
725
+ height: 40,
726
+ width: 40
727
+ },
728
+ resizeMode: "cover"
729
+ }), /*#__PURE__*/React.createElement(View, {
730
+ transparent: true,
731
+ style: {
732
+ flex: 1,
733
+ marginLeft: 10
734
+ }
735
+ }, /*#__PURE__*/React.createElement(Text, {
736
+ theme: "h1"
737
+ }, data.item.name), /*#__PURE__*/React.createElement(Text, {
738
+ theme: "description",
739
+ style: {
740
+ marginTop: 3
741
+ }
742
+ }, data.item.description)));
743
+ };
744
+ return /*#__PURE__*/React.createElement(Button, {
745
+ style: {
746
+ margin: 20
747
+ },
748
+ float: true,
749
+ onPress: () => {
750
+ setVisible(!visible);
751
+ onSelectGroup(undefined);
752
+ }
753
+ }, /*#__PURE__*/React.createElement(View, {
754
+ transparent: true,
755
+ style: {
756
+ flexDirection: 'row',
757
+ alignItems: 'center'
758
+ }
759
+ }, /*#__PURE__*/React.createElement(Text, {
760
+ style: {
761
+ flex: 1,
762
+ marginRight: 10
763
+ },
764
+ theme: "h1"
765
+ }, active_group?.name ?? 'No Group'), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
766
+ direction: visible ? 'up' : 'down',
767
+ color: Colors.text.h1,
768
+ size: 8
769
+ })), visible ? /*#__PURE__*/React.createElement(View, {
770
+ transparent: true,
771
+ style: {
772
+ marginTop: 20
773
+ }
774
+ }, /*#__PURE__*/React.createElement(FlatList, {
775
+ data: groups,
776
+ key: 'group_selector',
777
+ keyExtractor: item => item.group_id.toString(),
778
+ renderItem: renderGroups
779
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null));
780
+ };
781
+ const CompanySelector = ({
782
+ active_company,
783
+ companies,
784
+ onSelectCompany
785
+ }) => {
786
+ const Colors = useColors();
787
+ const [visible, setVisible] = useState(false);
788
+ const renderCompanies = data => {
789
+ return /*#__PURE__*/React.createElement(Button, {
790
+ transparent: true,
791
+ style: {
792
+ flexDirection: 'row',
793
+ alignItems: 'center',
794
+ padding: 10,
795
+ borderRadius: 0,
796
+ borderBottomWidth: 1,
797
+ borderColor: Colors.borders.light
798
+ },
799
+ onPress: () => {
800
+ setVisible(false);
801
+ onSelectCompany(data.item);
802
+ }
803
+ }, /*#__PURE__*/React.createElement(Image, {
804
+ source: {
805
+ uri: data.item.company_image?.url
806
+ },
807
+ style: {
808
+ height: 40,
809
+ width: 40
810
+ },
811
+ resizeMode: "cover"
812
+ }), /*#__PURE__*/React.createElement(View, {
813
+ transparent: true,
814
+ style: {
815
+ flex: 1,
816
+ marginLeft: 10
817
+ }
818
+ }, /*#__PURE__*/React.createElement(Text, {
819
+ theme: "h1"
820
+ }, data.item.company_name), /*#__PURE__*/React.createElement(Text, {
821
+ theme: "description",
822
+ style: {
823
+ marginTop: 3
824
+ }
825
+ }, data.item.company_description)));
826
+ };
827
+ return /*#__PURE__*/React.createElement(Button, {
828
+ style: {
829
+ margin: 20
830
+ },
831
+ float: true,
832
+ onPress: () => {
833
+ setVisible(!visible);
834
+ onSelectCompany(undefined);
835
+ }
836
+ }, /*#__PURE__*/React.createElement(View, {
837
+ transparent: true,
838
+ style: {
839
+ flexDirection: 'row',
840
+ alignItems: 'center'
841
+ }
842
+ }, /*#__PURE__*/React.createElement(Text, {
843
+ style: {
844
+ flex: 1,
845
+ marginRight: 10
846
+ },
847
+ theme: "h1"
848
+ }, active_company?.company_name ?? 'No Company'), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
849
+ direction: visible ? 'up' : 'down',
850
+ color: Colors.text.h1,
851
+ size: 8
852
+ })), visible ? /*#__PURE__*/React.createElement(View, {
853
+ transparent: true,
854
+ style: {
855
+ marginTop: 20
856
+ }
857
+ }, /*#__PURE__*/React.createElement(FlatList, {
858
+ data: companies,
859
+ key: 'company_selector',
860
+ keyExtractor: item => item.company_id.toString(),
861
+ renderItem: renderCompanies
862
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null));
863
+ };
864
+ const CreateSquares = ({
865
+ onFocusPosition,
866
+ onUpdateDraft
867
+ }) => {
868
+ const Colors = useColors();
869
+ const [draft, setDraft] = useState(CreateEngagementHelpers.generateSquaresComp());
870
+ const [sq_data, setSQData] = useState({
871
+ leagues: [],
872
+ leagues_visible: false,
873
+ league_schedule: false
874
+ });
875
+ const {
876
+ leagues,
877
+ leagues_visible,
878
+ league_schedule,
879
+ active_league,
880
+ active_event
881
+ } = sq_data;
882
+ useEffect(() => {
883
+ getData();
884
+ }, []);
885
+ const getData = async () => {
886
+ const lgs = await CreateEngagementApi.getLeagues();
887
+ setSQData({
888
+ ...sq_data,
889
+ leagues: lgs.filter(l => l.sport.toLowerCase() == 'football')
890
+ });
891
+ };
892
+ useEffect(() => {
893
+ onUpdateDraft(draft);
894
+ }, [JSON.stringify(draft)]);
895
+ const renderLeagues = data => {
896
+ const selected = active_league?.league_id == data.item.league_id ? true : false;
897
+ return /*#__PURE__*/React.createElement(Button, {
898
+ transparent: true,
899
+ style: {
900
+ flexDirection: 'row',
901
+ borderRadius: 0,
902
+ padding: 10,
903
+ alignItems: 'center',
904
+ borderBottomWidth: 1,
905
+ borderColor: Colors.borders.light
906
+ },
907
+ onPress: () => setSQData({
908
+ ...sq_data,
909
+ active_league: selected ? undefined : data.item,
910
+ leagues_visible: false,
911
+ league_schedule: selected ? false : true
912
+ })
913
+ }, /*#__PURE__*/React.createElement(Image, {
914
+ source: {
915
+ uri: data.item.league_image
916
+ },
917
+ style: {
918
+ height: 30,
919
+ width: 30
920
+ },
921
+ resizeMode: "contain"
922
+ }), /*#__PURE__*/React.createElement(View, {
923
+ transparent: true,
924
+ style: {
925
+ flex: 1,
926
+ marginLeft: 10
927
+ }
928
+ }, /*#__PURE__*/React.createElement(Text, {
929
+ theme: "h1"
930
+ }, data.item.league_name), /*#__PURE__*/React.createElement(Text, {
931
+ theme: "description",
932
+ style: {
933
+ marginTop: 3
934
+ }
935
+ }, data.item.sport)));
936
+ };
937
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
938
+ style: {
939
+ padding: 10
940
+ }
941
+ }, /*#__PURE__*/React.createElement(Text, {
942
+ theme: "h1",
943
+ style: {
944
+ marginBottom: 10
945
+ }
946
+ }, "Competition Name"), /*#__PURE__*/React.createElement(TextInput, {
947
+ placeholder: "Add Name here...",
948
+ value: draft.sq_comp_name,
949
+ onFocusPosition: onFocusPosition,
950
+ style: {
951
+ borderColor: draft.sq_comp_name ? Colors.text.success : Colors.text.warning
952
+ },
953
+ onChangeText: text => setDraft({
954
+ ...draft,
955
+ sq_comp_name: text
956
+ })
957
+ })), /*#__PURE__*/React.createElement(View, {
958
+ style: {
959
+ padding: 10
960
+ }
961
+ }, /*#__PURE__*/React.createElement(Text, {
962
+ theme: "h1",
963
+ style: {
964
+ marginBottom: 10
965
+ }
966
+ }, "Competition Description"), /*#__PURE__*/React.createElement(TextInput, {
967
+ placeholder: "Add Decription here...",
968
+ onFocusPosition: onFocusPosition,
969
+ value: draft.sq_comp_description,
970
+ style: {
971
+ borderColor: draft.sq_comp_description ? Colors.text.success : Colors.text.warning
972
+ },
973
+ onChangeText: text => setDraft({
974
+ ...draft,
975
+ sq_comp_description: text
976
+ })
977
+ })), /*#__PURE__*/React.createElement(View, {
978
+ style: {
979
+ padding: 10
980
+ }
981
+ }, /*#__PURE__*/React.createElement(Text, {
982
+ theme: "h1",
983
+ style: {
984
+ marginBottom: 10
985
+ }
986
+ }, "Squares Event"), /*#__PURE__*/React.createElement(Button, {
987
+ float: true,
988
+ style: {
989
+ borderColor: active_league ? Colors.text.success : Colors.text.warning
990
+ },
991
+ onPress: () => setSQData({
992
+ ...sq_data,
993
+ leagues_visible: !leagues_visible
994
+ })
995
+ }, /*#__PURE__*/React.createElement(View, {
996
+ transparent: true,
997
+ style: {
998
+ flexDirection: 'row',
999
+ alignItems: 'center'
1000
+ }
1001
+ }, /*#__PURE__*/React.createElement(Text, {
1002
+ style: {
1003
+ flex: 1,
1004
+ marginRight: 10
1005
+ },
1006
+ theme: "h1"
1007
+ }, active_league?.league_name ?? 'Select League'), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
1008
+ direction: leagues_visible ? 'up' : 'down',
1009
+ color: Colors.text.h1,
1010
+ size: 8
1011
+ })), leagues_visible ? /*#__PURE__*/React.createElement(View, {
1012
+ transparent: true,
1013
+ style: {
1014
+ marginTop: 20
1015
+ }
1016
+ }, /*#__PURE__*/React.createElement(FlatList, {
1017
+ data: leagues.sort((a, b) => a.priority - b.priority),
1018
+ key: 'competition_reult_types',
1019
+ keyExtractor: item => item.league_id.toString(),
1020
+ renderItem: renderLeagues
1021
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null))), /*#__PURE__*/React.createElement(View, {
1022
+ float: true,
1023
+ style: {
1024
+ margin: 10
1025
+ }
1026
+ }, active_league && league_schedule ? /*#__PURE__*/React.createElement(LeagueSchedule, {
1027
+ onSelectEvent: e => {
1028
+ setSQData({
1029
+ ...sq_data,
1030
+ active_event: e,
1031
+ league_schedule: false
1032
+ });
1033
+ setDraft({
1034
+ ...draft,
1035
+ sport: active_league?.league_name,
1036
+ begin_datetime: moment(e.scheduled_datetime).add(4, 'minutes'),
1037
+ event_id: e.event_id
1038
+ });
1039
+ },
1040
+ league: active_league,
1041
+ active_event: active_event?.event_id
1042
+ }) : active_event ? /*#__PURE__*/React.createElement(Button, {
1043
+ style: {
1044
+ borderColor: active_event ? Colors.text.success : Colors.text.warning
1045
+ },
1046
+ float: true,
1047
+ onPress: () => setSQData({
1048
+ ...sq_data,
1049
+ league_schedule: true
1050
+ })
1051
+ }, /*#__PURE__*/React.createElement(Text, {
1052
+ theme: "h1"
1053
+ }, active_event.event_title)) : /*#__PURE__*/React.createElement(React.Fragment, null)));
1054
+ };
1055
+ const CreateCompetition = ({
1056
+ onFocusPosition,
1057
+ onUpdateDraft
1058
+ }) => {
1059
+ const Colors = useColors();
1060
+ const [templates, setTemplates] = useState([]);
1061
+ const [draft, setDraft] = useState({
1062
+ loading: false,
1063
+ templates_visible: false,
1064
+ types_visible: false,
1065
+ results_visible: false,
1066
+ competition_description: '',
1067
+ competition_name: '',
1068
+ competition_payout_types: [],
1069
+ competition_result_types: [],
1070
+ competition_types: []
1071
+ });
1072
+ const {
1073
+ competition_name,
1074
+ competition_template_id,
1075
+ templates_visible,
1076
+ competition_description,
1077
+ competition_result_types,
1078
+ types_visible,
1079
+ competition_types,
1080
+ results_visible,
1081
+ competition_type,
1082
+ competition_result_type
1083
+ } = draft;
1084
+ const template = templates.find(t => t.competition_id == competition_template_id);
1085
+ useEffect(() => {
1086
+ getData();
1087
+ }, []);
1088
+ useEffect(() => {
1089
+ onUpdateDraft(draft);
1090
+ }, [JSON.stringify(draft)]);
1091
+ const getData = async () => {
1092
+ setDraft({
1093
+ ...draft,
1094
+ loading: true
1095
+ });
1096
+ CreateEngagementApi.setEnvironment();
1097
+ let options = await CreateEngagementApi.getCompetitionOptions();
1098
+ let temps = await CreateEngagementApi.getTemplateCompetitions();
1099
+ setDraft({
1100
+ ...draft,
1101
+ loading: false,
1102
+ competition_result_types: options.competition_result_types,
1103
+ competition_types: options.competition_types,
1104
+ competition_payout_types: options.competition_payout_types
1105
+ });
1106
+ setTemplates(temps);
1107
+ };
1108
+ const renderCompetitionTypes = data => {
1109
+ return /*#__PURE__*/React.createElement(Button, {
1110
+ transparent: true,
1111
+ style: {
1112
+ flexDirection: 'row',
1113
+ borderRadius: 0,
1114
+ padding: 10,
1115
+ alignItems: 'center',
1116
+ borderBottomWidth: 1,
1117
+ borderColor: Colors.borders.light
1118
+ },
1119
+ onPress: () => setDraft({
1120
+ ...draft,
1121
+ competition_type: data.item,
1122
+ types_visible: false
1123
+ })
1124
+ }, /*#__PURE__*/React.createElement(View, {
1125
+ transparent: true,
1126
+ style: {
1127
+ flex: 1
1128
+ }
1129
+ }, /*#__PURE__*/React.createElement(Text, {
1130
+ theme: "h1"
1131
+ }, data.item.type_label), /*#__PURE__*/React.createElement(Text, {
1132
+ theme: "description",
1133
+ style: {
1134
+ marginTop: 3
1135
+ }
1136
+ }, data.item.description)));
1137
+ };
1138
+ const renderTemplates = data => {
1139
+ const selected = competition_template_id == data.item.competition_id ? true : false;
1140
+ const comp_type = competition_types.find(ct => ct.competition_type_id == data.item.competition_type_id);
1141
+ const comp_result = competition_result_types.find(crt => crt.competition_result_type_id == data.item.competition_result_type_id);
1142
+ if (!comp_type || !comp_result) {
1143
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
1144
+ }
1145
+ return /*#__PURE__*/React.createElement(Button, {
1146
+ transparent: true,
1147
+ style: {
1148
+ flexDirection: 'row',
1149
+ borderRadius: 0,
1150
+ padding: 10,
1151
+ alignItems: 'center',
1152
+ borderBottomWidth: 1,
1153
+ borderColor: Colors.borders.light
1154
+ },
1155
+ onPress: () => setDraft({
1156
+ ...draft,
1157
+ competition_template_id: selected ? undefined : data.item.competition_id,
1158
+ templates_visible: false,
1159
+ competition_type: selected ? undefined : comp_type,
1160
+ competition_result_type: selected ? undefined : comp_result
1161
+ })
1162
+ }, /*#__PURE__*/React.createElement(Image, {
1163
+ source: {
1164
+ uri: data.item.image?.url
1165
+ },
1166
+ style: {
1167
+ height: 30,
1168
+ width: 30
1169
+ },
1170
+ resizeMode: "contain"
1171
+ }), /*#__PURE__*/React.createElement(View, {
1172
+ transparent: true,
1173
+ style: {
1174
+ flex: 1,
1175
+ marginLeft: 10
1176
+ }
1177
+ }, /*#__PURE__*/React.createElement(Text, {
1178
+ theme: "h1"
1179
+ }, data.item.competition_name), /*#__PURE__*/React.createElement(Text, {
1180
+ theme: "description",
1181
+ style: {
1182
+ marginTop: 3
1183
+ }
1184
+ }, data.item.competition_description)));
1185
+ };
1186
+ const renderResultTypes = data => {
1187
+ return /*#__PURE__*/React.createElement(Button, {
1188
+ transparent: true,
1189
+ style: {
1190
+ flexDirection: 'row',
1191
+ borderRadius: 0,
1192
+ padding: 10,
1193
+ alignItems: 'center',
1194
+ borderBottomWidth: 1,
1195
+ borderColor: Colors.borders.light
1196
+ },
1197
+ onPress: () => setDraft({
1198
+ ...draft,
1199
+ competition_result_type: data.item,
1200
+ results_visible: false
1201
+ })
1202
+ }, /*#__PURE__*/React.createElement(View, {
1203
+ transparent: true,
1204
+ style: {
1205
+ flex: 1
1206
+ }
1207
+ }, /*#__PURE__*/React.createElement(Text, {
1208
+ theme: "h1"
1209
+ }, data.item.label), /*#__PURE__*/React.createElement(Text, {
1210
+ theme: "description",
1211
+ style: {
1212
+ marginTop: 3
1213
+ }
1214
+ }, data.item.description)));
1215
+ };
1216
+ return /*#__PURE__*/React.createElement(View, {
1217
+ style: {
1218
+ padding: 10
1219
+ }
1220
+ }, /*#__PURE__*/React.createElement(View, {
1221
+ style: {
1222
+ padding: 10
1223
+ }
1224
+ }, /*#__PURE__*/React.createElement(Text, {
1225
+ theme: "h1",
1226
+ style: {
1227
+ marginBottom: 10
1228
+ }
1229
+ }, "Competition Name"), /*#__PURE__*/React.createElement(TextInput, {
1230
+ placeholder: "Add Name here...",
1231
+ value: competition_name,
1232
+ onFocusPosition: onFocusPosition,
1233
+ style: {
1234
+ borderColor: competition_name ? Colors.text.success : Colors.text.warning
1235
+ },
1236
+ onChangeText: text => setDraft({
1237
+ ...draft,
1238
+ competition_name: text
1239
+ })
1240
+ })), /*#__PURE__*/React.createElement(View, {
1241
+ style: {
1242
+ padding: 10
1243
+ }
1244
+ }, /*#__PURE__*/React.createElement(Text, {
1245
+ theme: "h1",
1246
+ style: {
1247
+ marginBottom: 10
1248
+ }
1249
+ }, "Competition Description"), /*#__PURE__*/React.createElement(TextInput, {
1250
+ placeholder: "Add Decription here...",
1251
+ value: competition_description,
1252
+ onFocusPosition: onFocusPosition,
1253
+ style: {
1254
+ borderColor: competition_description ? Colors.text.success : Colors.text.warning
1255
+ },
1256
+ onChangeText: text => setDraft({
1257
+ ...draft,
1258
+ competition_description: text
1259
+ })
1260
+ })), templates.length > 0 ? /*#__PURE__*/React.createElement(View, {
1261
+ style: {
1262
+ padding: 10
1263
+ }
1264
+ }, /*#__PURE__*/React.createElement(Text, {
1265
+ theme: "h1",
1266
+ style: {
1267
+ marginBottom: 10
1268
+ }
1269
+ }, "Templates"), /*#__PURE__*/React.createElement(Button, {
1270
+ float: true,
1271
+ onPress: () => setDraft({
1272
+ ...draft,
1273
+ templates_visible: !templates_visible,
1274
+ competition_template_id: undefined
1275
+ })
1276
+ }, /*#__PURE__*/React.createElement(View, {
1277
+ transparent: true,
1278
+ style: {
1279
+ flexDirection: 'row',
1280
+ alignItems: 'center'
1281
+ }
1282
+ }, /*#__PURE__*/React.createElement(Text, {
1283
+ style: {
1284
+ flex: 1,
1285
+ marginRight: 10
1286
+ },
1287
+ theme: "h1"
1288
+ }, template?.competition_name ?? 'Select Template'), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
1289
+ direction: templates_visible ? 'up' : 'down',
1290
+ color: Colors.text.h1,
1291
+ size: 8
1292
+ })), templates_visible ? /*#__PURE__*/React.createElement(View, {
1293
+ transparent: true,
1294
+ style: {
1295
+ marginTop: 20
1296
+ }
1297
+ }, /*#__PURE__*/React.createElement(FlatList, {
1298
+ data: templates.sort((a, b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()),
1299
+ key: 'templates_list',
1300
+ keyExtractor: item => item.competition_id.toString(),
1301
+ renderItem: renderTemplates
1302
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null))) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
1303
+ style: {
1304
+ padding: 10
1305
+ }
1306
+ }, /*#__PURE__*/React.createElement(Text, {
1307
+ theme: "h1",
1308
+ style: {
1309
+ marginBottom: 10
1310
+ }
1311
+ }, "Competition Type"), /*#__PURE__*/React.createElement(Button, {
1312
+ float: true,
1313
+ style: {
1314
+ borderColor: competition_type ? Colors.text.success : Colors.text.warning
1315
+ },
1316
+ onPress: () => setDraft({
1317
+ ...draft,
1318
+ types_visible: !types_visible
1319
+ })
1320
+ }, /*#__PURE__*/React.createElement(View, {
1321
+ transparent: true,
1322
+ style: {
1323
+ flexDirection: 'row',
1324
+ alignItems: 'center'
1325
+ }
1326
+ }, /*#__PURE__*/React.createElement(Text, {
1327
+ style: {
1328
+ flex: 1,
1329
+ marginRight: 10
1330
+ },
1331
+ theme: "h1"
1332
+ }, competition_type?.type_label ?? 'Select Type'), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
1333
+ direction: types_visible ? 'up' : 'down',
1334
+ color: Colors.text.h1,
1335
+ size: 8
1336
+ })), types_visible ? /*#__PURE__*/React.createElement(View, {
1337
+ transparent: true,
1338
+ style: {
1339
+ marginTop: 20
1340
+ }
1341
+ }, /*#__PURE__*/React.createElement(FlatList, {
1342
+ data: competition_types.sort((a, b) => a.type_label.localeCompare(b.type_label)),
1343
+ key: 'competition_types',
1344
+ keyExtractor: item => item.competition_type_id.toString(),
1345
+ renderItem: renderCompetitionTypes
1346
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null))), /*#__PURE__*/React.createElement(View, {
1347
+ style: {
1348
+ padding: 10
1349
+ }
1350
+ }, /*#__PURE__*/React.createElement(Text, {
1351
+ theme: "h1",
1352
+ style: {
1353
+ marginBottom: 10
1354
+ }
1355
+ }, "Payout Type"), /*#__PURE__*/React.createElement(Button, {
1356
+ float: true,
1357
+ style: {
1358
+ borderColor: competition_result_type ? Colors.text.success : Colors.text.warning
1359
+ },
1360
+ onPress: () => setDraft({
1361
+ ...draft,
1362
+ results_visible: !results_visible
1363
+ })
1364
+ }, /*#__PURE__*/React.createElement(View, {
1365
+ transparent: true,
1366
+ style: {
1367
+ flexDirection: 'row',
1368
+ alignItems: 'center'
1369
+ }
1370
+ }, /*#__PURE__*/React.createElement(Text, {
1371
+ style: {
1372
+ flex: 1,
1373
+ marginRight: 10
1374
+ },
1375
+ theme: "h1"
1376
+ }, competition_result_type?.label ?? 'Select Payout'), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
1377
+ direction: results_visible ? 'up' : 'down',
1378
+ color: Colors.text.h1,
1379
+ size: 8
1380
+ })), results_visible ? /*#__PURE__*/React.createElement(View, {
1381
+ transparent: true,
1382
+ style: {
1383
+ marginTop: 20
1384
+ }
1385
+ }, /*#__PURE__*/React.createElement(FlatList, {
1386
+ data: competition_result_types.sort((a, b) => a.label.localeCompare(b.label)),
1387
+ key: 'competition_reult_types',
1388
+ keyExtractor: item => item.competition_result_type_id.toString(),
1389
+ renderItem: renderResultTypes
1390
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null))));
1391
+ };
1392
+ //# sourceMappingURL=index.js.map