be-components 1.4.9 → 1.5.1

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 (214) hide show
  1. package/lib/commonjs/Competition/api/index.js +15 -0
  2. package/lib/commonjs/Competition/api/index.js.map +1 -1
  3. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +1 -1
  4. package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -1
  5. package/lib/commonjs/Competition/components/SeasonCard.js +61 -0
  6. package/lib/commonjs/Competition/components/SeasonCard.js.map +1 -0
  7. package/lib/commonjs/Competition/index.js +23 -3
  8. package/lib/commonjs/Competition/index.js.map +1 -1
  9. package/lib/commonjs/CompetitionManager/api/index.js +3 -5
  10. package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
  11. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +1 -61
  12. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  13. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +6 -1
  14. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  15. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +4 -0
  16. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  17. package/lib/commonjs/CompetitionManager/components/CreateCompetitionForm.js +37 -3
  18. package/lib/commonjs/CompetitionManager/components/CreateCompetitionForm.js.map +1 -1
  19. package/lib/commonjs/CompetitionSeason/api/index.js +134 -0
  20. package/lib/commonjs/CompetitionSeason/api/index.js.map +1 -0
  21. package/lib/commonjs/CompetitionSeason/components/CompetitionsSection.js +127 -0
  22. package/lib/commonjs/CompetitionSeason/components/CompetitionsSection.js.map +1 -0
  23. package/lib/commonjs/CompetitionSeason/components/EnterSeasonPrompt.js +253 -0
  24. package/lib/commonjs/CompetitionSeason/components/EnterSeasonPrompt.js.map +1 -0
  25. package/lib/commonjs/CompetitionSeason/components/SeasonHeader.js +126 -0
  26. package/lib/commonjs/CompetitionSeason/components/SeasonHeader.js.map +1 -0
  27. package/lib/commonjs/CompetitionSeason/components/SeasonLeaderboard.js +324 -0
  28. package/lib/commonjs/CompetitionSeason/components/SeasonLeaderboard.js.map +1 -0
  29. package/lib/commonjs/CompetitionSeason/components/SeasonSettingsSection.js +175 -0
  30. package/lib/commonjs/CompetitionSeason/components/SeasonSettingsSection.js.map +1 -0
  31. package/lib/commonjs/CompetitionSeason/index.js +278 -0
  32. package/lib/commonjs/CompetitionSeason/index.js.map +1 -0
  33. package/lib/commonjs/CompetitionSeasonManager/api/index.js +182 -0
  34. package/lib/commonjs/CompetitionSeasonManager/api/index.js.map +1 -0
  35. package/lib/commonjs/CompetitionSeasonManager/components/CompetitionSelector.js +2 -0
  36. package/lib/commonjs/CompetitionSeasonManager/components/CompetitionSelector.js.map +1 -0
  37. package/lib/commonjs/CompetitionSeasonManager/components/CompetitionsForm.js +153 -0
  38. package/lib/commonjs/CompetitionSeasonManager/components/CompetitionsForm.js.map +1 -0
  39. package/lib/commonjs/CompetitionSeasonManager/components/CreateSeasonForm.js +388 -0
  40. package/lib/commonjs/CompetitionSeasonManager/components/CreateSeasonForm.js.map +1 -0
  41. package/lib/commonjs/CompetitionSeasonManager/components/SeasonHeader.js +108 -0
  42. package/lib/commonjs/CompetitionSeasonManager/components/SeasonHeader.js.map +1 -0
  43. package/lib/commonjs/CompetitionSeasonManager/components/SeasonInfoForm.js +242 -0
  44. package/lib/commonjs/CompetitionSeasonManager/components/SeasonInfoForm.js.map +1 -0
  45. package/lib/commonjs/CompetitionSeasonManager/components/SeasonSettingsForm.js +352 -0
  46. package/lib/commonjs/CompetitionSeasonManager/components/SeasonSettingsForm.js.map +1 -0
  47. package/lib/commonjs/CompetitionSeasonManager/index.js +190 -0
  48. package/lib/commonjs/CompetitionSeasonManager/index.js.map +1 -0
  49. package/lib/commonjs/Components/Switch.js +3 -0
  50. package/lib/commonjs/Components/Switch.js.map +1 -1
  51. package/lib/commonjs/Engage/api/index.js +25 -0
  52. package/lib/commonjs/Engage/api/index.js.map +1 -1
  53. package/lib/commonjs/Engage/components/SeasonCard.js +78 -0
  54. package/lib/commonjs/Engage/components/SeasonCard.js.map +1 -0
  55. package/lib/commonjs/Engage/index.js +52 -1
  56. package/lib/commonjs/Engage/index.js.map +1 -1
  57. package/lib/commonjs/index.js +14 -0
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/module/Competition/api/index.js +15 -0
  60. package/lib/module/Competition/api/index.js.map +1 -1
  61. package/lib/module/Competition/components/CompetitionSeasonCard.js +1 -1
  62. package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -1
  63. package/lib/module/Competition/components/SeasonCard.js +54 -0
  64. package/lib/module/Competition/components/SeasonCard.js.map +1 -0
  65. package/lib/module/Competition/index.js +23 -3
  66. package/lib/module/Competition/index.js.map +1 -1
  67. package/lib/module/CompetitionManager/api/index.js +3 -5
  68. package/lib/module/CompetitionManager/api/index.js.map +1 -1
  69. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +1 -63
  70. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  71. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +6 -1
  72. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  73. package/lib/module/CompetitionManager/components/ContestSettingsForm.js +4 -0
  74. package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  75. package/lib/module/CompetitionManager/components/CreateCompetitionForm.js +37 -3
  76. package/lib/module/CompetitionManager/components/CreateCompetitionForm.js.map +1 -1
  77. package/lib/module/CompetitionSeason/api/index.js +128 -0
  78. package/lib/module/CompetitionSeason/api/index.js.map +1 -0
  79. package/lib/module/CompetitionSeason/components/CompetitionsSection.js +118 -0
  80. package/lib/module/CompetitionSeason/components/CompetitionsSection.js.map +1 -0
  81. package/lib/module/CompetitionSeason/components/EnterSeasonPrompt.js +244 -0
  82. package/lib/module/CompetitionSeason/components/EnterSeasonPrompt.js.map +1 -0
  83. package/lib/module/CompetitionSeason/components/SeasonHeader.js +119 -0
  84. package/lib/module/CompetitionSeason/components/SeasonHeader.js.map +1 -0
  85. package/lib/module/CompetitionSeason/components/SeasonLeaderboard.js +315 -0
  86. package/lib/module/CompetitionSeason/components/SeasonLeaderboard.js.map +1 -0
  87. package/lib/module/CompetitionSeason/components/SeasonSettingsSection.js +166 -0
  88. package/lib/module/CompetitionSeason/components/SeasonSettingsSection.js.map +1 -0
  89. package/lib/module/CompetitionSeason/index.js +269 -0
  90. package/lib/module/CompetitionSeason/index.js.map +1 -0
  91. package/lib/module/CompetitionSeasonManager/api/index.js +176 -0
  92. package/lib/module/CompetitionSeasonManager/api/index.js.map +1 -0
  93. package/lib/module/CompetitionSeasonManager/components/CompetitionSelector.js +2 -0
  94. package/lib/module/CompetitionSeasonManager/components/CompetitionSelector.js.map +1 -0
  95. package/lib/module/CompetitionSeasonManager/components/CompetitionsForm.js +144 -0
  96. package/lib/module/CompetitionSeasonManager/components/CompetitionsForm.js.map +1 -0
  97. package/lib/module/CompetitionSeasonManager/components/CreateSeasonForm.js +379 -0
  98. package/lib/module/CompetitionSeasonManager/components/CreateSeasonForm.js.map +1 -0
  99. package/lib/module/CompetitionSeasonManager/components/SeasonHeader.js +101 -0
  100. package/lib/module/CompetitionSeasonManager/components/SeasonHeader.js.map +1 -0
  101. package/lib/module/CompetitionSeasonManager/components/SeasonInfoForm.js +233 -0
  102. package/lib/module/CompetitionSeasonManager/components/SeasonInfoForm.js.map +1 -0
  103. package/lib/module/CompetitionSeasonManager/components/SeasonSettingsForm.js +343 -0
  104. package/lib/module/CompetitionSeasonManager/components/SeasonSettingsForm.js.map +1 -0
  105. package/lib/module/CompetitionSeasonManager/index.js +181 -0
  106. package/lib/module/CompetitionSeasonManager/index.js.map +1 -0
  107. package/lib/module/Components/Switch.js +3 -0
  108. package/lib/module/Components/Switch.js.map +1 -1
  109. package/lib/module/Engage/api/index.js +25 -0
  110. package/lib/module/Engage/api/index.js.map +1 -1
  111. package/lib/module/Engage/components/SeasonCard.js +71 -0
  112. package/lib/module/Engage/components/SeasonCard.js.map +1 -0
  113. package/lib/module/Engage/index.js +52 -1
  114. package/lib/module/Engage/index.js.map +1 -1
  115. package/lib/module/index.js +3 -1
  116. package/lib/module/index.js.map +1 -1
  117. package/lib/typescript/src/Competition/api/index.d.ts +1 -0
  118. package/lib/typescript/src/Competition/api/index.d.ts.map +1 -1
  119. package/lib/typescript/src/Competition/components/SeasonCard.d.ts +10 -0
  120. package/lib/typescript/src/Competition/components/SeasonCard.d.ts.map +1 -0
  121. package/lib/typescript/src/Competition/index.d.ts +3 -2
  122. package/lib/typescript/src/Competition/index.d.ts.map +1 -1
  123. package/lib/typescript/src/CompetitionManager/api/index.d.ts +1 -1
  124. package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
  125. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  126. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  127. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  128. package/lib/typescript/src/CompetitionManager/components/CreateCompetitionForm.d.ts +3 -2
  129. package/lib/typescript/src/CompetitionManager/components/CreateCompetitionForm.d.ts.map +1 -1
  130. package/lib/typescript/src/CompetitionSeason/api/index.d.ts +41 -0
  131. package/lib/typescript/src/CompetitionSeason/api/index.d.ts.map +1 -0
  132. package/lib/typescript/src/CompetitionSeason/components/CompetitionsSection.d.ts +14 -0
  133. package/lib/typescript/src/CompetitionSeason/components/CompetitionsSection.d.ts.map +1 -0
  134. package/lib/typescript/src/CompetitionSeason/components/EnterSeasonPrompt.d.ts +16 -0
  135. package/lib/typescript/src/CompetitionSeason/components/EnterSeasonPrompt.d.ts.map +1 -0
  136. package/lib/typescript/src/CompetitionSeason/components/SeasonHeader.d.ts +15 -0
  137. package/lib/typescript/src/CompetitionSeason/components/SeasonHeader.d.ts.map +1 -0
  138. package/lib/typescript/src/CompetitionSeason/components/SeasonLeaderboard.d.ts +18 -0
  139. package/lib/typescript/src/CompetitionSeason/components/SeasonLeaderboard.d.ts.map +1 -0
  140. package/lib/typescript/src/CompetitionSeason/components/SeasonSettingsSection.d.ts +12 -0
  141. package/lib/typescript/src/CompetitionSeason/components/SeasonSettingsSection.d.ts.map +1 -0
  142. package/lib/typescript/src/CompetitionSeason/index.d.ts +12 -0
  143. package/lib/typescript/src/CompetitionSeason/index.d.ts.map +1 -0
  144. package/lib/typescript/src/CompetitionSeasonManager/api/index.d.ts +31 -0
  145. package/lib/typescript/src/CompetitionSeasonManager/api/index.d.ts.map +1 -0
  146. package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionSelector.d.ts +1 -0
  147. package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionSelector.d.ts.map +1 -0
  148. package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionsForm.d.ts +12 -0
  149. package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionsForm.d.ts.map +1 -0
  150. package/lib/typescript/src/CompetitionSeasonManager/components/CreateSeasonForm.d.ts +11 -0
  151. package/lib/typescript/src/CompetitionSeasonManager/components/CreateSeasonForm.d.ts.map +1 -0
  152. package/lib/typescript/src/CompetitionSeasonManager/components/SeasonHeader.d.ts +13 -0
  153. package/lib/typescript/src/CompetitionSeasonManager/components/SeasonHeader.d.ts.map +1 -0
  154. package/lib/typescript/src/CompetitionSeasonManager/components/SeasonInfoForm.d.ts +11 -0
  155. package/lib/typescript/src/CompetitionSeasonManager/components/SeasonInfoForm.d.ts.map +1 -0
  156. package/lib/typescript/src/CompetitionSeasonManager/components/SeasonSettingsForm.d.ts +12 -0
  157. package/lib/typescript/src/CompetitionSeasonManager/components/SeasonSettingsForm.d.ts.map +1 -0
  158. package/lib/typescript/src/CompetitionSeasonManager/index.d.ts +8 -0
  159. package/lib/typescript/src/CompetitionSeasonManager/index.d.ts.map +1 -0
  160. package/lib/typescript/src/Components/Switch.d.ts +2 -1
  161. package/lib/typescript/src/Components/Switch.d.ts.map +1 -1
  162. package/lib/typescript/src/Engage/api/index.d.ts +6 -1
  163. package/lib/typescript/src/Engage/api/index.d.ts.map +1 -1
  164. package/lib/typescript/src/Engage/components/SeasonCard.d.ts +10 -0
  165. package/lib/typescript/src/Engage/components/SeasonCard.d.ts.map +1 -0
  166. package/lib/typescript/src/Engage/index.d.ts +3 -2
  167. package/lib/typescript/src/Engage/index.d.ts.map +1 -1
  168. package/lib/typescript/src/index.d.ts +3 -1
  169. package/lib/typescript/src/index.d.ts.map +1 -1
  170. package/package.json +1 -1
  171. package/src/Competition/api/index.ts +15 -0
  172. package/src/Competition/components/CompetitionSeasonCard.tsx +1 -1
  173. package/src/Competition/components/SeasonCard.tsx +46 -0
  174. package/src/Competition/index.tsx +45 -27
  175. package/src/CompetitionManager/api/index.ts +2 -5
  176. package/src/CompetitionManager/components/CompetitionInfoForm.tsx +2 -64
  177. package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +10 -3
  178. package/src/CompetitionManager/components/ContestSettingsForm.tsx +8 -2
  179. package/src/CompetitionManager/components/CreateCompetitionForm.tsx +20 -4
  180. package/src/CompetitionSeason/api/index.ts +111 -0
  181. package/src/CompetitionSeason/components/CompetitionsSection.tsx +99 -0
  182. package/src/CompetitionSeason/components/EnterSeasonPrompt.tsx +135 -0
  183. package/src/CompetitionSeason/components/SeasonHeader.tsx +81 -0
  184. package/src/CompetitionSeason/components/SeasonLeaderboard.tsx +205 -0
  185. package/src/CompetitionSeason/components/SeasonSettingsSection.tsx +92 -0
  186. package/src/CompetitionSeason/index.tsx +244 -0
  187. package/src/CompetitionSeasonManager/api/index.ts +127 -0
  188. package/src/CompetitionSeasonManager/components/CompetitionSelector.tsx +2 -0
  189. package/src/CompetitionSeasonManager/components/CompetitionsForm.tsx +113 -0
  190. package/src/CompetitionSeasonManager/components/CreateSeasonForm.tsx +238 -0
  191. package/src/CompetitionSeasonManager/components/SeasonHeader.tsx +75 -0
  192. package/src/CompetitionSeasonManager/components/SeasonInfoForm.tsx +124 -0
  193. package/src/CompetitionSeasonManager/components/SeasonSettingsForm.tsx +185 -0
  194. package/src/CompetitionSeasonManager/index.tsx +151 -0
  195. package/src/Components/Switch.tsx +8 -3
  196. package/src/Engage/api/index.ts +21 -2
  197. package/src/Engage/components/SeasonCard.tsx +42 -0
  198. package/src/Engage/index.tsx +44 -7
  199. package/src/index.tsx +4 -1
  200. package/src/types.d.ts +48 -5
  201. package/lib/commonjs/Competition/components/ManageSeasonForm.js +0 -605
  202. package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +0 -1
  203. package/lib/commonjs/Competition/components/SeasonInfoModal.js +0 -400
  204. package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +0 -1
  205. package/lib/module/Competition/components/ManageSeasonForm.js +0 -596
  206. package/lib/module/Competition/components/ManageSeasonForm.js.map +0 -1
  207. package/lib/module/Competition/components/SeasonInfoModal.js +0 -391
  208. package/lib/module/Competition/components/SeasonInfoModal.js.map +0 -1
  209. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +0 -10
  210. package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +0 -1
  211. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +0 -14
  212. package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +0 -1
  213. package/src/Competition/components/ManageSeasonForm.tsx +0 -271
  214. package/src/Competition/components/SeasonInfoModal.tsx +0 -212
