be-components 6.3.2 → 6.3.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 (107) hide show
  1. package/lib/commonjs/Campaign/api/index.js +13 -0
  2. package/lib/commonjs/Campaign/api/index.js.map +1 -1
  3. package/lib/commonjs/Campaign/components/GolferAlert.js +135 -0
  4. package/lib/commonjs/Campaign/components/GolferAlert.js.map +1 -0
  5. package/lib/commonjs/Campaign/index.js +810 -2
  6. package/lib/commonjs/Campaign/index.js.map +1 -1
  7. package/lib/commonjs/Checkout/components/AccountSummaryCard.js +2 -2
  8. package/lib/commonjs/Checkout/components/AccountSummaryCard.js.map +1 -1
  9. package/lib/commonjs/Components/Jerseys.js +0 -1
  10. package/lib/commonjs/Components/Jerseys.js.map +1 -1
  11. package/lib/commonjs/FlashMarket/FlashHolder.js +12 -3
  12. package/lib/commonjs/FlashMarket/FlashHolder.js.map +1 -1
  13. package/lib/commonjs/FlashMarket/index.js +4 -2
  14. package/lib/commonjs/FlashMarket/index.js.map +1 -1
  15. package/lib/commonjs/Poll/api/index.js +10 -0
  16. package/lib/commonjs/Poll/api/index.js.map +1 -1
  17. package/lib/commonjs/Poll/index.js +4 -0
  18. package/lib/commonjs/Poll/index.js.map +1 -1
  19. package/lib/commonjs/Wallet/api/index.js +3 -0
  20. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  21. package/lib/commonjs/Wallet/components/AccountCard.js +2 -2
  22. package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -1
  23. package/lib/module/Campaign/api/index.js +13 -0
  24. package/lib/module/Campaign/api/index.js.map +1 -1
  25. package/lib/module/Campaign/components/GolferAlert.js +128 -0
  26. package/lib/module/Campaign/components/GolferAlert.js.map +1 -0
  27. package/lib/module/Campaign/index.js +812 -4
  28. package/lib/module/Campaign/index.js.map +1 -1
  29. package/lib/module/Checkout/components/AccountSummaryCard.js +2 -2
  30. package/lib/module/Checkout/components/AccountSummaryCard.js.map +1 -1
  31. package/lib/module/Components/Jerseys.js +0 -1
  32. package/lib/module/Components/Jerseys.js.map +1 -1
  33. package/lib/module/FlashMarket/FlashHolder.js +12 -3
  34. package/lib/module/FlashMarket/FlashHolder.js.map +1 -1
  35. package/lib/module/FlashMarket/index.js +4 -2
  36. package/lib/module/FlashMarket/index.js.map +1 -1
  37. package/lib/module/Poll/api/index.js +10 -0
  38. package/lib/module/Poll/api/index.js.map +1 -1
  39. package/lib/module/Poll/index.js +4 -0
  40. package/lib/module/Poll/index.js.map +1 -1
  41. package/lib/module/Wallet/api/index.js +3 -0
  42. package/lib/module/Wallet/api/index.js.map +1 -1
  43. package/lib/module/Wallet/components/AccountCard.js +2 -2
  44. package/lib/module/Wallet/components/AccountCard.js.map +1 -1
  45. package/lib/typescript/lib/commonjs/Campaign/api/index.d.ts +1 -0
  46. package/lib/typescript/lib/commonjs/Campaign/api/index.d.ts.map +1 -1
  47. package/lib/typescript/lib/commonjs/Campaign/components/GolferAlert.d.ts +10 -0
  48. package/lib/typescript/lib/commonjs/Campaign/components/GolferAlert.d.ts.map +1 -0
  49. package/lib/typescript/lib/commonjs/Campaign/index.d.ts +2 -1
  50. package/lib/typescript/lib/commonjs/Campaign/index.d.ts.map +1 -1
  51. package/lib/typescript/lib/commonjs/Components/Jerseys.d.ts.map +1 -1
  52. package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts +5 -1
  53. package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts.map +1 -1
  54. package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts +3 -1
  55. package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts.map +1 -1
  56. package/lib/typescript/lib/commonjs/Poll/api/index.d.ts +1 -0
  57. package/lib/typescript/lib/commonjs/Poll/api/index.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/Poll/index.d.ts +2 -1
  59. package/lib/typescript/lib/commonjs/Poll/index.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/Wallet/api/index.d.ts +1 -0
  61. package/lib/typescript/lib/commonjs/Wallet/api/index.d.ts.map +1 -1
  62. package/lib/typescript/lib/module/Campaign/api/index.d.ts +1 -0
  63. package/lib/typescript/lib/module/Campaign/api/index.d.ts.map +1 -1
  64. package/lib/typescript/lib/module/Campaign/components/GolferAlert.d.ts +10 -0
  65. package/lib/typescript/lib/module/Campaign/components/GolferAlert.d.ts.map +1 -0
  66. package/lib/typescript/lib/module/Campaign/index.d.ts +2 -1
  67. package/lib/typescript/lib/module/Campaign/index.d.ts.map +1 -1
  68. package/lib/typescript/lib/module/Components/Jerseys.d.ts.map +1 -1
  69. package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts +5 -1
  70. package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts.map +1 -1
  71. package/lib/typescript/lib/module/FlashMarket/index.d.ts +3 -1
  72. package/lib/typescript/lib/module/FlashMarket/index.d.ts.map +1 -1
  73. package/lib/typescript/lib/module/Poll/api/index.d.ts +1 -0
  74. package/lib/typescript/lib/module/Poll/api/index.d.ts.map +1 -1
  75. package/lib/typescript/lib/module/Poll/index.d.ts +2 -1
  76. package/lib/typescript/lib/module/Poll/index.d.ts.map +1 -1
  77. package/lib/typescript/lib/module/Wallet/api/index.d.ts +1 -0
  78. package/lib/typescript/lib/module/Wallet/api/index.d.ts.map +1 -1
  79. package/lib/typescript/src/Campaign/api/index.d.ts +2 -1
  80. package/lib/typescript/src/Campaign/api/index.d.ts.map +1 -1
  81. package/lib/typescript/src/Campaign/components/GolferAlert.d.ts +12 -0
  82. package/lib/typescript/src/Campaign/components/GolferAlert.d.ts.map +1 -0
  83. package/lib/typescript/src/Campaign/index.d.ts +2 -1
  84. package/lib/typescript/src/Campaign/index.d.ts.map +1 -1
  85. package/lib/typescript/src/FlashMarket/FlashHolder.d.ts +5 -1
  86. package/lib/typescript/src/FlashMarket/FlashHolder.d.ts.map +1 -1
  87. package/lib/typescript/src/FlashMarket/index.d.ts +3 -1
  88. package/lib/typescript/src/FlashMarket/index.d.ts.map +1 -1
  89. package/lib/typescript/src/Poll/api/index.d.ts +1 -0
  90. package/lib/typescript/src/Poll/api/index.d.ts.map +1 -1
  91. package/lib/typescript/src/Poll/index.d.ts +2 -1
  92. package/lib/typescript/src/Poll/index.d.ts.map +1 -1
  93. package/lib/typescript/src/Wallet/api/index.d.ts +1 -0
  94. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  95. package/package.json +1 -1
  96. package/src/Campaign/api/index.ts +10 -1
  97. package/src/Campaign/components/GolferAlert.tsx +74 -0
  98. package/src/Campaign/index.tsx +435 -10
  99. package/src/Checkout/components/AccountSummaryCard.tsx +2 -2
  100. package/src/Components/Jerseys.tsx +1 -1
  101. package/src/FlashMarket/FlashHolder.tsx +10 -4
  102. package/src/FlashMarket/index.tsx +5 -3
  103. package/src/Poll/api/index.ts +8 -0
  104. package/src/Poll/index.tsx +5 -1
  105. package/src/Wallet/api/index.ts +3 -0
  106. package/src/Wallet/components/AccountCard.tsx +2 -2
  107. package/src/types.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { FlatList, Image, useWindowDimensions } from "react-native";
