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