be-components 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/lib/commonjs/Competition/components/CompetitionInfoCard.js +225 -199
  2. package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -1
  3. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +80 -32
  4. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
  5. package/lib/commonjs/Competition/components/CompetitionPlay.js +126 -837
  6. package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -1
  7. package/lib/commonjs/Competition/components/LeaderPicks.js +2 -0
  8. package/lib/commonjs/Competition/components/LeaderPicks.js.map +1 -1
  9. package/lib/commonjs/Competition/index.js +590 -16
  10. package/lib/commonjs/Competition/index.js.map +1 -1
  11. package/lib/commonjs/Components/Icons.js +64 -0
  12. package/lib/commonjs/Components/Icons.js.map +1 -1
  13. package/lib/commonjs/PromotedOrder/api/index.js +67 -0
  14. package/lib/commonjs/PromotedOrder/api/index.js.map +1 -0
  15. package/lib/commonjs/PromotedOrder/index.js +61 -0
  16. package/lib/commonjs/PromotedOrder/index.js.map +1 -0
  17. package/lib/commonjs/index.js +7 -0
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/module/Competition/components/CompetitionInfoCard.js +225 -201
  20. package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -1
  21. package/lib/module/Competition/components/CompetitionLeaderboard.js +81 -33
  22. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
  23. package/lib/module/Competition/components/CompetitionPlay.js +127 -838
  24. package/lib/module/Competition/components/CompetitionPlay.js.map +1 -1
  25. package/lib/module/Competition/components/LeaderPicks.js +2 -0
  26. package/lib/module/Competition/components/LeaderPicks.js.map +1 -1
  27. package/lib/module/Competition/index.js +592 -18
  28. package/lib/module/Competition/index.js.map +1 -1
  29. package/lib/module/Components/Icons.js +64 -0
  30. package/lib/module/Components/Icons.js.map +1 -1
  31. package/lib/module/PromotedOrder/api/index.js +61 -0
  32. package/lib/module/PromotedOrder/api/index.js.map +1 -0
  33. package/lib/module/PromotedOrder/index.js +52 -0
  34. package/lib/module/PromotedOrder/index.js.map +1 -0
  35. package/lib/module/index.js +2 -1
  36. package/lib/module/index.js.map +1 -1
  37. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts +4 -8
  38. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  39. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts +3 -1
  40. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  41. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts +18 -4
  42. package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts.map +1 -1
  43. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts +2 -1
  44. package/lib/typescript/src/Competition/components/LeaderPicks.d.ts.map +1 -1
  45. package/lib/typescript/src/Competition/index.d.ts +4 -2
  46. package/lib/typescript/src/Competition/index.d.ts.map +1 -1
  47. package/lib/typescript/src/Components/Icons.d.ts +2 -0
  48. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  49. package/lib/typescript/src/PromotedOrder/api/index.d.ts +13 -0
  50. package/lib/typescript/src/PromotedOrder/api/index.d.ts.map +1 -0
  51. package/lib/typescript/src/PromotedOrder/index.d.ts +17 -0
  52. package/lib/typescript/src/PromotedOrder/index.d.ts.map +1 -0
  53. package/lib/typescript/src/index.d.ts +2 -1
  54. package/lib/typescript/src/index.d.ts.map +1 -1
  55. package/package.json +1 -1
  56. package/src/Competition/components/CompetitionInfoCard.tsx +92 -36
  57. package/src/Competition/components/CompetitionLeaderboard.tsx +57 -29
  58. package/src/Competition/components/CompetitionPlay.tsx +71 -677
  59. package/src/Competition/components/LeaderPicks.tsx +3 -2
  60. package/src/Competition/index.tsx +516 -19
  61. package/src/Components/Icons.tsx +35 -0
  62. package/src/PromotedOrder/api/index.ts +43 -0
  63. package/src/PromotedOrder/index.tsx +55 -0
  64. package/src/index.tsx +3 -2
  65. package/src/types.d.ts +34 -1
@@ -1,20 +1,10 @@
1
1
  import React from 'react';
2
- import { ActivityIndicator, FlatList, Image, ImageBackground, ScrollView, TouchableOpacity, View } from "react-native";
2
+ import { FlatList, TouchableOpacity, View } from "react-native";
3
3
  import Colors from '../../constants/colors';
4
4
  import { useEffect, useState } from "react";
5
5
  import TeamEventCard from './TeamEventCard';
6
- import NavOutPrompt from './NavOutPrompt';
7
6
  import AthleteMarketCard from './AthleteMarketCard';
8
7
  import MatchMarketCard from './MatchMarketCard';
9
- import CompetitionInfoCard from './CompetitionInfoCard';
10
- import CompetitionLeaderboard from './CompetitionLeaderboard';
11
- import LeaderPicks from './LeaderPicks';
12
- import WagerPickForm from './WagerPickForm';
13
- import EnterCompetitionPrompt from './EnterCompetitionPrompt';
14
- import SeasonInfoModal from './SeasonInfoModal';
15
- import CompetitionTypeCard from './CompetitionTypeCard';
16
- import { CompetitionApi, CompetitionHelpers, CompetitionMatchApi, CompetitionPlayerApi, PlayerPicksApi } from "../api";
17
- import { AuthenticateApi } from "../../Authenticator/api";
18
8
  import moment from "moment-mini";
19
9
  import { view_styles } from "../../constants/styles";
20
10
  import LinearGradient from "react-native-linear-gradient";
@@ -22,114 +12,37 @@ import { Icons, Text } from "../../Components";
22
12
  import LinearDiagnal from "../../Components/LinearDiagnal";
23
13
  import SpringView from "../../Components/Spring";