2
+ import { ActivityIndicator, FlatList, Image, ImageBackground, useWindowDimensions } from "react-native";
3
3
  import { Button, Text, View } from '../Components/Themed';
4
4
  import { CampaignApi, CampaignHelpers } from '../Campaign/api';
5
5
  import { MarketComponentApi } from '../MarketComponents/api';
@@ -13,14 +13,19 @@ import CampaignAnalytics from './components/CampaignAnalytics';
13
13
  import SocketManager from '../Socket';
14
14
  import NewPlayerAlert from './components/NewPlayerAlert';
15
15
  import ActionList from './components/ActionList';
16
- import { Icons, Toggle } from '../Components';
16
+ import { AutoScrollingFlatList, Icons, Toggle } from '../Components';
17
+ import { PollApi, PollCampaignApi, PollOptionApi } from '../Poll/api';
18
+ import FlashHolder from '../FlashMarket/FlashHolder';
19
+ import GolferAlert from './components/GolferAlert';
17
20
  const HEADER_HEIGHT = 75;
18
21
  const sections = ['header', 'prize', 'participants', 'toggle', 'desktop_data', 'mobile_ticker', 'mobile_player', 'mobile_leaderboard', 'engagements'];
22
+ //const golf_sections = ['header', 'closest_pin', 'sponsors']
19
23
  const Campaign = ({
20
24
  player_id,
21
25
  campaign_id,
22
26
  insets,
23
27
  color_mode,
28
+ mode,
24
29
  distinct_id,
25
30
  onSelectCompetition,
26
31
  onSelectPollCampaign,
@@ -32,6 +37,10 @@ const Campaign = ({
32
37
  }) => {
33
38
  const Colors = useColors();
34
39
  const [needs_reload, setNeedsReload] = useState(false);
40
+ const [golf_leader_size, setGolfLeaderSize] = useState({
41
+ height: 0,
42
+ width: 0
43
+ });
35
44
  const [new_player_alert, setNewPlayerAlert] = useState(undefined);
36
45
  const [new_bet_alert, setNewBetAlert] = useState(undefined);
37
46
  //const [ refresh, setRefresh ] = useState(0);
@@ -61,6 +70,9 @@ const Campaign = ({
61
70
  leagues: [],
62
71
  tournaments: [],
63
72
  poll_campaigns: [],
73
+ flash_options: [],
74
+ flash_markets: [],
75
+ sponsors: [],
64
76
  competitions: [],
65
77
  matches: [],
66
78
  athletes: [],
@@ -72,11 +84,15 @@ const Campaign = ({
72
84
  teams: []
73
85
  });
74
86
  const {
87
+ loading,
75
88
  orders,
76
89
  events,
77
90
  tournaments,
91
+ flash_options,
92
+ sponsors,
78
93
  athletes,
79
94
  competitions,
95
+ flash_markets,
80
96
  poll_campaigns,
81
97
  campaign,
82
98
  participant_page,
@@ -143,9 +159,17 @@ const Campaign = ({
143
159
  plsers = plsers.concat(await CampaignApi.getPlayersByPlayerIds(needed_player_ids));
144
160
  //Set new bettor!!
145
161
  let new_player = cps.filter(cp => cp.status == 'active')[0];
146
- if (new_player && new_player.player_id != player_id) {
162
+ if (mode != 'golf' && new_player && new_player.player_id != player_id) {
147
163
  setNewPlayerAlert(new_player);
148
164
  }
165
+ if (mode == 'golf') {
166
+ //Old player
167
+ let exist = campaign_participants.find(cp => cp.campaign_participant_id == socket_participants[0]?.campaign_participant_id);
168
+ if (exist?.payload?.status == 'active' && campaign_participants[0]?.payload.status == 'closed') {
169
+ setNewPlayerAlert(new_player);
170
+ }
171
+ }
172
+
149
173
  //Ok! Now lets update the participants
150
174
  setEmbedState({
151
175
  ...embed_state,
@@ -206,8 +230,18 @@ const Campaign = ({
206
230
  }
207
231
  let comps = [];
208
232
  let pcs = [];
233
+ let fls = [];
234
+ let opts = [];
209
235
  if (c_resp.campaign && c_resp.campaign.poll_campaign_ids) {
210
236
  pcs = await CampaignApi.getPollCampaignsByIds(c_resp.campaign.poll_campaign_ids);
237
+ let campaign_id = pcs[0]?.poll_campaign_id;
238
+ if (campaign_id) {
239
+ PollCampaignApi.setEnvironment();
240
+ let flash_resp = await PollApi.getPollsByCampaignId(campaign_id);
241
+ fls = flash_resp.polls;
242
+ let poll_ids = [...new Set(fls.map(p => p.poll_id))];
243
+ opts = await PollOptionApi.getPollOptionsByPollIds(poll_ids);
244
+ }
211
245
  }
212
246
  if (c_resp.campaign && c_resp.campaign.competition_ids) {
213
247
  comps = await CampaignApi.getCompetitionsByIds(c_resp.campaign.competition_ids);
@@ -240,12 +274,16 @@ const Campaign = ({
240
274
  const tms = await MarketComponentApi.getTeamsByIds(tm_ids);
241
275
  const aths = await MarketComponentApi.getAthletesByIds(aths_ids);
242
276
  const lgs = await MarketComponentApi.getLeagues();
277
+ const spnsrs = await CampaignApi.getCompaniesByIds(c_resp.campaign?.sponsors ?? []);
243
278
  setEmbedState({
244
279
  ...embed_state,
245
280
  players: pls,
246
281
  campaign: c_resp.campaign,
247
282
  campaign_participants: c_resp.campaign_participants,
248
283
  teams: tms,
284
+ sponsors: spnsrs,
285
+ flash_markets: fls,
286
+ flash_options: opts,
249
287
  leagues: lgs,
250
288
  competitions: comps,
251
289
  poll_campaigns: pcs,
@@ -257,6 +295,9 @@ const Campaign = ({
257
295
  orders: vis_ords,
258
296
  loading: false
259
297
  });
298
+ setTimeout(() => {
299
+ getData(campaign_id);
300
+ }, 240000); //Update every 4 minutes
260
301
  };
261
302
  const handleCheckIn = async () => {
262
303
  setMyDetails({
@@ -344,6 +385,58 @@ const Campaign = ({
344
385
  }
345
386
  });
346
387
  };
388
+ const renderGolfers = data => {
389
+ const player = players.find(p => p.player_id == data.item.player_id);
390
+ if (!player) {
391
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
392
+ }
393
+ return /*#__PURE__*/React.createElement(View, {
394
+ type: "row",
395
+ style: {
396
+ padding: 10,
397
+ borderBottomWidth: 1,
398
+ borderColor: Colors.borders.light
399
+ }
400
+ }, data.item.payload.status == 'active' ? /*#__PURE__*/React.createElement(Icons.GolferIcon, {
401
+ size: 16,
402
+ color: Colors.text.h1
403
+ }) : data.item.payload.status == 'pending' ? /*#__PURE__*/React.createElement(Icons.InProgressIcon, {
404
+ size: 16,
405
+ color: Colors.text.h1
406
+ }) : /*#__PURE__*/React.createElement(Icons.LockClosedIcon, {
407
+ size: 16,
408
+ color: Colors.text.h1
409
+ }), /*#__PURE__*/React.createElement(View, {
410
+ style: {
411
+ flex: 1,
412
+ flexDirection: 'row',
413
+ marginLeft: 15
414
+ }
415
+ }, /*#__PURE__*/React.createElement(Image, {
416
+ source: {
417
+ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp'
418
+ },
419
+ style: {
420
+ height: 35,
421
+ width: 35,
422
+ borderRadius: 100
423
+ }
424
+ }), /*#__PURE__*/React.createElement(View, {
425
+ style: {
426
+ flex: 1,
427
+ marginLeft: 10
428
+ }
429
+ }, /*#__PURE__*/React.createElement(Text, {
430
+ theme: "h1"
431
+ }, player.first_name, " ", player.last_name), /*#__PURE__*/React.createElement(Text, {
432
+ theme: "description",
433
+ style: {
434
+ marginTop: 3
435
+ }
436
+ }, "@", player.username))), /*#__PURE__*/React.createElement(Text, {
437
+ theme: "h1"
438
+ }, data.item.payload.pin_distance == 999 ? 'MISS' : data.item.payload.pin_distance));
439
+ };
347
440
  const renderEngagements = data => {
348
441
  switch (data.item.type) {
349
442
  case 'competition':
@@ -436,6 +529,165 @@ const Campaign = ({
436
529
  return /*#__PURE__*/React.createElement(React.Fragment, null);
437
530
  }
438
531
  };
532
+ const renderUpcomingGolfers = data => {
533
+ const options = flash_options.filter(o => o.poll_id == data.item.poll_id);
534
+ return /*#__PURE__*/React.createElement(View, {
535
+ transparent: true,
536
+ style: {
537
+ flexDirection: 'row',
538
+ borderBottomWidth: 1,
539
+ borderColor: Colors.borders.light,
540
+ borderBottomLeftRadius: 8
541
+ }
542
+ }, /*#__PURE__*/React.createElement(View, {
543
+ type: "header",
544
+ style: {
545
+ padding: 20,
546
+ justifyContent: 'center',
547
+ alignItems: 'center',
548
+ borderRightWidth: 1,
549
+ borderColor: Colors.borders.light
550
+ }
551
+ }, /*#__PURE__*/React.createElement(Text, {
552
+ theme: "description",
553
+ style: {
554
+ marginBottom: 4
555
+ }
556
+ }, "Group"), /*#__PURE__*/React.createElement(Text, {
557
+ theme: "h1"
558
+ }, data.item.priority)), options.sort((a, b) => a.priority - b.priority).map(o => {
559
+ return /*#__PURE__*/React.createElement(View, {
560
+ transparent: true,
561
+ style: {
562
+ flex: 1,
563
+ justifyContent: 'center',
564
+ alignItems: 'center',
565
+ padding: 10,
566
+ borderRightWidth: 1,
567
+ borderColor: Colors.borders.light
568
+ }
569
+ }, /*#__PURE__*/React.createElement(Image, {
570
+ source: {
571
+ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp'
572
+ },
573
+ style: {
574
+ height: 40,
575
+ width: 40
576
+ },
577
+ resizeMode: "cover"
578
+ }), /*#__PURE__*/React.createElement(Text, {
579
+ theme: "h2",
580
+ style: {
581
+ marginTop: 4
582
+ },
583
+ textAlign: "center"
584
+ }, o.option_name));
585
+ }));
586
+ };
587
+ const renderClosedGolfers = data => {
588
+ const options = flash_options.filter(o => o.poll_id == data.item.poll_id);
589
+ return /*#__PURE__*/React.createElement(View, {
590
+ transparent: true,
591
+ style: {
592
+ flexDirection: 'row',
593
+ borderBottomWidth: 1,
594
+ borderColor: Colors.borders.light,
595
+ borderBottomLeftRadius: 8
596
+ }
597
+ }, /*#__PURE__*/React.createElement(View, {
598
+ type: "header",
599
+ style: {
600
+ padding: 20,
601
+ justifyContent: 'center',
602
+ alignItems: 'center',
603
+ borderRightWidth: 1,
604
+ borderColor: Colors.borders.light
605
+ }
606
+ }, /*#__PURE__*/React.createElement(Text, {
607
+ theme: "description",
608
+ style: {
609
+ marginBottom: 4
610
+ }
611
+ }, "Group"), /*#__PURE__*/React.createElement(Text, {
612
+ theme: "h1"
613
+ }, data.item.priority)), options.sort((a, b) => a.priority - b.priority).map(o => {
614
+ return /*#__PURE__*/React.createElement(View, {
615
+ transparent: true,
616
+ style: {
617
+ flex: 1,
618
+ justifyContent: 'center',
619
+ alignItems: 'center',
620
+ padding: 10,
621
+ borderWidth: 1,
622
+ borderColor: o.result_ind == 'win' ? Colors.text.success : Colors.borders.light
623
+ }
624
+ }, /*#__PURE__*/React.createElement(Image, {
625
+ source: {
626
+ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp'
627
+ },
628
+ style: {
629
+ height: 50,
630
+ width: 50
631
+ },
632
+ resizeMode: "cover"
633
+ }), /*#__PURE__*/React.createElement(Text, {
634
+ theme: "h2",
635
+ style: {
636
+ marginTop: 4
637
+ },
638
+ textAlign: "center"
639
+ }, o.option_name));
640
+ }));
641
+ };
642
+ const renderPastPoll = data => {
643
+ return /*#__PURE__*/React.createElement(View, {
644
+ style: {
645
+ flexGrow: 1,
646
+ padding: 10,
647
+ flexDirection: 'row',
648
+ alignItems: 'center'
649
+ }
650
+ }, /*#__PURE__*/React.createElement(Text, {
651
+ theme: "h1"
652
+ }, data.item.poll_question));
653
+ };
654
+ const renderSponsors = data => {
655
+ return /*#__PURE__*/React.createElement(View, {
656
+ float: true,
657
+ style: {
658
+ flexDirection: 'row',
659
+ alignItems: 'center',
660
+ minWidth: 300,
661
+ maxWidth: 350,
662
+ margin: 10,
663
+ padding: 10
664
+ }
665
+ }, /*#__PURE__*/React.createElement(Image, {
666
+ source: {
667
+ uri: data.item.company_image?.url
668
+ },
669
+ style: {
670
+ height: 60,
671
+ width: 60,
672
+ backgroundColor: Colors.text.white,
673
+ borderRadius: 8
674
+ },
675
+ resizeMode: "center"
676
+ }), /*#__PURE__*/React.createElement(View, {
677
+ transparent: true,
678
+ style: {
679
+ flex: 1,
680
+ marginLeft: 10
681
+ }
682
+ }, /*#__PURE__*/React.createElement(Text, {
683
+ theme: "h1"
684
+ }, data.item.company_name), /*#__PURE__*/React.createElement(Text, {
685
+ theme: "description",
686
+ style: {
687
+ marginTop: 4
688
+ }
689
+ }, data.item.company_description)));
690
+ };
439
691
  const renderSections = data => {
440
692
  switch (data.item) {
441
693
  case 'header':
@@ -499,6 +751,150 @@ const Campaign = ({
499
751
  value: `https://play.bettoredge.com/social/campaign/${campaign_id}`,
500
752
  size: 65
501
753
  })) : /*#__PURE__*/React.createElement(React.Fragment, null));
754
+ case 'closest_pin':
755
+ const active_poll = flash_markets[0]; //.find(m => m.flash_active);
756
+ const next_three = flash_markets.filter(m => m.priority > (active_poll?.priority ?? 0)).sort((a, b) => a.priority - b.priority).slice(0, 3);
757
+ return /*#__PURE__*/React.createElement(View, {
758
+ style: {
759
+ flexDirection: 'row',
760
+ flexWrap: 'wrap'
761
+ }
762
+ }, /*#__PURE__*/React.createElement(View, {
763
+ nativeID: "pin_leaderboard",
764
+ style: {
765
+ flex: 1,
766
+ minWidth: 400
767
+ }
768
+ }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Image, {
769
+ source: {
770
+ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1752434537/a95a5b63614b60844f9612cce6cc985a2ed2879c-1600x1067_bfgn61.jpg'
771
+ },
772
+ style: {
773
+ height: 400 * 0.6725,
774
+ width: 400
775
+ },
776
+ resizeMode: "cover"
777
+ }))), /*#__PURE__*/React.createElement(View, {
778
+ style: {
779
+ minWidth: 400
780
+ }
781
+ }, /*#__PURE__*/React.createElement(FlatList, {
782
+ data: campaign_participants.filter(cp => cp.status == 'active').sort((a, b) => parseFloat(a.payload.pin_distance ?? 9999) - parseFloat(b.payload.pin_distance ?? 9999)),
783
+ key: 'closed_pin_leaders',
784
+ keyExtractor: item => item.campaign_participant_id,
785
+ renderItem: renderGolfers
786
+ })), /*#__PURE__*/React.createElement(View, {
787
+ nativeID: "flash",
788
+ style: {
789
+ flex: 4,
790
+ borderLeftWidth: 1,
791
+ borderColor: Colors.borders.light
792
+ }
793
+ }, /*#__PURE__*/React.createElement(View, {
794
+ type: "body",
795
+ style: {
796
+ flex: 1
797
+ }
798
+ }, /*#__PURE__*/React.createElement(View, {
799
+ style: {
800
+ flexDirection: 'row',
801
+ flex: 1
802
+ }
803
+ }, /*#__PURE__*/React.createElement(View, {
804
+ style: {
805
+ flex: 1
806
+ }
807
+ }, active_poll ? /*#__PURE__*/React.createElement(FlashHolder, {
808
+ poll_id: active_poll?.poll_id,
809
+ init_expanded: true,
810
+ hide_tabs: true,
811
+ onRequestAuthenticate: () => console.log(''),
812
+ onRequestLocation: () => console.log(''),
813
+ onFocusPosition: () => console.log('')
814
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(View, {
815
+ style: {
816
+ flex: 1,
817
+ borderLeftWidth: 1,
818
+ borderColor: Colors.borders.light
819
+ }
820
+ }, /*#__PURE__*/React.createElement(View, {
821
+ type: "header",
822
+ style: {
823
+ flexDirection: 'row',
824
+ alignItems: 'center',
825
+ padding: 10
826
+ }
827
+ }, /*#__PURE__*/React.createElement(View, {
828
+ transparent: true,
829
+ style: {
830
+ flex: 1
831
+ }
832
+ }, /*#__PURE__*/React.createElement(Text, {
833
+ theme: "h1"
834
+ }, "Upcoming Groups"), /*#__PURE__*/React.createElement(Text, {
835
+ theme: "description",
836
+ style: {
837
+ marginTop: 8
838
+ }
839
+ }, "Bet on who will get closest to the pin!"))), /*#__PURE__*/React.createElement(View, null, next_three.map((p, i) => {
840
+ return renderUpcomingGolfers({
841
+ item: p,
842
+ index: i
843
+ });
844
+ })))))));
845
+ case 'last_ones':
846
+ const past_three = flash_markets.filter(m => m.priority > (active_poll?.priority ?? 0)).sort((a, b) => b.priority - a.priority).slice(0, 5);
847
+ return /*#__PURE__*/React.createElement(View, {
848
+ style: {
849
+ flex: 1,
850
+ borderLeftWidth: 1,
851
+ borderColor: Colors.borders.light
852
+ }
853
+ }, /*#__PURE__*/React.createElement(View, {
854
+ type: "header",
855
+ style: {
856
+ flexDirection: 'row',
857
+ alignItems: 'center',
858
+ padding: 10
859
+ }
860
+ }, /*#__PURE__*/React.createElement(View, {
861
+ transparent: true,
862
+ style: {
863
+ flex: 1
864
+ }
865
+ }, /*#__PURE__*/React.createElement(Text, {
866
+ theme: "h1"
867
+ }, "Upcoming Groups"), /*#__PURE__*/React.createElement(Text, {
868
+ theme: "description",
869
+ style: {
870
+ marginTop: 8
871
+ }
872
+ }, "Bet on who will get closest to the pin!"))), past_three.map((p, i) => {
873
+ return renderPastPoll({
874
+ item: p,
875
+ index: i
876
+ });
877
+ }));
878
+ case 'sponsors':
879
+ return /*#__PURE__*/React.createElement(View, {
880
+ style: {
881
+ padding: 10,
882
+ borderTopWidth: 1,
883
+ borderColor: Colors.borders.light
884
+ }
885
+ }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
886
+ theme: "h1"
887
+ }, "Sponsors"), /*#__PURE__*/React.createElement(Text, {
888
+ theme: "description",
889
+ style: {
890
+ marginTop: 4
891
+ }
892
+ }, "A massive thank you to all the amazing sponsors")), /*#__PURE__*/React.createElement(AutoScrollingFlatList, {
893
+ data: sponsors,
894
+ renderItem: renderSponsors,
895
+ horizontal: true,
896
+ speed: 50
897
+ }));
502
898
  case 'prize':
503
899
  if (!campaign?.prize_description) {
504
900
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -676,6 +1072,419 @@ const Campaign = ({
676
1072
  const new_bet_event = events.find(e => e.event_id == new_bet_alert?.event_id);
677
1073
  const new_bet_tournament = tournaments.find(t => t.tournament_id == new_bet_alert?.event_id);
678
1074
  const new_bet_league = new_bet_event ? leagues.find(l => l.league_id == new_bet_event.league_id) : leagues.find(l => l.league_id == new_bet_tournament?.league_id);
1075
+ if (mode == 'golf') {
1076
+ const active_poll = flash_markets.filter(m => ['paused', 'active'].includes(m.status)).sort((a, b) => a.priority - b.priority)[0];
1077
+ const next_three = flash_markets.filter(m => m.priority > (active_poll?.priority ?? 0)).sort((a, b) => a.priority - b.priority).slice(0, 3);
1078
+ const past_three = flash_markets.filter(m => m.status == 'closed').sort((a, b) => b.priority - a.priority).slice(0, 3);
1079
+ const active_participant = campaign_participants.find(cp => cp.payload.status == 'active');
1080
+ const active_golfer = players.find(p => p.player_id == active_participant?.player_id);
1081
+ return /*#__PURE__*/React.createElement(View, {
1082
+ style: {
1083
+ flex: 1
1084
+ }
1085
+ }, /*#__PURE__*/React.createElement(ImageBackground, {
1086
+ style: {
1087
+ flex: 1
1088
+ },
1089
+ source: {
1090
+ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1752434537/a95a5b63614b60844f9612cce6cc985a2ed2879c-1600x1067_bfgn61.jpg'
1091
+ }
1092
+ }, /*#__PURE__*/React.createElement(View, {
1093
+ type: "blur",
1094
+ style: {
1095
+ position: 'absolute',
1096
+ top: 0,
1097
+ left: 0,
1098
+ right: 0,
1099
+ bottom: 0
1100
+ }
1101
+ }), /*#__PURE__*/React.createElement(View, {
1102
+ transparent: true,
1103
+ style: {
1104
+ flex: 1,
1105
+ flexDirection: 'row'
1106
+ }
1107
+ }, /*#__PURE__*/React.createElement(View, {
1108
+ transparent: true,
1109
+ style: {
1110
+ flex: 2,
1111
+ margin: 10,
1112
+ minWidth: 350
1113
+ },
1114
+ onLayout: ev => {
1115
+ const {
1116
+ height,
1117
+ width
1118
+ } = ev.nativeEvent.layout;
1119
+ setGolfLeaderSize({
1120
+ height,
1121
+ width: width - 2
1122
+ });
1123
+ }
1124
+ }, /*#__PURE__*/React.createElement(View, {
1125
+ float: true,
1126
+ style: {
1127
+ flex: 1
1128
+ }
1129
+ }, /*#__PURE__*/React.createElement(View, {
1130
+ type: "header",
1131
+ style: {
1132
+ flexDirection: 'row',
1133
+ alignItems: 'center',
1134
+ padding: 10,
1135
+ borderTopRightRadius: 8,
1136
+ borderTopLeftRadius: 8
1137
+ }
1138
+ }, /*#__PURE__*/React.createElement(View, {
1139
+ transparent: true,
1140
+ style: {
1141
+ flex: 1
1142
+ }
1143
+ }, /*#__PURE__*/React.createElement(Text, {
1144
+ theme: "h1"
1145
+ }, "On the Tee Now!"), /*#__PURE__*/React.createElement(Text, {
1146
+ theme: "description"
1147
+ }, "Below are the current betting probabilities for the group on the tee!"))), /*#__PURE__*/React.createElement(View, {
1148
+ style: {
1149
+ flex: 1
1150
+ }
1151
+ }, active_poll ? /*#__PURE__*/React.createElement(FlashHolder, {
1152
+ poll_id: active_poll?.poll_id,
1153
+ init_expanded: true,
1154
+ hide_tabs: true,
1155
+ hide_timer: true,
1156
+ hide_footer: true,
1157
+ no_highlight: true,
1158
+ onRequestAuthenticate: () => console.log(''),
1159
+ onRequestLocation: () => console.log(''),
1160
+ onFocusPosition: () => console.log('')
1161
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(View, {
1162
+ transparent: true
1163
+ }, /*#__PURE__*/React.createElement(Image, {
1164
+ source: {
1165
+ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1752434537/a95a5b63614b60844f9612cce6cc985a2ed2879c-1600x1067_bfgn61.jpg'
1166
+ },
1167
+ style: {
1168
+ height: golf_leader_size.width * 0.6725,
1169
+ width: golf_leader_size.width,
1170
+ alignSelf: 'center',
1171
+ borderBottomRightRadius: 8,
1172
+ borderBottomLeftRadius: 8
1173
+ }
1174
+ }), /*#__PURE__*/React.createElement(View, {
1175
+ transparent: true,
1176
+ style: {
1177
+ position: 'absolute',
1178
+ top: 0,
1179
+ left: 0,
1180
+ right: 0,
1181
+ bottom: 0,
1182
+ justifyContent: 'center',
1183
+ alignItems: 'center'
1184
+ }
1185
+ }, /*#__PURE__*/React.createElement(View, {
1186
+ float: true,
1187
+ style: {
1188
+ padding: 20
1189
+ }
1190
+ }, /*#__PURE__*/React.createElement(Text, {
1191
+ theme: "h2",
1192
+ textAlign: "center"
1193
+ }, "Windsong Farm South Course"), /*#__PURE__*/React.createElement(Text, {
1194
+ theme: "h1",
1195
+ style: {
1196
+ marginTop: 10
1197
+ },
1198
+ textAlign: "center"
1199
+ }, "Hole 16"), /*#__PURE__*/React.createElement(View, {
1200
+ transparent: true,
1201
+ style: {
1202
+ marginTop: 10,
1203
+ padding: 10,
1204
+ justifyContent: 'center',
1205
+ alignItems: 'center'
1206
+ }
1207
+ }, /*#__PURE__*/React.createElement(QRCode, {
1208
+ value: `https://play.bettoredge.com/social/campaign/${campaign_id}`,
1209
+ size: 100,
1210
+ style: {
1211
+ backgroundColor: 'transparent'
1212
+ }
1213
+ }))))))), /*#__PURE__*/React.createElement(View, {
1214
+ float: true,
1215
+ style: {
1216
+ flex: 3,
1217
+ minWidth: 350,
1218
+ margin: 10
1219
+ }
1220
+ }, /*#__PURE__*/React.createElement(View, {
1221
+ type: "header",
1222
+ style: {
1223
+ padding: 10,
1224
+ borderTopRightRadius: 8,
1225
+ borderTopLeftRadius: 8
1226
+ }
1227
+ }, /*#__PURE__*/React.createElement(View, {
1228
+ transparent: true,
1229
+ style: {
1230
+ flex: 1
1231
+ }
1232
+ }, /*#__PURE__*/React.createElement(Text, {
1233
+ theme: "h1"
1234
+ }, "Closest to the hole #16"))), active_golfer ? /*#__PURE__*/React.createElement(View, {
1235
+ style: {
1236
+ backgroundColor: Colors.views.gold,
1237
+ padding: 10
1238
+ }
1239
+ }, /*#__PURE__*/React.createElement(Text, {
1240
+ theme: "h2"
1241
+ }, "Now On The Tee"), /*#__PURE__*/React.createElement(View, {
1242
+ transparent: true,
1243
+ style: {
1244
+ flexDirection: 'row',
1245
+ marginTop: 5
1246
+ }
1247
+ }, /*#__PURE__*/React.createElement(Image, {
1248
+ source: {
1249
+ uri: active_golfer.profile_pic && active_golfer.profile_pic != '' ? active_golfer.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp'
1250
+ },
1251
+ style: {
1252
+ height: 35,
1253
+ width: 35,
1254
+ borderRadius: 100
1255
+ }
1256
+ }), /*#__PURE__*/React.createElement(View, {
1257
+ transparent: true,
1258
+ style: {
1259
+ flex: 1,
1260
+ marginLeft: 10
1261
+ }
1262
+ }, /*#__PURE__*/React.createElement(Text, {
1263
+ theme: "h1",
1264
+ color: Colors.text.white
1265
+ }, active_golfer.first_name, " ", active_golfer.last_name), /*#__PURE__*/React.createElement(Text, {
1266
+ theme: "description",
1267
+ style: {
1268
+ marginTop: 3
1269
+ }
1270
+ }, "@", active_golfer.username)), /*#__PURE__*/React.createElement(Icons.GolferIcon, {
1271
+ size: 28,
1272
+ color: Colors.text.white
1273
+ }))) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
1274
+ style: {
1275
+ flex: 1,
1276
+ borderBottomRightRadius: 8,
1277
+ borderBottomLeftRadius: 8
1278
+ }
1279
+ }, /*#__PURE__*/React.createElement(View, {
1280
+ style: {
1281
+ flexDirection: 'row'
1282
+ }
1283
+ }, /*#__PURE__*/React.createElement(View, {
1284
+ transparent: true,
1285
+ style: {
1286
+ padding: 10
1287
+ }
1288
+ }, /*#__PURE__*/React.createElement(Text, {
1289
+ theme: "h1"
1290
+ }, "LEADERBOARD"), /*#__PURE__*/React.createElement(Text, {
1291
+ theme: "description",
1292
+ style: {
1293
+ marginTop: 4
1294
+ }
1295
+ }, "Closest to the pin - distance in feet from the pin")), loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
1296
+ color: Colors.text.h1,
1297
+ size: 14
1298
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement(FlatList, {
1299
+ data: campaign_participants.filter(cp => cp.status == 'active').sort((a, b) => parseFloat(a.payload.pin_distance ? a.payload.pin_distance : 9999) - parseFloat(b.payload.pin_distance ? b.payload.pin_distance : 9999)),
1300
+ key: 'closed_pin_leaders',
1301
+ keyExtractor: item => item.campaign_participant_id,
1302
+ renderItem: renderGolfers
1303
+ })), /*#__PURE__*/React.createElement(View, {
1304
+ type: "header",
1305
+ style: {
1306
+ padding: 10,
1307
+ borderTopWidth: 1,
1308
+ borderColor: Colors.borders.light,
1309
+ overflow: 'hidden',
1310
+ borderBottomRightRadius: 8,
1311
+ borderBottomLeftRadius: 8
1312
+ }
1313
+ }, /*#__PURE__*/React.createElement(View, {
1314
+ transparent: true
1315
+ }, /*#__PURE__*/React.createElement(Text, {
1316
+ theme: "h1"
1317
+ }, "Sponsors"), /*#__PURE__*/React.createElement(Text, {
1318
+ theme: "h2",
1319
+ style: {
1320
+ marginTop: 4
1321
+ }
1322
+ }, "A massive thank you to all the amazing sponsors")), /*#__PURE__*/React.createElement(AutoScrollingFlatList, {
1323
+ data: sponsors,
1324
+ renderItem: renderSponsors,
1325
+ horizontal: true,
1326
+ speed: 20
1327
+ }))), /*#__PURE__*/React.createElement(View, {
1328
+ transparent: true,
1329
+ style: {
1330
+ flex: 4
1331
+ }
1332
+ }, /*#__PURE__*/React.createElement(View, {
1333
+ float: true,
1334
+ nativeID: "next_up",
1335
+ style: {
1336
+ flexGrow: 1,
1337
+ margin: 10
1338
+ }
1339
+ }, /*#__PURE__*/React.createElement(View, {
1340
+ type: "header",
1341
+ style: {
1342
+ flexDirection: 'row',
1343
+ alignItems: 'center',
1344
+ padding: 10,
1345
+ borderTopRightRadius: 8,
1346
+ borderTopLeftRadius: 8
1347
+ }
1348
+ }, /*#__PURE__*/React.createElement(Icons.GolferIcon, {
1349
+ size: 28,
1350
+ color: Colors.text.h1
1351
+ }), /*#__PURE__*/React.createElement(View, {
1352
+ transparent: true,
1353
+ style: {
1354
+ flex: 1,
1355
+ marginLeft: 10
1356
+ }
1357
+ }, /*#__PURE__*/React.createElement(Text, {
1358
+ theme: "h1"
1359
+ }, "Upcoming Groups"), /*#__PURE__*/React.createElement(Text, {
1360
+ theme: "description",
1361
+ style: {
1362
+ marginTop: 3
1363
+ }
1364
+ }, "Groups that are soon to be up!"))), /*#__PURE__*/React.createElement(View, {
1365
+ style: {
1366
+ borderBottomRightRadius: 8,
1367
+ borderBottomLeftRadius: 8
1368
+ }
1369
+ }, /*#__PURE__*/React.createElement(FlatList, {
1370
+ data: next_three.sort((a, b) => a.priority - b.priority),
1371
+ renderItem: renderUpcomingGolfers,
1372
+ key: 'next_up',
1373
+ keyExtractor: item => item.poll_id.toString()
1374
+ }))), /*#__PURE__*/React.createElement(View, {
1375
+ float: true,
1376
+ nativeID: "past",
1377
+ style: {
1378
+ flexGrow: 1,
1379
+ margin: 10
1380
+ }
1381
+ }, /*#__PURE__*/React.createElement(View, {
1382
+ type: "header",
1383
+ style: {
1384
+ flexDirection: 'row',
1385
+ alignItems: 'center',
1386
+ padding: 10,
1387
+ borderTopRightRadius: 8,
1388
+ borderTopLeftRadius: 8
1389
+ }
1390
+ }, /*#__PURE__*/React.createElement(Icons.GolferIcon, {
1391
+ size: 28,
1392
+ color: Colors.text.h1
1393
+ }), /*#__PURE__*/React.createElement(View, {
1394
+ transparent: true,
1395
+ style: {
1396
+ flex: 1,
1397
+ marginLeft: 10
1398
+ }
1399
+ }, /*#__PURE__*/React.createElement(Text, {
1400
+ theme: "h1"
1401
+ }, "Recently Completed Groups"), /*#__PURE__*/React.createElement(Text, {
1402
+ theme: "description",
1403
+ style: {
1404
+ marginTop: 3
1405
+ }
1406
+ }, "Winners from past groups!"))), /*#__PURE__*/React.createElement(View, {
1407
+ style: {
1408
+ borderBottomRightRadius: 8,
1409
+ borderBottomLeftRadius: 8
1410
+ }
1411
+ }, /*#__PURE__*/React.createElement(FlatList, {
1412
+ data: past_three.sort((a, b) => b.priority - a.priority),
1413
+ renderItem: renderClosedGolfers,
1414
+ key: 'past_up',
1415
+ keyExtractor: item => item.poll_id.toString()
1416
+ }))), campaign ? /*#__PURE__*/React.createElement(View, {
1417
+ type: "header",
1418
+ style: {
1419
+ margin: 10,
1420
+ flexDirection: 'row',
1421
+ alignItems: 'center',
1422
+ padding: 10,
1423
+ borderRadius: 8
1424
+ }
1425
+ }, /*#__PURE__*/React.createElement(Image, {
1426
+ source: {
1427
+ uri: campaign.campaign_image?.url
1428
+ },
1429
+ style: {
1430
+ height: 80,
1431
+ width: 80,
1432
+ borderRadius: 8
1433
+ },
1434
+ resizeMode: "center"
1435
+ }), /*#__PURE__*/React.createElement(View, {
1436
+ transparent: true,
1437
+ style: {
1438
+ flex: 1,
1439
+ marginLeft: 20
1440
+ }
1441
+ }, /*#__PURE__*/React.createElement(Text, {
1442
+ theme: "h1",
1443
+ size: 18
1444
+ }, campaign.campaign_name), /*#__PURE__*/React.createElement(Text, {
1445
+ theme: "description",
1446
+ style: {
1447
+ marginTop: 4
1448
+ }
1449
+ }, campaign.description))) : /*#__PURE__*/React.createElement(React.Fragment, null)))), new_player_alert && new_player ? /*#__PURE__*/React.createElement(View, {
1450
+ type: "blur",
1451
+ style: {
1452
+ position: 'absolute',
1453
+ top: 0,
1454
+ left: 0,
1455
+ right: 0,
1456
+ bottom: 0,
1457
+ alignItems: 'center',
1458
+ paddingTop: 100
1459
+ }
1460
+ }, /*#__PURE__*/React.createElement(GolferAlert, {
1461
+ campaign_participant: new_player_alert,
1462
+ player: new_player,
1463
+ view_mode: view_mode,
1464
+ onViewProfile: onViewProfile,
1465
+ onClose: () => setNewPlayerAlert(undefined)
1466
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(SocketManager, {
1467
+ onConnect: () => {
1468
+ if (!needs_reload) {
1469
+ return;
1470
+ }
1471
+ },
1472
+ onDisconnect: () => setNeedsReload(true),
1473
+ subscribed_events: ['UPDATE_CAMPAIGN_PARTICIPANTS'],
1474
+ onSocketEvent: event => {
1475
+ switch (event.type) {
1476
+ case 'UPDATE_CAMPAIGN_PARTICIPANTS':
1477
+ let this_participants = event.campaign_participants.filter(cp => cp.campaign_id == campaign_id);
1478
+ if (this_participants.length == 0) {
1479
+ return;
1480
+ }
1481
+ return setSocketParticipants(event.campaign_participants);
1482
+ default:
1483
+ return;
1484
+ }
1485
+ }
1486
+ }));
1487
+ }
679
1488
  return /*#__PURE__*/React.createElement(View, {
680
1489
  style: {
681
1490
  flex: 1
@@ -768,7 +1577,6 @@ const Campaign = ({
768
1577
  if (!needs_reload) {
769
1578
  return;
770
1579
  }
771
- console.log('GET DATA!!!`');
772
1580
  },
773
1581
  onDisconnect: () => setNeedsReload(true),
774
1582
  subscribed_events: ['UPDATE_CAMPAIGN_PARTICIPANTS'],