@@ -0,0 +1,128 @@
1
+ import axios from "axios";
2
+ import { APIOverrides } from "../../ApiOverrides";
3
+ import moment from "moment-mini";
4
+ let AUTH_SVC_API = '';
5
+ let TP_SVC_API = '';
6
+ //let EVENT_SVC_API = ''
7
+ //let MK_SVC_API = ''
8
+
9
+ export { SeasonApi, SeasonHelpers };
10
+ const SeasonApi = {
11
+ setEnvironment: () => {
12
+ const endpoints = APIOverrides.getEndpoints();
13
+ TP_SVC_API = endpoints['TP_SVC_API'];
14
+ //EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
15
+ //MK_SVC_API = endpoints['MK_SVC_API'] as string;
16
+ AUTH_SVC_API = endpoints['AUTH_SVC_API'];
17
+ },
18
+ getPlayersByPlayerIds: async player_ids => {
19
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/players/bulk/get`, {
20
+ player_ids
21
+ });
22
+ return resp.data.players;
23
+ },
24
+ getCompaniesByIds: async company_ids => {
25
+ try {
26
+ if (company_ids.length == 0) {
27
+ return [];
28
+ }
29
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/companies/bulk/get`, {
30
+ company_ids
31
+ });
32
+ return resp.data.companies;
33
+ } catch (e) {
34
+ return [];
35
+ }
36
+ },
37
+ getMyDetails: async () => {
38
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/me`);
39
+ return resp.data.player;
40
+ },
41
+ getMyBalance: async () => {
42
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/balance/me`);
43
+ return resp.data.player_balance;
44
+ },
45
+ getSeasonById: async competition_season_id => {
46
+ const resp = await axios.get(`${TP_SVC_API}/v2/competitions/seasons/season/${competition_season_id}`);
47
+ return resp.data.competition_season;
48
+ },
49
+ getCompetitionsBySeasonId: async competition_season_id => {
50
+ const resp = await axios.get(`${TP_SVC_API}/v2/competitions/season/${competition_season_id}`);
51
+ return resp.data.competitions;
52
+ },
53
+ getCompetitionOptions: async () => {
54
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/options`);
55
+ return resp.data;
56
+ },
57
+ getSeasonPlayersBySeasonId: async (competition_season_id, offset) => {
58
+ const resp = await axios.get(`${TP_SVC_API}/v2/competitions/seasons/players/${competition_season_id}?offset=${offset}`);
59
+ return resp.data;
60
+ },
61
+ joinSeason: async competition_season_id => {
62
+ const resp = await axios.post(`${TP_SVC_API}/v2/competitions/season/join`, {
63
+ competition_season_id
64
+ });
65
+ return resp.data;
66
+ },
67
+ leaveSeason: async competition_season_player_id => {
68
+ const resp = await axios.post(`${TP_SVC_API}/v2/competitions/season/leave`, {
69
+ competition_season_player_id
70
+ });
71
+ return resp.data;
72
+ }
73
+ };
74
+ const SeasonHelpers = {
75
+ canJoin: (competition_season, competitions) => {
76
+ if (competitions.length == 0) {
77
+ console.log('non');
78
+ }
79
+ if (competition_season.status != 'active') {
80
+ return false;
81
+ }
82
+ let started = moment().isAfter(moment(competition_season.scheduled_datetime)) ? true : false;
83
+ if (started && !competition_season.allow_late_buy_in) {
84
+ return false;
85
+ }
86
+ return true;
87
+ },
88
+ getPayoutAmounts: competition_season => {
89
+ let total_payout = competition_season.ticket_revenue;
90
+ if (competition_season.promo_amt) {
91
+ total_payout = total_payout + parseFloat(competition_season.promo_amt);
92
+ }
93
+ if (competition_season.guaranteed_payout && competition_season.guaranteed_payout > total_payout) {
94
+ total_payout = competition_season.guaranteed_payout;
95
+ }
96
+ let season_payout = parseFloat(competition_season.payout_allocation) * total_payout;
97
+ let competition_payout = total_payout - season_payout;
98
+ return {
99
+ season_payout,
100
+ competition_payout
101
+ };
102
+ },
103
+ formatPlace: place => {
104
+ switch (place) {
105
+ case 1:
106
+ return '1st';
107
+ case 2:
108
+ return '2nd';
109
+ case 3:
110
+ return '3rd';
111
+ case 4:
112
+ return '4th';
113
+ case 5:
114
+ return '5th';
115
+ case 6:
116
+ return '6th';
117
+ case 7:
118
+ return '7th';
119
+ case 8:
120
+ return '8th';
121
+ case 9:
122
+ return '9th';
123
+ default:
124
+ return `${place}`;
125
+ }
126
+ }
127
+ };
128
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["axios","APIOverrides","moment","AUTH_SVC_API","TP_SVC_API","SeasonApi","SeasonHelpers","setEnvironment","endpoints","getEndpoints","getPlayersByPlayerIds","player_ids","resp","post","data","players","getCompaniesByIds","company_ids","length","companies","e","getMyDetails","get","player","getMyBalance","player_balance","getSeasonById","competition_season_id","competition_season","getCompetitionsBySeasonId","competitions","getCompetitionOptions","getSeasonPlayersBySeasonId","offset","joinSeason","leaveSeason","competition_season_player_id","canJoin","console","log","status","started","isAfter","scheduled_datetime","allow_late_buy_in","getPayoutAmounts","total_payout","ticket_revenue","promo_amt","parseFloat","guaranteed_payout","season_payout","payout_allocation","competition_payout","formatPlace","place"],"sourceRoot":"../../../../src","sources":["CompetitionSeason/api/index.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,OAAOC,MAAM,MAAM,aAAa;AAEhC,IAAIC,YAAY,GAAG,EAAE;AACrB,IAAIC,UAAU,GAAG,EAAE;AACnB;AACA;;AAGA,SAASC,SAAS,EAAEC,aAAa;AAEjC,MAAMD,SAAS,GAAG;EACdE,cAAc,EAAEA,CAAA,KAAM;IAClB,MAAMC,SAAS,GAAGP,YAAY,CAACQ,YAAY,CAAC,CAAC;IAC7CL,UAAU,GAAGI,SAAS,CAAC,YAAY,CAAW;IAC9C;IACA;IACAL,YAAY,GAAGK,SAAS,CAAC,cAAc,CAAW;EACtD,CAAC;EACDE,qBAAqB,EAAG,MAAMC,UAAmB,IAAkC;IAC/E,MAAMC,IAAI,GAAG,MAAMZ,KAAK,CAACa,IAAI,CAAE,GAAEV,YAAa,sBAAqB,EAAE;MAAEQ;IAAW,CAAC,CAAC;IACpF,OAAOC,IAAI,CAACE,IAAI,CAACC,OAAO;EAC5B,CAAC;EACDC,iBAAiB,EAAE,MAAMC,WAAoB,IAA6B;IACtE,IAAI;MACA,IAAGA,WAAW,CAACC,MAAM,IAAI,CAAC,EAAC;QAAE,OAAO,EAAE;MAAC;MACvC,MAAMN,IAAI,GAAG,MAAMZ,KAAK,CAACa,IAAI,CAAE,GAAEV,YAAa,wBAAuB,EAAE;QAAEc;MAAY,CAAC,CAAC;MACvF,OAAOL,IAAI,CAACE,IAAI,CAACK,SAAS;IAC9B,CAAC,CAAC,OAAOC,CAAC,EAAE;MACR,OAAO,EAAE;IACb;EACJ,CAAC;EACDC,YAAY,E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,UAAU,CAACrB,kBAAkB,CAACwB,iBAA2B,CAAC,GAAGN,YAAY;IAC7F,IAAIO,kBAAkB,GAAGP,YAAY,GAAGK,aAAa;IACrD,OAAO;MAAEA,aAAa;MAAEE;IAAmB,CAAC;EAChD,CAAC;EACDC,WAAW,EAAGC,KAAY,IAAK;IAC3B,QAAOA,KAAK;MACR,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB,KAAK,CAAC;QACF,OAAO,KAAK;MAChB;QACI,OAAQ,GAAEA,KAAM,EAAC;IAEzB;EACJ;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,118 @@
1
+ import React, { useState } from 'react';
2
+ import { FlatList, TouchableOpacity, View } from 'react-native';
3
+ import { view_styles } from '../../constants/styles';
4
+ import moment from 'moment-mini';
5
+ import CompetitionCard from '../../Engage/components/CompetitionCard';
6
+ import { Button, Icons, Text } from '../../Components';
7
+ import Colors from '../../constants/colors';
8
+ const CompetitionsSection = ({
9
+ competitions,
10
+ width,
11
+ admin,
12
+ company,
13
+ competition_result_type,
14
+ competition_type,
15
+ onCompetitionSelect
16
+ }) => {
17
+ const [expanded, setExpanded] = useState(true);
18
+ const [active_tab, setActiveTab] = useState('active');
19
+ let filtered_competitions = [...competitions];
20
+ if (active_tab == 'active') {
21
+ filtered_competitions = filtered_competitions.filter(c => c.status != 'closed');
22
+ }
23
+ if (active_tab == 'closed') {
24
+ filtered_competitions = filtered_competitions.filter(c => c.status == 'closed');
25
+ }
26
+ const renderCompetitions = data => {
27
+ return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(CompetitionCard, {
28
+ competition: data.item,
29
+ competition_result_type: competition_result_type,
30
+ competition_type: competition_type,
31
+ company: company,
32
+ admin: admin,
33
+ onCompetitionSelect: c => onCompetitionSelect(c)
34
+ }));
35
+ };
36
+ return /*#__PURE__*/React.createElement(View, {
37
+ style: {
38
+ ...view_styles.section,
39
+ maxWidth: width
40
+ }
41
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
42
+ style: {
43
+ ...view_styles.section_header
44
+ },
45
+ onPress: () => setExpanded(!expanded)
46
+ }, /*#__PURE__*/React.createElement(Icons.ListIcon, {
47
+ size: 12,
48
+ color: Colors.brand.midnight
49
+ }), /*#__PURE__*/React.createElement(View, {
50
+ style: {
51
+ flex: 1,
52
+ marginLeft: 10
53
+ }
54
+ }, /*#__PURE__*/React.createElement(Text, {
55
+ theme: "header"
56
+ }, "Included Competitions"), /*#__PURE__*/React.createElement(Text, {
57
+ style: {
58
+ marginTop: 3
59
+ }
60
+ }, "View the list of competitions that are included in this season.")), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
61
+ direction: expanded ? 'up' : 'down',
62
+ color: Colors.brand.midnight,
63
+ size: 8
64
+ })), expanded ? /*#__PURE__*/React.createElement(View, {
65
+ style: {
66
+ ...view_styles.section_body,
67
+ padding: 0
68
+ }
69
+ }, /*#__PURE__*/React.createElement(View, {
70
+ style: {
71
+ ...view_styles.body_row,
72
+ margin: 10,
73
+ backgroundColor: Colors.shades.white,
74
+ borderRadius: 22,
75
+ borderWidth: 4,
76
+ borderColor: Colors.shades.shade100
77
+ }
78
+ }, /*#__PURE__*/React.createElement(Button, {
79
+ title: "ACTIVE",
80
+ title_color: active_tab == 'active' ? Colors.shades.white : Colors.brand.midnight,
81
+ title_weight: active_tab == 'active' ? 'bold' : 'regular',
82
+ padding: 15,
83
+ title_size: 12,
84
+ style: {
85
+ flex: 1
86
+ },
87
+ borderRadiusOverride: {
88
+ borderTopLeftRadius: 22,
89
+ borderBottomLeftRadius: 22,
90
+ borderTopRightRadius: 0,
91
+ borderBottomRightRadius: 0
92
+ },
93
+ backgroundColor: active_tab == 'active' ? Colors.brand.midnight : Colors.shades.white,
94
+ onPress: () => setActiveTab('active')
95
+ }), /*#__PURE__*/React.createElement(Button, {
96
+ title: "CLOSED",
97
+ style: {
98
+ flex: 1
99
+ },
100
+ title_size: 12,
101
+ title_color: active_tab == 'closed' ? Colors.shades.white : Colors.brand.midnight,
102
+ title_weight: active_tab == 'closed' ? 'bold' : 'regular',
103
+ padding: 15,
104
+ borderRadiusOverride: {
105
+ borderTopLeftRadius: 0,
106
+ borderBottomLeftRadius: 0,
107
+ borderTopRightRadius: 22,
108
+ borderBottomRightRadius: 22
109
+ },
110
+ backgroundColor: active_tab == 'closed' ? Colors.brand.midnight : Colors.shades.white,
111
+ onPress: () => setActiveTab('closed')
112
+ })), /*#__PURE__*/React.createElement(FlatList, {
113
+ data: filtered_competitions.sort((a, b) => moment(b.scheduled_datetime).unix() - moment(a.scheduled_datetime).unix()),
114
+ renderItem: renderCompetitions
115
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null));
116
+ };
117
+ export default CompetitionsSection;
118
+ //# sourceMappingURL=CompetitionsSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","FlatList","TouchableOpacity","View","view_styles","moment","CompetitionCard","Button","Icons","Text","Colors","CompetitionsSection","competitions","width","admin","company","competition_result_type","competition_type","onCompetitionSelect","expanded","setExpanded","active_tab","setActiveTab","filtered_competitions","filter","c","status","renderCompetitions","data","createElement","competition","item","style","section","maxWidth","section_header","onPress","ListIcon","size","color","brand","midnight","flex","marginLeft","theme","marginTop","ChevronIcon","direction","section_body","padding","body_row","margin","backgroundColor","shades","white","borderRadius","borderWidth","borderColor","shade100","title","title_color","title_weight","title_size","borderRadiusOverride","borderTopLeftRadius","borderBottomLeftRadius","borderTopRightRadius","borderBottomRightRadius","sort","a","b","scheduled_datetime","unix","renderItem","Fragment"],"sourceRoot":"../../../../src","sources":["CompetitionSeason/components/CompetitionsSection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,GAAG5C,MAAM,CAAC8B,KAAK,CAACC,QAAS;IAClFoB,YAAY,EAAExC,UAAU,IAAI,QAAQ,GAAG,MAAM,GAAG,SAAU;IAC1D4B,OAAO,EAAE,EAAG;IACZc,oBAAoB,EAAE;MAClBC,mBAAmB,EAAE,CAAC;MACtBC,sBAAsB,EAAC,CAAC;MACxBC,oBAAoB,EAAC,EAAE;MACvBC,uBAAuB,EAAC;IAC5B,CAAE;IACFf,eAAe,EAAE/B,UAAU,IAAI,QAAQ,GAAGX,MAAM,CAAC8B,KAAK,CAACC,QAAQ,GAAG/B,MAAM,CAAC2C,MAAM,CAACC,KAAM;IACtFlB,OAAO,EAAEA,CAAA,KAAMd,YAAY,CAAC,QAAQ;EAAE,CACzC,CACC,CAAC,eACHvB,KAAA,CAAA8B,aAAA,CAAC5B,QAAQ;IACL2B,IAAI,EAAEL,qBAAqB,CAAC6C,IAAI,CAAC,CAACC,CAAC,EAACC,CAAC,KAAKjE,MAAM,CAACiE,CAAC,CAACC,kBAAkB,CAAC,CAACC,IAAI,CAAC,CAAC,GAAGnE,MAAM,CAACgE,CAAC,CAACE,kBAAkB,CAAC,CAACC,IAAI,CAAC,CAAC,CAAE;IACrHC,UAAU,EAAE9C;EAAmB,CAClC,CACC,CAAC,gBACN5B,KAAA,CAAA8B,aAAA,CAAA9B,KAAA,CAAA2E,QAAA,MAAI,CACH,CAAC;AAEf,CAAC;AAED,eAAe/D,mBAAmB","ignoreList":[]}
@@ -0,0 +1,244 @@
1
+ import { TouchableOpacity, View } from "react-native";
2
+ import React, { useEffect, useState } from "react";
3
+ import Colors from "../../constants/colors";
4
+ import { Button, Icons, Text } from "../../Components";
5
+ import { view_styles } from "../../constants/styles";
6
+ import moment from "moment-mini";
7
+ import { SeasonHelpers } from "../api";
8
+ const EnterSeasonPrompt = ({
9
+ player,
10
+ player_balance,
11
+ competition_season,
12
+ competition_type,
13
+ competition_result_type,
14
+ width,
15
+ onCancel,
16
+ onEnter,
17
+ onVerify
18
+ }) => {
19
+ const [use_promo_balance, setUsePromoBalance] = useState(false);
20
+ useEffect(() => {
21
+ if (!player) {
22
+ return;
23
+ }
24
+ }, []);
25
+ const requires_verification = player && parseInt(competition_season?.ticket_price ?? 0) > 0 && competition_season?.market_type == 'FOR_MONEY' && player?.vouched_status != 'verified' ? true : false;
26
+ const cl = competition_season.market_type == 'FOR_MONEY' ? '$' : 'E';
27
+ const {
28
+ season_payout,
29
+ competition_payout
30
+ } = SeasonHelpers.getPayoutAmounts(competition_season);
31
+ return /*#__PURE__*/React.createElement(View, {
32
+ style: {
33
+ width,
34
+ backgroundColor: Colors.shades.white,
35
+ borderTopRightRadius: 22,
36
+ borderTopLeftRadius: 22,
37
+ paddingTop: 22
38
+ }
39
+ }, /*#__PURE__*/React.createElement(View, {
40
+ nativeID: "competition_info"
41
+ }, /*#__PURE__*/React.createElement(Text, {
42
+ size: 16,
43
+ color: Colors.brand.midnight,
44
+ weight: "bold",
45
+ textAlign: "center"
46
+ }, "Season Details"), competition_type ? /*#__PURE__*/React.createElement(View, {
47
+ style: {
48
+ flexDirection: 'row',
49
+ justifyContent: 'center',
50
+ margin: 10
51
+ }
52
+ }, /*#__PURE__*/React.createElement(View, {
53
+ style: {
54
+ padding: 10,
55
+ marginRight: 4,
56
+ backgroundColor: Colors.brand.midnight
57
+ }
58
+ }, /*#__PURE__*/React.createElement(Text, {
59
+ size: 12,
60
+ color: Colors.shades.white,
61
+ weight: "semibold"
62
+ }, competition_type.type_label)), /*#__PURE__*/React.createElement(View, {
63
+ style: {
64
+ flexDirection: 'row',
65
+ alignItems: 'center',
66
+ padding: 10,
67
+ marginLeft: 4,
68
+ backgroundColor: Colors.shades.white,
69
+ borderRadius: 4,
70
+ ...view_styles.float
71
+ }
72
+ }, /*#__PURE__*/React.createElement(Text, {
73
+ style: {
74
+ marginRight: 5
75
+ },
76
+ size: 12,
77
+ color: Colors.brand.midnight,
78
+ weight: "semibold"
79
+ }, competition_season.invite_only ? 'Private' : 'Public'), competition_season.invite_only ? /*#__PURE__*/React.createElement(Icons.EyeOffIcon, {
80
+ color: Colors.brand.midnight,
81
+ size: 14
82
+ }) : /*#__PURE__*/React.createElement(Icons.EyeOnIcon, {
83
+ color: Colors.brand.midnight,
84
+ size: 14
85
+ }))) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Text, {
86
+ size: 14,
87
+ color: Colors.brand.midnight,
88
+ weight: "bold",
89
+ textAlign: "center"
90
+ }, competition_season.season_name)), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
91
+ style: {
92
+ marginTop: 5
93
+ },
94
+ size: 14,
95
+ color: Colors.brand.midnight,
96
+ weight: "regular",
97
+ textAlign: "center"
98
+ }, moment(competition_season.scheduled_datetime).format('MMM DD - hh:mm a')), competition_season.season_description ? /*#__PURE__*/React.createElement(Text, {
99
+ style: {
100
+ marginTop: 5
101
+ },
102
+ size: 14,
103
+ color: Colors.brand.midnight,
104
+ weight: "regular",
105
+ textAlign: "center"
106
+ }, competition_season.season_description) : /*#__PURE__*/React.createElement(React.Fragment, null), competition_result_type ? /*#__PURE__*/React.createElement(Text, {
107
+ style: {
108
+ marginTop: 5
109
+ },
110
+ size: 14,
111
+ color: Colors.brand.midnight,
112
+ weight: "regular",
113
+ textAlign: "center"
114
+ }, competition_result_type.label) : /*#__PURE__*/React.createElement(React.Fragment, null), competition_type?.type == 'pick' ? /*#__PURE__*/React.createElement(Text, {
115
+ style: {
116
+ marginTop: 5
117
+ },
118
+ size: 14,
119
+ color: Colors.brand.midnight,
120
+ weight: "regular",
121
+ textAlign: "center"
122
+ }, "Picks: ", competition_season.max_picks) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Text, {
123
+ style: {
124
+ marginTop: 5
125
+ },
126
+ size: 14,
127
+ color: Colors.brand.midnight,
128
+ weight: "regular",
129
+ textAlign: "center"
130
+ }, "Potential Season Winnings: ", cl, season_payout.toFixed(2)), /*#__PURE__*/React.createElement(Text, {
131
+ style: {
132
+ marginTop: 5
133
+ },
134
+ size: 14,
135
+ color: Colors.brand.midnight,
136
+ weight: "regular",
137
+ textAlign: "center"
138
+ }, "Potential Competition Winnings: ", cl, competition_payout.toFixed(2)), /*#__PURE__*/React.createElement(Text, {
139
+ style: {
140
+ marginTop: 5
141
+ },
142
+ size: 14,
143
+ color: Colors.brand.midnight,
144
+ weight: "regular",
145
+ textAlign: "center"
146
+ }, "Ticket Price: ", cl, competition_season.ticket_price.toFixed(2)), /*#__PURE__*/React.createElement(Text, {
147
+ style: {
148
+ marginTop: 5
149
+ },
150
+ size: 14,
151
+ color: Colors.brand.midnight,
152
+ weight: "regular",
153
+ textAlign: "center"
154
+ }, "Entries: ", competition_season.tickets_sold, "/", competition_season.tickets_available)), /*#__PURE__*/React.createElement(View, {
155
+ nativeID: "pick_actions",
156
+ style: {
157
+ flexDirection: 'row',
158
+ padding: 10
159
+ }
160
+ }, /*#__PURE__*/React.createElement(Button, {
161
+ style: {
162
+ flex: 1,
163
+ marginRight: 3
164
+ },
165
+ borderRadius: 4,
166
+ borderWidth: 1,
167
+ borderColor: Colors.brand.electric,
168
+ padding: 10,
169
+ title: "Cancel",
170
+ title_color: Colors.brand.electric,
171
+ onPress: () => onCancel()
172
+ }), requires_verification ? /*#__PURE__*/React.createElement(Button, {
173
+ borderRadius: 4,
174
+ style: {
175
+ flex: 2,
176
+ marginLeft: 2
177
+ },
178
+ backgroundColor: Colors.utility.warning,
179
+ padding: 10,
180
+ title: `Verify My Account`,
181
+ title_color: Colors.shades.white,
182
+ onPress: () => onVerify()
183
+ }) : /*#__PURE__*/React.createElement(Button, {
184
+ borderRadius: 4,
185
+ style: {
186
+ flex: 2,
187
+ marginLeft: 2
188
+ },
189
+ backgroundColor: Colors.utility.success,
190
+ padding: 10,
191
+ title: `Enter Season${competition_season.ticket_price == 0 ? `` : ` ${cl}${competition_season.ticket_price}`}`,
192
+ title_color: Colors.shades.white,
193
+ onPress: () => {
194
+ if (player_balance && competition_season.market_type == 'FOR_MONEY' && player_balance.balance < parseFloat(competition_season.ticket_price)) {
195
+ return alert('Not enough balance to enter. Please make a deposit before continuing');
196
+ }
197
+ onEnter(use_promo_balance);
198
+ }
199
+ })), player_balance && player_balance.promo_balance > 0 ? /*#__PURE__*/React.createElement(TouchableOpacity, {
200
+ style: {
201
+ backgroundColor: Colors.incentive.gold,
202
+ padding: 10,
203
+ flexDirection: 'row',
204
+ alignItems: 'center'
205
+ },
206
+ onPress: () => {
207
+ if (use_promo_balance) {
208
+ //Remove promo balance and open_amt
209
+ setUsePromoBalance(false);
210
+ } else {
211
+ setUsePromoBalance(true);
212
+ }
213
+ }
214
+ }, /*#__PURE__*/React.createElement(View, {
215
+ style: {
216
+ marginRight: 10,
217
+ height: 30,
218
+ width: 30,
219
+ borderWidth: 1,
220
+ borderColor: Colors.brand.midnight,
221
+ justifyContent: 'center',
222
+ alignItems: 'center'
223
+ }
224
+ }, use_promo_balance ? /*#__PURE__*/React.createElement(View, {
225
+ style: {
226
+ height: 20,
227
+ width: 20,
228
+ backgroundColor: Colors.brand.midnight
229
+ }
230
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
231
+ size: 14,
232
+ weight: "bold",
233
+ color: Colors.shades.white
234
+ }, "$", player_balance?.promo_balance, " Promotion Available"), /*#__PURE__*/React.createElement(Text, {
235
+ style: {
236
+ marginTop: 2
237
+ },
238
+ size: 12,
239
+ color: Colors.shades.white,
240
+ weight: "regular"
241
+ }, "Press / Click here to use promo balance"))) : /*#__PURE__*/React.createElement(React.Fragment, null));
242
+ };
243
+ export default EnterSeasonPrompt;
244
+ //# sourceMappingURL=EnterSeasonPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TouchableOpacity","View","React","useEffect","useState","Colors","Button","Icons","Text","view_styles","moment","SeasonHelpers","EnterSeasonPrompt","player","player_balance","competition_season","competition_type","competition_result_type","width","onCancel","onEnter","onVerify","use_promo_balance","setUsePromoBalance","requires_verification","parseInt","ticket_price","market_type","vouched_status","cl","season_payout","competition_payout","getPayoutAmounts","createElement","style","backgroundColor","shades","white","borderTopRightRadius","borderTopLeftRadius","paddingTop","nativeID","size","color","brand","midnight","weight","textAlign","flexDirection","justifyContent","margin","padding","marginRight","type_label","alignItems","marginLeft","borderRadius","float","invite_only","EyeOffIcon","EyeOnIcon","Fragment","season_name","marginTop","scheduled_datetime","format","season_description","label","type","max_picks","toFixed","tickets_sold","tickets_available","flex","borderWidth","borderColor","electric","title","title_color","onPress","utility","warning","success","balance","parseFloat","alert","promo_balance","incentive","gold","height"],"sourceRoot":"../../../../src","sources":["CompetitionSeason/components/EnterSeasonPrompt.tsx"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAErD,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAElD,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,SAASC,MAAM,EAAEC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AACtD,SAASC,WAAW,QAAQ,wBAAwB;AACpD,OAAOC,MAAM,MAAM,aAAa;AAChC,SAASC,aAAa,QAAQ,QAAQ;AActC,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,cAAc;EAAEC,kBAAkB;EAAEC,gBAAgB;EAAEC,uBAAuB;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,OAAO;EAAEC;AAAgC,CAAC,KAAK;EAChL,MAAM,CAAEC,iBAAiB,EAAEC,kBAAkB,CAAE,GAAGnB,QAAQ,CAAC,KAAK,CAAC;EAGjED,SAAS,CAAC,MAAM;IACZ,IAAG,CAACU,MAAM,EAAC;MAAE;IAAO;EACxB,CAAC,EAAC,EAAE,CAAC;EAEL,MAAMW,qBAAqB,GAAGX,MAAM,IAAIY,QAAQ,CAACV,kBAAkB,EAAEW,YAAY,IAAc,CAAC,CAAC,GAAG,CAAC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AW,EAACtE,MAAM,CAACuC,KAAK,CAACC,QAAQ;MAAEI,cAAc,EAAC,QAAQ;MAAEK,UAAU,EAAC;IAAS;EAAE,GAChJhC,iBAAiB,gBAClBpB,KAAA,CAAA+B,aAAA,CAAChC,IAAI;IAACiC,KAAK,EAAE;MAAEuD,MAAM,EAAC,EAAE;MAAEvE,KAAK,EAAC,EAAE;MAAEiB,eAAe,EAAC9B,MAAM,CAACuC,KAAK,CAACC;IAAS;EAAE,CAAE,CAAC,gBAC9E3C,KAAA,CAAA+B,aAAA,CAAA/B,KAAA,CAAA2D,QAAA,MAAI,CACH,CAAC,eACP3D,KAAA,CAAA+B,aAAA,CAAChC,IAAI,qBACDC,KAAA,CAAA+B,aAAA,CAACzB,IAAI;IAACkC,IAAI,EAAE,EAAG;IAACI,MAAM,EAAC,MAAM;IAACH,KAAK,EAAEtC,MAAM,CAAC+B,MAAM,CAACC;EAAM,GAAC,GAAC,EAACvB,cAAc,EAAEwE,aAAa,EAAC,sBAA0B,CAAC,eACrHpF,KAAA,CAAA+B,aAAA,CAACzB,IAAI;IAAC0B,KAAK,EAAE;MAAE6B,SAAS,EAAC;IAAC,CAAE;IAACrB,IAAI,EAAE,EAAG;IAACC,KAAK,EAAEtC,MAAM,CAAC+B,MAAM,CAACC,KAAM;IAACS,MAAM,EAAC;EAAS,GAAC,yCAA6C,CAC/H,CAEI,CAAC,gBAClB5C,KAAA,CAAA+B,aAAA,CAAA/B,KAAA,CAAA2D,QAAA,MAAI,CACH,CAAC;AAEf,CAAC;AAED,eAAejD,iBAAiB","ignoreList":[]}
@@ -0,0 +1,119 @@
1
+ import React from 'react';
2
+ import { View, TouchableOpacity, Image } from 'react-native';
3
+ import Colors from '../../constants/colors';
4
+ import { Button, Icons, Text } from '../../Components';
5
+ import { SeasonHelpers } from '../api';
6
+ import moment from 'moment-mini';
7
+ const SeasonHeader = ({
8
+ action_loading,
9
+ authenticated_season_player,
10
+ competition_season,
11
+ competitions,
12
+ onShareSeason,
13
+ onJoin,
14
+ onLeave
15
+ }) => {
16
+ const can_join = SeasonHelpers.canJoin(competition_season, competitions);
17
+ const can_leave = true;
18
+ return /*#__PURE__*/React.createElement(View, {
19
+ style: {
20
+ backgroundColor: Colors.shades.white
21
+ }
22
+ }, /*#__PURE__*/React.createElement(View, {
23
+ nativeID: "competition_header",
24
+ style: {
25
+ flexDirection: 'row',
26
+ alignItems: 'center',
27
+ padding: 20,
28
+ borderBottomWidth: 1,
29
+ borderColor: Colors.shades.shade600
30
+ }
31
+ }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Image, {
32
+ source: {
33
+ uri: competition_season.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1649737862/be_logo_jte2ux.webp'
34
+ },
35
+ style: {
36
+ height: 50,
37
+ width: 50,
38
+ borderRadius: 4
39
+ },
40
+ resizeMode: "cover"
41
+ })), /*#__PURE__*/React.createElement(View, {
42
+ style: {
43
+ flex: 1,
44
+ marginLeft: 10
45
+ }
46
+ }, /*#__PURE__*/React.createElement(Text, {
47
+ theme: "header"
48
+ }, competition_season.season_name), /*#__PURE__*/React.createElement(Text, {
49
+ style: {
50
+ marginTop: 4
51
+ },
52
+ theme: "header_2>"
53
+ }, competition_season.season_description)), /*#__PURE__*/React.createElement(TouchableOpacity, {
54
+ style: {
55
+ paddingLeft: 10
56
+ },
57
+ onPress: () => onShareSeason(competition_season)
58
+ }, /*#__PURE__*/React.createElement(Icons.ShareIcon, {
59
+ color: Colors.brand.midnight,
60
+ size: 14
61
+ }))), /*#__PURE__*/React.createElement(View, {
62
+ style: {
63
+ flexDirection: 'row',
64
+ padding: 10,
65
+ backgroundColor: Colors.shades.shade100
66
+ }
67
+ }, /*#__PURE__*/React.createElement(View, {
68
+ style: {
69
+ flex: 1
70
+ }
71
+ }, /*#__PURE__*/React.createElement(Text, {
72
+ size: 12,
73
+ color: Colors.brand.midnight,
74
+ weight: "regular"
75
+ }, competition_season.status == 'closed' ? 'COMPLETED' : competition_season.status == 'pending' ? 'UNDER CONSTRUCTION' : can_join ? 'JOIN' : 'IN PROGRESS'), competition_season.status == 'pending' ? /*#__PURE__*/React.createElement(Text, {
76
+ style: {
77
+ marginTop: 5
78
+ },
79
+ size: 12,
80
+ color: Colors.brand.midnight,
81
+ weight: "bold"
82
+ }, "The admin is still working on this season") : can_join ? /*#__PURE__*/React.createElement(Text, {
83
+ style: {
84
+ marginTop: 5
85
+ },
86
+ size: 12,
87
+ color: Colors.brand.midnight,
88
+ weight: "bold"
89
+ }, competition_season.allow_late_buy_in ? 'anytime during the season' : `until ${moment(competition_season.scheduled_datetime).format('MMM DD hh:mm a')}`) : /*#__PURE__*/React.createElement(Text, {
90
+ style: {
91
+ marginTop: 5
92
+ },
93
+ size: 12,
94
+ color: Colors.brand.midnight,
95
+ weight: "bold"
96
+ }, moment(competition_season.scheduled_datetime).format('MMM DD hh:mm a'))), !authenticated_season_player ? /*#__PURE__*/React.createElement(Button, {
97
+ title: "JOIN",
98
+ disabled: action_loading,
99
+ style: {
100
+ opacity: action_loading ? 0.5 : 1
101
+ },
102
+ loading: action_loading,
103
+ title_color: Colors.shades.white,
104
+ backgroundColor: Colors.utility.success,
105
+ onPress: () => onJoin(competition_season)
106
+ }) : /*#__PURE__*/React.createElement(Button, {
107
+ title: "LEAVE",
108
+ backgroundColor: Colors.utility.error,
109
+ loading: action_loading,
110
+ title_color: Colors.shades.white,
111
+ style: {
112
+ opacity: can_leave && !action_loading ? 1 : 0.5
113
+ },
114
+ disabled: !can_leave || action_loading,
115
+ onPress: () => onLeave(authenticated_season_player.competition_season_player_id)
116
+ })));
117
+ };
118
+ export default SeasonHeader;
119
+ //# sourceMappingURL=SeasonHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","TouchableOpacity","Image","Colors","Button","Icons","Text","SeasonHelpers","moment","SeasonHeader","action_loading","authenticated_season_player","competition_season","competitions","onShareSeason","onJoin","onLeave","can_join","canJoin","can_leave","createElement","style","backgroundColor","shades","white","nativeID","flexDirection","alignItems","padding","borderBottomWidth","borderColor","shade600","source","uri","image","url","height","width","borderRadius","resizeMode","flex","marginLeft","theme","season_name","marginTop","season_description","paddingLeft","onPress","ShareIcon","color","brand","midnight","size","shade100","weight","status","allow_late_buy_in","scheduled_datetime","format","title","disabled","opacity","loading","title_color","utility","success","error","competition_season_player_id"],"sourceRoot":"../../../../src","sources":["CompetitionSeason/components/SeasonHeader.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,cAAc;AAC5D,OAAOC,MAAM,MAAM,wBAAwB;AAE3C,SAASC,MAAM,EAAEC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AACtD,SAASC,aAAa,QAAQ,QAAQ;AACtC,OAAOC,MAAM,MAAM,aAAa;AAahC,MAAMC,YAAY,GAAGA,CAAC;EAAEC,cAAc;EAAEC,2BAA2B;EAAEC,kBAAkB;EAAEC,YAAY;EAAEC,aAAa;EAAEC,MAAM;EAAEC;AAA0B,CAAC,KAAK;EAE1J,MAAMC,QAAQ,GAAGV,aAAa,CAACW,OAAO,CAACN,kBAAkB,EAAEC,YAAY,CAAC;EACxE,MAAMM,SAAS,GAAG,IAAI;EAEtB,oBACIpB,KAAA,CAAAqB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAE;MAAEC,eAAe,EAACnB,MAAM,CAACoB,MAAM,CAACC;IAAM;EAAE,gBACjDzB,KAAA,CAAAqB,aAAA,CAACpB,IAAI;IAACyB,QAAQ,EAAC,oBAAoB;IAACJ,KAAK,EAAE;MAAEK,aAAa,EAAC,KAAK;MAAEC,UAAU,EAAC,QAAQ;MAAEC,OAAO,EAAC,EAAE;MAAEC,iBAAiB,EAAC,CAAC;MAAEC,WAAW,EAAC3B,MAAM,CAACoB,MAAM,CAACQ;IAAS;EAAE,gBACzJhC,KAAA,CAAAqB,aAAA,CAACpB,IAAI,qBACDD,KAAA,CAAAq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