24
14
  const CompetitionPlay = ({
15
+ authenticated_competition_player,
16
+ pick_loading,
17
+ competition,
18
+ competition_type,
19
+ onPick,
20
+ competition_matches,
21
+ competition_match_markets,
22
+ leagues,
23
+ athletes,
24
+ events,
25
+ tournaments,
26
+ matches,
27
+ markets,
25
28
  player_id,
26
- company,
27
- source,
28
- back_allowed,
29
- onGoBack,
30
- competition_id,
31
- width,
32
- height,
33
- hide_player,
34
- onChangeCompetition,
35
- onRequestAuthentication
29
+ player_picks
36
30
  }) => {
37
- const [loading, setLoading] = useState(false);
38
- const [code_details] = useState({});
39
- const [my_data, setMyData] = useState({
40
- player_picks: []
41
- });
42
- const [competition_data, setCompetitionData] = useState({
43
- loading: false,
44
- tournaments: [],
45
- events: [],
46
- athletes: [],
47
- teams: [],
48
- matches: [],
49
- leagues: [],
50
- markets: [],
51
- competition_types: [],
52
- competition_result_types: [],
53
- competition_payout_types: [],
54
- competition_matches: [],
55
- competition_players: [],
56
- competition_match_markets: []
57
- });
58
- const [profile_visible, setProfileVisible] = useState(false);
59
- const [show_rules, setShowRules] = useState(false);
60
- const [nav_out_prompt, setNavOutPrompt] = useState({
61
- visible: false
62
- });
63
- const [show_season, setShowSeason] = useState(false);
64
- const [show_enter_prompt, setShowEnterPrompt] = useState(false);
65
- const [complete_loaded, setCompleteLoaded] = useState(false);
66
- const [show_completed, setShowCompleted] = useState(false);
31
+ //const [ complete_loaded, setCompleteLoaded ] = useState(false);
32
+ const [contest_view, setContestView] = useState('upcoming');
33
+ //const [ show_completed, setShowCompleted ] = useState(false);
67
34
  const [expanded_markets, setExpandedMarkets] = useState([]);
68
- const [draft_player_pick, setDraftPlayerPick] = useState({});
69
- const [viewing_leader, setViewingLeader] = useState(undefined);
70
- const [show_full_leaderboard, setShowFullLeaderboard] = useState(false);
71
- const [pick_loading, setPickLoading] = useState(undefined);
72
- const {
73
- competition,
74
- leagues,
75
- markets,
76
- events,
77
- athletes,
78
- tournaments,
79
- matches,
80
- competition_players,
81
- competition_result_type,
82
- competition_payout_types,
83
- competition_season,
84
- competition_types,
85
- competition_result_types,
86
- competition_type,
87
- competition_matches,
88
- competition_match_markets
89
- } = competition_data;
90
- const {
91
- player,
92
- player_balance,
93
- player_picks
94
- } = my_data;
95
- const events_array = Object.values(events);
96
- const authenticated_competition_player = competition_players.find(cp => cp.player_id == player?.player_id);
97
- const can_leave = competition?.entered && moment().isBefore(moment(competition.scheduled_datetime)) && player_picks.length == 0 && !loading;
35
+ const [expanded, setExpanded] = useState(true);
98
36
  const ip_unique_team_events = [...new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.status == 'inprogress').map(cm => cm.event_id))];
99
- const ip_team_event_ids = events_array.filter(e => ip_unique_team_events.includes(e.event_id)).sort((a, b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id);
37
+ let team_event_ids = events.filter(e => ip_unique_team_events.includes(e.event_id)).sort((a, b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id);
100
38
  const closed_unique_team_events = [...new Set(competition_matches.filter(cm => cm.event_type == 'team' && cm.status == 'closed').map(cm => cm.event_id))];
101
- const closed_team_event_ids = events_array.filter(e => closed_unique_team_events.includes(e.event_id)).sort((a, b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id);
39
+ if (contest_view == 'closed') {
40
+ team_event_ids = events.filter(e => closed_unique_team_events.includes(e.event_id)).sort((a, b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix()).map(e => e.event_id);
41
+ }
102
42
  const unique_tournaments = [...new Set(Object.values(matches).map(m => m.tournament_id))];
43
+ const picks_completed = player_picks.length == competition.max_pick_count ? true : false;
103
44
  useEffect(() => {
104
- if (!competition_id) {
105
- return;
106
- }
107
- getCompetitionFromServer(competition_id);
108
- }, [competition_id, player_id]);
109
- useEffect(() => {
110
- if (!competition_id) {
111
- return;
112
- }
113
45
  if (!player_id) {
114
- setMyData({
115
- player_picks: []
116
- });
117
- } else {
118
- getPlayerData(competition_id, player_id, 0);
119
- }
120
- }, [player_id]);
121
- const getPlayerData = async (competition_id, player_id, offset) => {
122
- const pps = await PlayerPicksApi.getPlayerPicksByCompetition(competition_id, player_id, offset);
123
- const player_balance = await CompetitionApi.getMyBalance();
124
- const me = await CompetitionApi.getMyDetails();
125
- setMyData({
126
- player: me,
127
- player_balance,
128
- player_picks: pps
129
- });
130
- };
131
- useEffect(() => {
132
- if (!player) {
133
46
  return;
134
47
  }
135
48
  if (!competition_type || !competition) {
@@ -138,270 +51,10 @@ const CompetitionPlay = ({
138
51
  if (competition_type.type == 'pick') {
139
52
  //Need to determine if we need to show complete label!
140
53
  if (player_picks.length == competition.max_pick_count) {
141
- handleEndCompetition();
54
+ //alert('Competition is complete!')
142
55
  }
143
56
  }
144
57
  }, [player_picks.length]);
145
- const handleEndCompetition = async () => {
146
- if (!competition) {
147
- return;
148
- }
149
- if (competition?.status == 'closed') {
150
- return;
151
- }
152
- if (source == 'bettoredge') {
153
- return setNavOutPrompt({
154
- visible: true,
155
- title: 'Your picks are set!',
156
- image_url: competition.image?.url ?? company?.company_image?.url,
157
- body: 'Way to go! All your pick are locked. Feel free to edit your picks up until the start time of each contest',
158
- hide_accept: true,
159
- cancel_title: 'CLOSE'
160
- });
161
- }
162
- let company_short_name = 'be';
163
- if (company) {
164
- company_short_name = company.short_name;
165
- }
166
- let url = `https://share.mybe.app/c/${company_short_name}?type=c&id=${competition.competition_id}&utm_source=widget`;
167
- try {
168
- const player_token = await AuthenticateApi.getShortToken();
169
- url += `&token=${player_token.token}`;
170
- } catch (e) {
171
- console.log(e);
172
- }
173
- setNavOutPrompt({
174
- visible: true,
175
- url,
176
- title: 'Your picks are set!',
177
- image_url: competition.image?.url ?? company?.company_image?.url,
178
- body: 'Want even more ways to win? Checkout BettorEdge where you can play more competitions like this, track results and even bet real money on the games!',
179
- accept_title: 'Take Me There!',
180
- cancel_title: 'No Thanks'
181
- });
182
- };
183
- const handleProfile = async status => {
184
- if (!player || !competition) {
185
- return;
186
- }
187
- if (source == 'bettoredge') {
188
- return;
189
- }
190
- let company_short_name = 'be';
191
- if (company) {
192
- company_short_name = company.short_name;
193
- }
194
- let url = `https://share.mybe.app/c/${company_short_name}?type=c&id=${competition.competition_id}&utm_source=widget`;
195
- try {
196
- const player_token = await AuthenticateApi.getShortToken();
197
- url += `&token=${player_token.token}`;
198
- } catch (e) {
199
- console.log(e);
200
- }
201
- if (status != 'verified') {
202
- setNavOutPrompt({
203
- title: 'Verify me on BettorEdge!',
204
- url,
205
- image_url: player.profile_pic,
206
- body: 'In order to use real-money, you must verify that you are of legal age with our partner BettorEdge',
207
- accept_title: 'Verify at BettorEdge',
208
- visible: true
209
- });
210
- } else {
211
- setNavOutPrompt({
212
- title: 'Manage my profile at BettorEdge',
213
- url,
214
- image_url: player.profile_pic,
215
- body: 'See your competition performance and history at BettorEdge.',
216
- accept_title: 'Manage Profile',
217
- visible: true
218
- });
219
- }
220
- };
221
-
222
- //This will snag all the data we need to launch the competition
223
- const getCompetitionFromServer = async competition_id => {
224
- setCompetitionData({
225
- ...competition_data,
226
- loading: true
227
- });
228
- const {
229
- competition_types,
230
- competition_result_types,
231
- competition_payout_types
232
- } = await CompetitionApi.getCompetitionOptions();
233
- const ls = await CompetitionApi.getLeagues();
234
- const cms_response = await CompetitionApi.getCompetitionMatchesByCompetitionId(competition_id);
235
-
236
- //Lets get the additional data needed!
237
- let athletes = [];
238
- let teams = [];
239
- let events = [];
240
- let tournaments = [];
241
- let matches = [];
242
- const markets = await CompetitionApi.getMarkets();
243
- let athlete_ids = cms_response.competition_matches.filter(cm => cm.side_type_override == 'athlete' && cm.side_id_override).map(cm => cm.side_id_override ?? '');
244
- let team_ids = cms_response.competition_matches.filter(cm => cm.side_type_override == 'team' && cm.side_id_override).map(cm => cm.side_id_override ?? '');
245
- const event_ids = cms_response.competition_matches.filter(cm => cm.event_type == 'team').map(cm => cm.event_id);
246
- event_ids.map(eid => {
247
- let side_id_cm = cms_response.competition_matches.find(cm => cm.event_type == 'team' && cm.event_id == eid && cm.side_id_override);
248
- if (side_id_cm) {
249
- expanded_markets.push(eid);
250
- }
251
- });
252
- setExpandedMarkets(expanded_markets);
253
- const match_ids = cms_response.competition_matches.filter(cm => cm.event_type == 'match').map(cm => cm.event_id);
254
- if (event_ids.length > 0) {
255
- events = await CompetitionMatchApi.getEventsByEventIds(event_ids);
256
- }
257
- if (match_ids.length > 0) {
258
- matches = await CompetitionMatchApi.getMatchesByMatchIds(match_ids);
259
- }
260
- if (matches.length > 0) {
261
- let tournament_ids = matches.map(m => m.tournament_id);
262
- tournaments = await CompetitionMatchApi.getTournamentsByTournamentIds(tournament_ids);
263
- let new_athlete_ids = [];
264
- let new_team_ids = [];
265
- matches.filter(m => m.participant_type == 'athlete').map(m => m.participants.map(p => new_athlete_ids.push(p)));
266
- matches.filter(m => m.participant_type == 'team').map(m => m.participants.map(p => new_team_ids.push(p)));
267
- athlete_ids = athlete_ids.concat(new_athlete_ids);
268
- team_ids = team_ids.concat(new_team_ids);
269
- }
270
- if (athlete_ids.length > 0) {
271
- athletes = await CompetitionMatchApi.getAthletesByIds(athlete_ids);
272
- }
273
- if (team_ids.length > 0) {
274
- teams = await CompetitionMatchApi.getTeamsByIds(team_ids);
275
- }
276
- const cps = await CompetitionPlayerApi.getCompetitionPlayersByCompetition(competition_id, 0, 'active');
277
- const c = await CompetitionApi.getCompetitionById(competition_id);
278
- setCompetitionData({
279
- loading: false,
280
- competition: c,
281
- competition_matches: cms_response.competition_matches,
282
- competition_match_markets: cms_response.competition_match_markets,
283
- events,
284
- athletes,
285
- teams,
286
- tournaments,
287
- leagues: ls,
288
- competition_types: competition_types,
289
- competition_result_types: competition_result_types,
290
- matches,
291
- competition_payout_types,
292
- competition_players: cps,
293
- competition_type: competition_types.find(ct => ct.competition_type_id == c.competition_type_id),
294
- competition_result_type: competition_result_types.find(crt => crt.competition_result_type_id == c.competition_result_type_id),
295
- markets
296
- });
297
- setLoading(false);
298
- };
299
- const handleEnterPrompt = () => {
300
- if (!player_id) {
301
- return onRequestAuthentication();
302
- }
303
- return setShowEnterPrompt(true);
304
- };
305
- const handleEnterCompetition = async promo_balance => {
306
- if (loading) {
307
- return;
308
- }
309
- setShowEnterPrompt(false);
310
- setLoading(true);
311
- const response = await CompetitionPlayerApi.joinCompetition({
312
- ...CompetitionHelpers.getCompetitionPlayer(competition_id),
313
- promo_balance
314
- });
315
- setCompetitionData({
316
- ...competition_data,
317
- competition: response.competition,
318
- competition_players: competition_players.filter(cp => cp.competition_player_id != response.competition_player.competition_player_id).concat(response.competition_player)
319
- });
320
- setLoading(false);
321
- };
322
- const handleLeaveCompetition = async () => {
323
- if (!authenticated_competition_player) {
324
- return;
325
- }
326
- setLoading(true);
327
- const response = await CompetitionPlayerApi.leaveCompetition(authenticated_competition_player);
328
- setCompetitionData({
329
- ...competition_data,
330
- competition: response.competition,
331
- competition_players: competition_players.filter(cp => cp.competition_player_id != response.competition_player.competition_player_id).concat(response.competition_player)
332
- });
333
- setLoading(false);
334
- };
335
- const handleShowComplete = async () => {
336
- setShowCompleted(!show_completed);
337
- if (!complete_loaded) {
338
- await CompetitionMatchApi.getCompetitionMatchesByCompetitionId(competition_id, 'closed');
339
- setCompleteLoaded(true);
340
- }
341
- };
342
- const handlePick = async (pp, event_title, event_start) => {
343
- if (!competition) {
344
- return;
345
- }
346
- if (!player_id) {
347
- return onRequestAuthentication();
348
- }
349
- if (!authenticated_competition_player) {
350
- return setShowEnterPrompt(true);
351
- }
352
- if (!competition_type) {
353
- return alert('Unable to process pick');
354
- }
355
- setPickLoading(pp.competition_match_id);
356
- //If the pick needs to be removed
357
- if (pp.player_pick_id && pp.player_pick_id != '') {
358
- const rem_pp = await PlayerPicksApi.removePlayerPick(pp.player_pick_id);
359
- setMyData({
360
- ...my_data,
361
- player_picks: player_picks.filter(ps => ps.player_pick_id != rem_pp.player_pick.player_pick_id)
362
- });
363
- setPickLoading(undefined);
364
- return;
365
- }
366
-
367
- //If this is a new pick
368
- //First check to see if they already have one on the market / event combo
369
- let existing_pick = player_picks.find(p => p.competition_match_id == pp.competition_match_id && p.market_id == pp.market_id);
370
- if (existing_pick) {
371
- setPickLoading(undefined);
372
- return alert('Can only pick one side of each market. Remove the other side before selecting this one.');
373
- }
374
- if (competition_type.type == 'pick') {
375
- if (player_picks.length >= competition.max_pick_count) {
376
- setPickLoading(undefined);
377
- return alert('Already reached maximum picks');
378
- }
379
- const new_pp = await PlayerPicksApi.createPlayerPick(pp);
380
- setMyData({
381
- ...my_data,
382
- player_picks: player_picks.filter(ps => ps.player_pick_id != new_pp.player_pick.player_pick_id).concat(new_pp.player_pick)
383
- });
384
- setPickLoading(undefined);
385
- }
386
- if (competition_type.type == 'wager') {
387
- setPickLoading(undefined);
388
- setDraftPlayerPick({
389
- draft_pick: pp,
390
- event_start,
391
- event_title
392
- });
393
- }
394
- };
395
- const handleWagerSubmit = async pp => {
396
- setPickLoading(pp.competition_match_id);
397
- const new_pp = await PlayerPicksApi.createPlayerPick(pp);
398
- setMyData({
399
- ...my_data,
400
- player_picks: player_picks.filter(ps => ps.player_pick_id != new_pp.player_pick.player_pick_id).concat(new_pp.player_pick)
401
- });
402
- setDraftPlayerPick({});
403
- setPickLoading(undefined);
404
- };
405
58
  const renderAthleteEvents = data => {
406
59
  const event = events.find(e => e.event_id == data.item.event_id);
407
60
  if (!event || !competition || !competition_type) {
@@ -438,7 +91,7 @@ const CompetitionPlay = ({
438
91
  competition_match: data.item,
439
92
  mode: "play",
440
93
  orientation: "vertical",
441
- onPick: (pp, event_title, event_start) => handlePick(pp, event_title, event_start),
94
+ onPick: (pp, event_title, event_start) => onPick(pp, event_title, event_start),
442
95
  competition_match_markets: match_markets,
443
96
  player_picks: event_picks,
444
97
  loading: isLoading
@@ -466,7 +119,7 @@ const CompetitionPlay = ({
466
119
  player_picks: event_picks,
467
120
  mode: "play",
468
121
  loading: isLoading,
469
- onPick: (pp, event_title, event_start) => handlePick(pp, event_title, event_start),
122
+ onPick: (pp, event_title, event_start) => onPick(pp, event_title, event_start),
470
123
  competition_match: data.item,
471
124
  competition_match_markets: match_markets
472
125
  }));
@@ -530,7 +183,7 @@ const CompetitionPlay = ({
530
183
  competition_match_markets: match_markets,
531
184
  player_picks: event_picks,
532
185
  loading: isLoading,
533
- onPick: (pp, event_title, event_start) => handlePick(pp, event_title, event_start),
186
+ onPick: (pp, event_title, event_start) => onPick(pp, event_title, event_start),
534
187
  mode: "play"
535
188
  }));
536
189
  };
@@ -705,186 +358,129 @@ const CompetitionPlay = ({
705
358
  size: 8
706
359
  }))) : /*#__PURE__*/React.createElement(React.Fragment, null));
707
360
  };
708
- if (loading || !competition || !competition_type || !competition_result_type) {
709
- return /*#__PURE__*/React.createElement(View, {
710
- style: {
711
- flex: 1,
712
- backgroundColor: Colors.shades.white
713
- }
714
- }, company ? /*#__PURE__*/React.createElement(View, {
715
- style: {
716
- flexDirection: 'row',
717
- alignItems: 'center',
718
- padding: 15,
719
- backgroundColor: company?.brand_primary ?? Colors.shades.shade100
720
- }
721
- }, back_allowed ? /*#__PURE__*/React.createElement(TouchableOpacity, {
722
- style: {
723
- paddingRight: 20
724
- },
725
- onPress: () => onGoBack ? onGoBack() : console.log('')
726
- }, /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
727
- direction: "left",
728
- size: 14,
729
- color: company?.brand_secondary ?? Colors.brand.midnight
730
- })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Text, {
731
- style: {
732
- flex: 1
733
- },
734
- size: 14,
735
- color: company?.brand_secondary ?? Colors.brand.midnight,
736
- weight: "bold",
737
- textAlign: "center"
738
- }, "Brought to you by ", company ? company.company_name : 'BettorEdge')) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(ActivityIndicator, {
739
- style: {
740
- padding: 20
741
- },
742
- size: "large",
743
- color: Colors.brand.midnight
744
- }));
745
- }
746
361
  return /*#__PURE__*/React.createElement(View, {
747
362
  style: {
748
- flex: 1,
749
- backgroundColor: Colors.shades.shade100
363
+ ...view_styles.section,
364
+ minWidth: 350
750
365
  }
751
- }, /*#__PURE__*/React.createElement(ScrollView, {
752
- style: {
753
- flex: 1
754
- }
755
- }, company ? /*#__PURE__*/React.createElement(View, {
366
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
367
+ style: view_styles.section_header,
368
+ onPress: () => setExpanded(!expanded)
369
+ }, /*#__PURE__*/React.createElement(Icons.SelectorIcon, {
370
+ size: 18,
371
+ color: Colors.brand.midnight
372
+ }), /*#__PURE__*/React.createElement(View, {
756
373
  style: {
757
- flexDirection: 'row',
758
- alignItems: 'center',
759
- padding: 15,
760
- backgroundColor: company?.brand_primary ?? Colors.shades.shade100
374
+ flex: 1,
375
+ marginLeft: 10
761
376
  }
762
- }, back_allowed ? /*#__PURE__*/React.createElement(TouchableOpacity, {
763
- style: {
764
- paddingRight: 20
765
- },
766
- onPress: () => onGoBack ? onGoBack() : console.log('')
767
- }, /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
768
- direction: "left",
769
- size: 14,
770
- color: company?.brand_secondary ?? Colors.brand.midnight
771
- })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(Text, {
377
+ }, /*#__PURE__*/React.createElement(Text, {
378
+ theme: "header"
379
+ }, "MANAGE MY ", competition_type.type == 'pick' ? 'PICKS' : 'WAGERS'), /*#__PURE__*/React.createElement(Text, {
772
380
  style: {
773
- flex: 1
381
+ marginTop: 4
774
382
  },
775
- size: 14,
776
- color: company?.brand_secondary ?? Colors.brand.midnight,
777
- weight: "bold",
778
- textAlign: "center"
779
- }, "Brought to you by ", company ? company.company_name : 'BettorEdge')) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
780
- nativeID: "cometition_header",
383
+ theme: "body_2"
384
+ }, "Make ", competition_type.type == 'pick' ? 'Picks' : 'Wagers', " from the available contests.")), /*#__PURE__*/React.createElement(View, {
781
385
  style: {
782
- minWidth: 300,
783
- backgroundColor: Colors.brand.midnight
386
+ marginLeft: 8,
387
+ marginRight: 8,
388
+ borderRadius: 100,
389
+ height: 24,
390
+ width: 24,
391
+ backgroundColor: picks_completed ? Colors.utility.success : Colors.highlights.highlight200,
392
+ justifyContent: 'center',
393
+ alignItems: 'center'
784
394
  }
785
- }, /*#__PURE__*/React.createElement(CompetitionInfoCard, {
786
- player: player,
787
- competition: competition,
788
- competition_type: competition_type,
789
- onEnter: () => handleEnterPrompt(),
790
- can_leave: can_leave,
791
- onViewRules: () => setShowRules(true),
792
- onViewPrize: () => {
793
- setNavOutPrompt({
794
- visible: true,
795
- cancel_title: 'CLOSE',
796
- title: 'Competition Additional Prize!',
797
- body: competition.prize_override,
798
- image_url: competition.prize_image?.url,
799
- hide_accept: true
800
- });
801
- },
802
- onLeave: () => handleLeaveCompetition(),
803
- onViewEvents: () => console.log('VIEW!')
804
- })), competition_season ? /*#__PURE__*/React.createElement(TouchableOpacity, {
805
- style: {
806
- backgroundColor: Colors.incentive.gold,
807
- padding: 10
808
- },
809
- onPress: () => setShowSeason(true)
810
395
  }, /*#__PURE__*/React.createElement(Text, {
811
- size: 18,
396
+ size: 12,
812
397
  color: Colors.shades.white,
813
- weight: "bold"
814
- }, "Competition Season"), /*#__PURE__*/React.createElement(View, {
815
- nativeID: "competition_leaderboard",
398
+ weight: "bold",
399
+ textAlign: "center"
400
+ }, player_picks.filter(pp => pp.status != 'deleted').length)), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
401
+ direction: expanded ? 'up' : 'down',
402
+ color: Colors.brand.midnight,
403
+ size: 8
404
+ })), expanded ? /*#__PURE__*/React.createElement(View, {
816
405
  style: {
817
- marginTop: 5,
818
- flexDirection: 'row',
819
- alignItems: 'center'
406
+ ...view_styles.section_body,
407
+ padding: 0
820
408
  }
821
409
  }, /*#__PURE__*/React.createElement(View, {
822
410
  style: {
823
- padding: 5
411
+ flexDirection: 'row',
412
+ backgroundColor: Colors.shades.white,
413
+ margin: 5,
414
+ marginTop: 15,
415
+ borderRadius: 22,
416
+ borderWidth: 4,
417
+ borderColor: Colors.shades.shade100
824
418
  }
825
- }, /*#__PURE__*/React.createElement(Image, {
826
- source: {
827
- uri: competition_season.image?.url
828
- },
419
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
829
420
  style: {
830
- height: 50,
831
- width: 75,
832
- borderRadius: 8
421
+ flex: 1,
422
+ flexDirection: 'row',
423
+ alignItems: 'center',
424
+ borderRadius: 22,
425
+ padding: 10,
426
+ backgroundColor: contest_view == 'upcoming' ? Colors.brand.midnight : Colors.shades.white
833
427
  },
834
- resizeMode: "cover"
835
- })), /*#__PURE__*/React.createElement(View, {
428
+ onPress: () => setContestView('upcoming')
429
+ }, /*#__PURE__*/React.createElement(Text, {
836
430
  style: {
837
431
  flex: 1
432
+ },
433
+ size: 12,
434
+ color: contest_view == 'upcoming' ? Colors.shades.white : Colors.brand.midnight,
435
+ weight: contest_view == 'upcoming' ? 'bold' : 'semibold'
436
+ }, "UPCOMING CONTESTS"), /*#__PURE__*/React.createElement(View, {
437
+ style: {
438
+ borderRadius: 100,
439
+ justifyContent: 'center',
440
+ alignItems: 'center',
441
+ height: 25,
442
+ width: 25,
443
+ backgroundColor: contest_view == 'upcoming' ? Colors.shades.white : Colors.brand.midnight
838
444
  }
839
445
  }, /*#__PURE__*/React.createElement(Text, {
840
- size: 14,
841
- color: Colors.shades.white,
842
- weight: "semibold"
843
- }, competition_season.season_name), /*#__PURE__*/React.createElement(Text, {
446
+ weight: "bold",
447
+ size: 12,
448
+ color: contest_view == 'upcoming' ? Colors.brand.midnight : Colors.shades.white
449
+ }, ip_unique_team_events.length))), /*#__PURE__*/React.createElement(TouchableOpacity, {
844
450
  style: {
845
- marginTop: 3
451
+ flex: 1,
452
+ flexDirection: 'row',
453
+ alignItems: 'center',
454
+ borderRadius: 22,
455
+ padding: 10,
456
+ backgroundColor: contest_view == 'closed' ? Colors.brand.midnight : Colors.shades.white
846
457
  },
847
- size: 14,
848
- color: Colors.shades.white,
849
- weight: "regular"
850
- }, competition_season.season_description)), /*#__PURE__*/React.createElement(View, {
458
+ onPress: () => setContestView('closed')
459
+ }, /*#__PURE__*/React.createElement(Text, {
851
460
  style: {
852
- padding: 5
853
- }
854
- }, /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
855
- direction: "right",
856
- color: Colors.shades.white,
857
- size: 16
858
- })))) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
859
- nativeID: "competition_leaderboard",
461
+ flex: 1
462
+ },
463
+ size: 12,
464
+ color: contest_view == 'closed' ? Colors.shades.white : Colors.brand.midnight,
465
+ weight: contest_view == 'closed' ? 'bold' : 'semibold'
466
+ }, "CLOSED CONTESTS"), /*#__PURE__*/React.createElement(View, {
860
467
  style: {
861
- minWidth: 300,
862
- padding: 10
468
+ borderRadius: 100,
469
+ justifyContent: 'center',
470
+ alignItems: 'center',
471
+ height: 25,
472
+ width: 25,
473
+ backgroundColor: contest_view == 'closed' ? Colors.shades.white : Colors.brand.midnight
863
474
  }
864
475
  }, /*#__PURE__*/React.createElement(Text, {
865
- size: 18,
866
- color: Colors.brand.midnight,
867
- weight: "bold"
868
- }, "Competition Leaderboard"), /*#__PURE__*/React.createElement(View, {
869
- style: {
870
- marginTop: 10
871
- }
872
- }, /*#__PURE__*/React.createElement(CompetitionLeaderboard, {
873
- competition: competition,
874
- competition_type: competition_type,
875
- height: height,
876
- onLeaderSelect: player => setViewingLeader(player),
877
- view_mode: "short",
878
- onSeeFull: () => setShowFullLeaderboard(true),
879
- viewer_id: player?.player_id
880
- }))), /*#__PURE__*/React.createElement(View, {
881
- nativeID: "competition_picks",
476
+ weight: "bold",
477
+ size: 12,
478
+ color: contest_view == 'closed' ? Colors.brand.midnight : Colors.shades.white
479
+ }, closed_unique_team_events.length)))), /*#__PURE__*/React.createElement(View, {
480
+ nativeID: "picks",
882
481
  style: {
883
- backgroundColor: Colors.shades.white,
884
- marginTop: 5
482
+ marginTop: 15
885
483
  }
886
- }, competition?.status != 'closed' ? /*#__PURE__*/React.createElement(View, {
887
- nativeID: "upcoming_picks"
888
484
  }, /*#__PURE__*/React.createElement(View, {
889
485
  style: {
890
486
  flexDirection: 'row',
@@ -892,16 +488,12 @@ const CompetitionPlay = ({
892
488
  justifyContent: 'space-between',
893
489
  marginBottom: 15
894
490
  }
895
- }, /*#__PURE__*/React.createElement(ImageBackground, {
491
+ }, /*#__PURE__*/React.createElement(View, {
896
492
  style: {
897
493
  flex: 1,
898
494
  flexDirection: 'row',
899
495
  alignItems: 'center',
900
- width: width
901
- },
902
- resizeMode: "cover",
903
- source: {
904
- uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1691609143/diagnal_header_l4kw7u.png'
496
+ backgroundColor: Colors.shades.shade100
905
497
  }
906
498
  }, /*#__PURE__*/React.createElement(View, {
907
499
  style: {
@@ -911,25 +503,10 @@ const CompetitionPlay = ({
911
503
  padding: 10
912
504
  }
913
505
  }, /*#__PURE__*/React.createElement(Text, {
914
- size: 18,
915
- color: Colors.shades.white,
506
+ size: 16,
507
+ color: Colors.brand.midnight,
916
508
  weight: "bold"
917
- }, "Upcoming Events"), /*#__PURE__*/React.createElement(View, {
918
- style: {
919
- marginLeft: 8,
920
- borderRadius: 100,
921
- height: 24,
922
- width: 24,
923
- backgroundColor: Colors.highlights.highlight200,
924
- justifyContent: 'center',
925
- alignItems: 'center'
926
- }
927
- }, /*#__PURE__*/React.createElement(Text, {
928
- size: 12,
929
- color: Colors.shades.white,
930
- weight: "bold",
931
- textAlign: "center"
932
- }, player_picks.filter(pp => pp.status == 'inprogress').length))), authenticated_competition_player ? /*#__PURE__*/React.createElement(SpringView, {
509
+ }, contest_view.toUpperCase(), " CONTESTS")), authenticated_competition_player ? /*#__PURE__*/React.createElement(SpringView, {
933
510
  slide: "horizontal",
934
511
  from: 200,
935
512
  to: 0,
@@ -960,301 +537,13 @@ const CompetitionPlay = ({
960
537
  weight: "semibold",
961
538
  textAlign: "right"
962
539
  }, competition.max_pick_count - player_picks.length, " Picks Remaining")) : /*#__PURE__*/React.createElement(React.Fragment, null))), /*#__PURE__*/React.createElement(FlatList, {
963
- data: ip_team_event_ids,
540
+ data: team_event_ids,
964
541
  renderItem: renderTeamEvents,
965
542
  keyExtractor: item => item
966
543
  }), /*#__PURE__*/React.createElement(FlatList, {
967
544
  data: unique_tournaments,
968
545
  renderItem: renderTournaments,
969
546
  keyExtractor: item => item
970
- })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
971
- nativeID: "closed_picks"
972
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
973
- style: {
974
- padding: 10,
975
- marginBottom: 15,
976
- flexDirection: 'row',
977
- alignItems: 'center',
978
- justifyContent: 'space-between',
979
- backgroundColor: Colors.brand.midnight,
980
- marginTop: 15
981
- },
982
- onPress: () => handleShowComplete()
983
- }, /*#__PURE__*/React.createElement(View, {
984
- style: {
985
- flexDirection: 'row',
986
- alignItems: 'center'
987
- }
988
- }, /*#__PURE__*/React.createElement(Text, {
989
- size: 18,
990
- color: Colors.shades.white,
991
- weight: "bold"
992
- }, "Completed"), /*#__PURE__*/React.createElement(View, {
993
- style: {
994
- marginLeft: 8,
995
- borderRadius: 100,
996
- height: 24,
997
- width: 24,
998
- backgroundColor: Colors.highlights.highlight200,
999
- justifyContent: 'center',
1000
- alignItems: 'center'
1001
- }
1002
- }, /*#__PURE__*/React.createElement(Text, {
1003
- size: 12,
1004
- color: Colors.shades.white,
1005
- weight: "bold",
1006
- textAlign: "center"
1007
- }, player_picks.filter(p => p.status === 'closed').length))), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
1008
- color: Colors.shades.white,
1009
- direction: show_completed ? 'up' : 'down',
1010
- size: 14
1011
- })), show_completed ? /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(FlatList, {
1012
- data: closed_team_event_ids,
1013
- renderItem: renderTeamEvents,
1014
- keyExtractor: item => item
1015
- })) : /*#__PURE__*/React.createElement(React.Fragment, null)))), player && !hide_player ? /*#__PURE__*/React.createElement(View, {
1016
- style: {
1017
- flexDirection: 'row',
1018
- padding: 10,
1019
- backgroundColor: Colors.shades.shade100,
1020
- borderBottomLeftRadius: 22,
1021
- borderBottomRightRadius: 22
1022
- }
1023
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
1024
- style: {
1025
- flex: 1,
1026
- flexDirection: 'row',
1027
- alignItems: 'center'
1028
- },
1029
- onPress: () => setProfileVisible(!profile_visible)
1030
- }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Image, {
1031
- source: {
1032
- uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1689262384/default-avatar_bbkn2t.png'
1033
- },
1034
- style: {
1035
- height: 40,
1036
- width: 40,
1037
- borderRadius: 100
1038
- },
1039
- resizeMode: "cover"
1040
- })), /*#__PURE__*/React.createElement(View, {
1041
- style: {
1042
- flex: 1,
1043
- flexDirection: 'row',
1044
- marginLeft: 10
1045
- }
1046
- }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
1047
- size: 12,
1048
- color: Colors.brand.midnight,
1049
- weight: "regular"
1050
- }, "Playing as"), /*#__PURE__*/React.createElement(Text, {
1051
- style: {
1052
- marginTop: 3
1053
- },
1054
- size: 12,
1055
- color: Colors.brand.midnight,
1056
- weight: "bold"
1057
- }, player.username)))), player_balance ? /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
1058
- size: 12,
1059
- color: Colors.brand.midnight,
1060
- textAlign: "right"
1061
- }, competition.market_type == 'FOR_MONEY' ? 'USD' : 'Edge Coins'), /*#__PURE__*/React.createElement(Text, {
1062
- style: {
1063
- marginTop: 3
1064
- },
1065
- size: 14,
1066
- color: Colors.brand.midnight,
1067
- weight: "bold",
1068
- textAlign: "right"
1069
- }, competition.market_type == 'FOR_MONEY' ? `$${player_balance.balance.toFixed(2)}` : `E${player_balance.free_market_balance.toFixed(2)}`)) : /*#__PURE__*/React.createElement(React.Fragment, null)) : /*#__PURE__*/React.createElement(React.Fragment, null), show_full_leaderboard ? /*#__PURE__*/React.createElement(View, {
1070
- style: {
1071
- flex: 1,
1072
- position: 'absolute',
1073
- top: 0,
1074
- right: 0,
1075
- left: 0,
1076
- bottom: 0,
1077
- backgroundColor: Colors.shades.black_faded
1078
- }
1079
- }, /*#__PURE__*/React.createElement(SpringView, {
1080
- slide: "vertical",
1081
- to: 0,
1082
- from: 1000
1083
- }, /*#__PURE__*/React.createElement(CompetitionLeaderboard, {
1084
- competition: competition,
1085
- competition_type: competition_type,
1086
- height: height,
1087
- onSeeFull: () => setShowFullLeaderboard(false),
1088
- view_mode: "full",
1089
- onLeaderSelect: player => setViewingLeader(player),
1090
- viewer_id: player?.player_id
1091
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null), viewing_leader ? /*#__PURE__*/React.createElement(View, {
1092
- style: {
1093
- flex: 1,
1094
- position: 'absolute',
1095
- top: 0,
1096
- right: 0,
1097
- left: 0,
1098
- bottom: 0,
1099
- backgroundColor: Colors.shades.black_faded
1100
- }
1101
- }, /*#__PURE__*/React.createElement(SpringView, {
1102
- slide: "vertical",
1103
- to: 0,
1104
- style: {
1105
- flex: 1
1106
- },
1107
- from: 1000
1108
- }, /*#__PURE__*/React.createElement(LeaderPicks, {
1109
- height: height,
1110
- markets: markets,
1111
- competition_type: competition_type,
1112
- competition_matches: competition_matches,
1113
- competition_match_markets: competition_match_markets,
1114
- events: events,
1115
- matches: matches,
1116
- tournaments: tournaments,
1117
- athletes: athletes,
1118
- teams: [],
1119
- competition: competition,
1120
- leader: viewing_leader,
1121
- onClose: () => setViewingLeader(undefined)
1122
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null), draft_player_pick?.draft_pick ? /*#__PURE__*/React.createElement(View, {
1123
- style: {
1124
- position: 'absolute',
1125
- top: 0,
1126
- right: 0,
1127
- left: 0,
1128
- bottom: 0,
1129
- backgroundColor: Colors.shades.black_faded,
1130
- justifyContent: 'flex-end',
1131
- alignItems: 'center'
1132
- }
1133
- }, /*#__PURE__*/React.createElement(SpringView, {
1134
- slide: "vertical",
1135
- to: 0,
1136
- from: 200
1137
- }, /*#__PURE__*/React.createElement(WagerPickForm, {
1138
- event_start: draft_player_pick.event_start ?? '',
1139
- event_title: draft_player_pick.event_title ?? '',
1140
- width: width,
1141
- balance: authenticated_competition_player?.wager_based_balance ?? 0,
1142
- loading: pick_loading,
1143
- player_pick: draft_player_pick.draft_pick,
1144
- onCancel: () => setDraftPlayerPick({}),
1145
- onSubmit: pp => handleWagerSubmit(pp)
1146
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null), show_season && competition_season && competition.competition_season_id ? /*#__PURE__*/React.createElement(View, {
1147
- style: {
1148
- position: 'absolute',
1149
- top: 0,
1150
- right: 0,
1151
- left: 0,
1152
- bottom: 0,
1153
- backgroundColor: Colors.shades.black_faded,
1154
- justifyContent: 'flex-end',
1155
- alignItems: 'center'
1156
- }
1157
- }, /*#__PURE__*/React.createElement(SpringView, {
1158
- slide: "vertical",
1159
- to: 0,
1160
- from: 1000
1161
- }, /*#__PURE__*/React.createElement(SeasonInfoModal, {
1162
- competition_season: competition_season,
1163
- competition_types: competition_types,
1164
- competition_result_types: competition_result_types,
1165
- width: width,
1166
- height: height,
1167
- onSelectCompetition: competition => {
1168
- setShowSeason(false);
1169
- if (onChangeCompetition) {
1170
- return onChangeCompetition(competition.competition_id);
1171
- }
1172
- },
1173
- onClose: () => setShowSeason(false)
1174
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null), show_enter_prompt ? /*#__PURE__*/React.createElement(View, {
1175
- style: {
1176
- position: 'absolute',
1177
- top: 0,
1178
- right: 0,
1179
- left: 0,
1180
- bottom: 0,
1181
- backgroundColor: Colors.shades.black_faded,
1182
- justifyContent: 'flex-end',
1183
- alignItems: 'center'
1184
- }
1185
- }, /*#__PURE__*/React.createElement(SpringView, {
1186
- slide: "vertical",
1187
- to: 0,
1188
- from: 200
1189
- }, /*#__PURE__*/React.createElement(EnterCompetitionPrompt, {
1190
- player: player,
1191
- width: width,
1192
- competition: competition,
1193
- competition_type: competition_type,
1194
- competition_result_type: competition_result_type,
1195
- onVerify: () => handleProfile('unverified'),
1196
- onCancel: () => setShowEnterPrompt(false),
1197
- onEnter: promo_balance => handleEnterCompetition(promo_balance)
1198
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null), show_rules ? /*#__PURE__*/React.createElement(View, {
1199
- style: {
1200
- position: 'absolute',
1201
- top: 0,
1202
- right: 0,
1203
- left: 0,
1204
- bottom: 0,
1205
- padding: 10,
1206
- backgroundColor: Colors.shades.black_faded,
1207
- justifyContent: 'center',
1208
- alignItems: 'center'
1209
- }
1210
- }, /*#__PURE__*/React.createElement(SpringView, {
1211
- slide: "vertical",
1212
- to: 0,
1213
- from: 1000
1214
- }, /*#__PURE__*/React.createElement(CompetitionTypeCard, {
1215
- visible: show_rules ? true : false,
1216
- init_view: "type",
1217
- onClose: () => setShowRules(false),
1218
- competition: competition,
1219
- competition_type: competition_type,
1220
- competition_result_type: competition_result_type,
1221
- competition_payout_types: competition_payout_types
1222
- }))) : /*#__PURE__*/React.createElement(React.Fragment, null), nav_out_prompt.visible ? /*#__PURE__*/React.createElement(View, {
1223
- style: {
1224
- flex: 1,
1225
- position: 'absolute',
1226
- top: 0,
1227
- right: 0,
1228
- left: 0,
1229
- bottom: 0,
1230
- backgroundColor: Colors.shades.black_faded,
1231
- justifyContent: 'center',
1232
- alignItems: 'center'
1233
- }
1234
- }, /*#__PURE__*/React.createElement(SpringView, {
1235
- slide: "vertical",
1236
- to: 0,
1237
- from: 1000
1238
- }, /*#__PURE__*/React.createElement(NavOutPrompt, {
1239
- accept_title: nav_out_prompt.accept_title,
1240
- body: nav_out_prompt.body ?? '',
1241
- cancel_title: nav_out_prompt.cancel_title,
1242
- code_details: code_details,
1243
- title: nav_out_prompt.title ?? '',
1244
- max_width: width * 0.8,
1245
- hide_accept: nav_out_prompt.hide_accept,
1246
- image_url: nav_out_prompt.image_url,
1247
- onCancel: () => setNavOutPrompt({
1248
- visible: false
1249
- }),
1250
- onAccept: () => {
1251
- if (nav_out_prompt.url) {
1252
- window.open(nav_out_prompt.url, '_blank');
1253
- }
1254
- setNavOutPrompt({
1255
- visible: false
1256
- });
1257
- }
1258
547
  }))) : /*#__PURE__*/React.createElement(React.Fragment, null));
1259
548
  };
1260
549
  export default CompetitionPlay;