be-components 1.2.9 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/lib/commonjs/Competition/api/index.js +1 -1
  2. package/lib/commonjs/Competition/api/index.js.map +1 -1
  3. package/lib/commonjs/Competition/components/CompetitionPlay.js +1 -1
  4. package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -1
  5. package/lib/commonjs/Competition/components/MarketsCard.js.map +1 -1
  6. package/lib/commonjs/Competition/index.js +1 -1
  7. package/lib/commonjs/Competition/index.js.map +1 -1
  8. package/lib/commonjs/CompetitionManager/api/index.js +153 -35
  9. package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
  10. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js +170 -0
  11. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js.map +1 -0
  12. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +495 -423
  13. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  14. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js +134 -0
  15. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js.map +1 -0
  16. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +96 -73
  17. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  18. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js +147 -127
  19. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -1
  20. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +38 -127
  21. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  22. package/lib/commonjs/CompetitionManager/components/ContestSelector.js +388 -0
  23. package/lib/commonjs/CompetitionManager/components/ContestSelector.js.map +1 -0
  24. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +436 -0
  25. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -0
  26. package/lib/commonjs/CompetitionManager/components/MarketSelector.js +36 -26
  27. package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -1
  28. package/lib/commonjs/CompetitionManager/index.js +477 -18
  29. package/lib/commonjs/CompetitionManager/index.js.map +1 -1
  30. package/lib/commonjs/Components/SearchBox.js +82 -0
  31. package/lib/commonjs/Components/SearchBox.js.map +1 -0
  32. package/lib/commonjs/Squares/components/Countdown.js +74 -0
  33. package/lib/commonjs/Squares/components/Countdown.js.map +1 -0
  34. package/lib/commonjs/Squares/components/SquaresBoard.js +95 -2
  35. package/lib/commonjs/Squares/components/SquaresBoard.js.map +1 -1
  36. package/lib/commonjs/Squares/index.js +1 -0
  37. package/lib/commonjs/Squares/index.js.map +1 -1
  38. package/lib/module/Competition/api/index.js +1 -1
  39. package/lib/module/Competition/api/index.js.map +1 -1
  40. package/lib/module/Competition/components/CompetitionPlay.js +1 -1
  41. package/lib/module/Competition/components/CompetitionPlay.js.map +1 -1
  42. package/lib/module/Competition/components/MarketsCard.js.map +1 -1
  43. package/lib/module/Competition/index.js +1 -1
  44. package/lib/module/Competition/index.js.map +1 -1
  45. package/lib/module/CompetitionManager/api/index.js +153 -35
  46. package/lib/module/CompetitionManager/api/index.js.map +1 -1
  47. package/lib/module/CompetitionManager/components/AthleteSelector.js +161 -0
  48. package/lib/module/CompetitionManager/components/AthleteSelector.js.map +1 -0
  49. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +493 -425
  50. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  51. package/lib/module/CompetitionManager/components/CompetitionHeader.js +127 -0
  52. package/lib/module/CompetitionManager/components/CompetitionHeader.js.map +1 -0
  53. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +99 -76
  54. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  55. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js +145 -127
  56. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -1
  57. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +39 -131
  58. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  59. package/lib/module/CompetitionManager/components/ContestSelector.js +379 -0
  60. package/lib/module/CompetitionManager/components/ContestSelector.js.map +1 -0
  61. package/lib/module/CompetitionManager/components/ContestSettingsForm.js +428 -0
  62. package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -0
  63. package/lib/module/CompetitionManager/components/MarketSelector.js +34 -26
  64. package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -1
  65. package/lib/module/CompetitionManager/index.js +478 -19
  66. package/lib/module/CompetitionManager/index.js.map +1 -1
  67. package/lib/module/Components/SearchBox.js +73 -0
  68. package/lib/module/Components/SearchBox.js.map +1 -0
  69. package/lib/module/Squares/components/Countdown.js +65 -0
  70. package/lib/module/Squares/components/Countdown.js.map +1 -0
  71. package/lib/module/Squares/components/SquaresBoard.js +97 -4
  72. package/lib/module/Squares/components/SquaresBoard.js.map +1 -1
  73. package/lib/module/Squares/index.js +1 -0
  74. package/lib/module/Squares/index.js.map +1 -1
  75. package/lib/typescript/src/CompetitionManager/api/index.d.ts +32 -3
  76. package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
  77. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts +18 -0
  78. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts.map +1 -0
  79. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +13 -1
  80. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  81. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts +20 -0
  82. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -0
  83. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +2 -1
  84. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  85. package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts +1 -1
  86. package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  87. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +3 -3
  88. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  89. package/lib/typescript/src/CompetitionManager/components/ContestSelector.d.ts +16 -0
  90. package/lib/typescript/src/CompetitionManager/components/ContestSelector.d.ts.map +1 -0
  91. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts +15 -0
  92. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -0
  93. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts +3 -2
  94. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  95. package/lib/typescript/src/CompetitionManager/index.d.ts +1 -1
  96. package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -1
  97. package/lib/typescript/src/Components/SearchBox.d.ts +10 -0
  98. package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -0
  99. package/lib/typescript/src/Squares/components/Countdown.d.ts +10 -0
  100. package/lib/typescript/src/Squares/components/Countdown.d.ts.map +1 -0
  101. package/lib/typescript/src/Squares/components/SquaresBoard.d.ts +2 -1
  102. package/lib/typescript/src/Squares/components/SquaresBoard.d.ts.map +1 -1
  103. package/lib/typescript/src/Squares/index.d.ts.map +1 -1
  104. package/package.json +2 -1
  105. package/src/Competition/api/index.ts +3 -3
  106. package/src/Competition/components/CompetitionPlay.tsx +1 -1
  107. package/src/Competition/components/MarketsCard.tsx +2 -2
  108. package/src/Competition/index.tsx +1 -1
  109. package/src/CompetitionManager/api/index.ts +71 -13
  110. package/src/CompetitionManager/components/AthleteSelector.tsx +127 -0
  111. package/src/CompetitionManager/components/CompetitionContestsForm.tsx +156 -261
  112. package/src/CompetitionManager/components/CompetitionHeader.tsx +101 -0
  113. package/src/CompetitionManager/components/CompetitionInfoForm.tsx +57 -45
  114. package/src/CompetitionManager/components/CompetitionMatchMarketCard.tsx +29 -70
  115. package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +36 -103
  116. package/src/CompetitionManager/components/ContestSelector.tsx +269 -0
  117. package/src/CompetitionManager/components/ContestSettingsForm.tsx +281 -0
  118. package/src/CompetitionManager/components/MarketSelector.tsx +34 -23
  119. package/src/CompetitionManager/index.tsx +399 -15
  120. package/src/Components/SearchBox.tsx +54 -0
  121. package/src/Squares/components/Countdown.tsx +52 -0
  122. package/src/Squares/components/SquaresBoard.tsx +57 -5
  123. package/src/Squares/index.tsx +1 -0
  124. package/src/types.d.ts +38 -4
@@ -1,434 +1,502 @@
1
- import React from 'react';
2
- //import { FlatList, Image, TouchableOpacity, View } from "react-native"
3
-
4
- //import { ManageCompetitionApi } from '../api';
5
- //import Colors from '../../constants/colors';
6
- //import { Button, Icons, Text } from '../../Components';
7
- //import CompetitionMatchMarketCard from './CompetitionMatchMarketCard';
8
- //import moment from 'moment-mini';
9
- //import { view_styles } from '../../constants/styles';
10
- //import MarketSelector from './MarketSelector';
11
-
12
- const CompetitionContestsForm = ({}) => {
13
- /*
14
- const [ expanded, setExpanded ] = useState(true);
15
- const [ contests_visible, setContestsVisible ] = useState(false);
16
- const [ show_match_markets, setShowMatchMarkets ] = useState<string[]>([]);
17
- const [ selectable_athletes, setAthletes ] = useState<AthleteProps[]>([]);
18
- const [ selectable_events, setTeamEvents ] = useState<EventProps[]>([]);
19
- const [ competition_summaries, setCompetitionSummaries ] = useState<any[]>([]);
20
- const [ show_athletes, setShowAthletes ] = useState<{
21
- visible:boolean,
22
- event_id?:string,
23
- event_type?:string,
24
- market_id?:string,
25
- team_ids:string[],
26
- restricted_ids?:string[],
27
- top:number,
28
- right:number,
29
- positions:string[],
30
- selected_athletes:string[],
31
- }>({
32
- visible:false,
33
- positions:[],
34
- top:0,
35
- right:0,
36
- selected_athletes:[],
37
- team_ids:[]
38
- })
39
- const [ show_markets, setShowMarkets ] = useState<{
40
- visible:boolean,
41
- event_id?:string,
42
- event_type?: string,
43
- selected_markets:string[],
44
- supported_markets:MarketProps[],
45
- }>({
46
- visible:false,
47
- supported_markets: [],
48
- selected_markets: [],
49
- });
50
- const unique_team_events = [ ...new Set(competition_matches.filter(cm => cm.event_type == 'team').map(cm => cm.event_id)) ]
51
- */
52
-
53
- /*
54
- const handleSelectEvent = async(event:EventProps) => {
55
- onSaveCompetitionMatch(competition.competition_id, event.event_id, 'team', 'event', event)
56
- //setTeamEvents(team_events.concat(event))
1
+ import React, { useState } from 'react';
2
+ import { FlatList, Image, TouchableOpacity, View } from "react-native";
3
+ import Colors from '../../constants/colors';
4
+ import { Button, Icons, Switch, Text } from '../../Components';
5
+ import CompetitionMatchMarketCard from './CompetitionMatchMarketCard';
6
+ import moment from 'moment-mini';
7
+ import { view_styles } from '../../constants/styles';
8
+ const CompetitionContestsForm = ({
9
+ is_valid,
10
+ competition,
11
+ width,
12
+ primary_markets,
13
+ events,
14
+ athletes,
15
+ markets,
16
+ leagues,
17
+ competition_matches,
18
+ competition_match_markets,
19
+ onDeleteMarket,
20
+ onRemovePrimaryMarket,
21
+ onDeleteCompetitionMatch,
22
+ onDeleteCompetitionMatchMarkets,
23
+ onShowAthletes,
24
+ onShowContests,
25
+ onShowMarkets,
26
+ onAddPrimaryMarket
27
+ }) => {
28
+ const [expanded, setExpanded] = useState(true);
29
+ const [show_match_markets, setShowMatchMarkets] = useState([]);
30
+ const [active_contest_type] = useState('team');
31
+ const [expanded_contests, setExpandedContests] = useState([]);
32
+ const unique_team_events = [...new Set(competition_matches.filter(cm => cm.event_type == 'team').map(cm => cm.event_id))];
33
+ const renderPrimaryMarkets = data => {
34
+ return /*#__PURE__*/React.createElement(View, {
35
+ style: {
36
+ padding: 10,
37
+ width: 100,
38
+ borderRadius: 8,
39
+ backgroundColor: Colors.shades.white,
40
+ margin: 5,
41
+ ...view_styles.float
57
42
  }
58
- */
59
- /*
60
- const handleSelectAthlete = async(athlete:AthleteProps) => {
61
-
62
- if(!show_athletes?.event_id){ return alert('Unable to process') }
63
- setAthletes(athletes.concat(athlete))
64
- let latest_trades = await MarketApi.getLatestTradesByEventIds([show_athletes.event_id], show_athletes.event_type);
65
- latest_trades = latest_trades.filter(lt => lt.market_id == show_athletes.market_id && lt.market_type == 'FOR_MONEY' && lt.side_type == 'athlete' && lt.side_id == athlete.athlete_id);
66
- if(latest_trades.length !== 2){ return alert('We do not have data for this athlete') }
67
- //First we need to check if we have an empty competition match (match with no side_id_override)
68
- const existing_cm = competition_matches.find(cm => cm.event_id == show_athletes.event_id && cm.event_type == show_athletes.event_type && cm.market_id_override == show_athletes.market_id && !cm.side_id_override);
69
- if(existing_cm){
70
- //Then we just need to add the side_id override to the cm and then create the cmms
71
- onUpdateCompetitionMatch({ ...existing_cm, side_id_override: athlete.athlete_id })
72
- //Create the cmms
73
- const cmms:CompetitionMatchMarketProps[] = []
74
- latest_trades.map(t => cmms.push({ ...createCompetitionMatchMarketFromTrade(t), competition_match_id: existing_cm.competition_match_id }))
75
- if(cmms.length != 2){ return alert('Unable to process') }
76
- onSaveCompetitionMatchMarkets(cmms)
77
- } else {
78
- //There was not an existing placeholder - we now need to auto create a match
79
- switch(show_athletes.event_type){
80
- case 'team':
81
- const event = team_events.find(e => e.event_id == show_athletes.event_id)
82
- if(!event){ return alert('Unable to process') }
83
- const new_cm = await onSaveCompetitionMatch(competition.competition_id, show_athletes.event_id, show_athletes.event_type, 'athlete', event, show_athletes.market_id, 'athlete', athlete.athlete_id);
84
- const cmms:CompetitionMatchMarketProps[] = []
85
- latest_trades.map(t => cmms.push({ ...createCompetitionMatchMarketFromTrade(t), competition_match_id: new_cm.competition_match_id }))
86
- if(cmms.length != 2){ return alert('Unable to process') }
87
- onSaveCompetitionMatchMarkets(cmms)
88
- break
89
- default: return alert('Not handled for this!')
90
- }
91
- }
92
- setShowAthletes({
93
- ...show_athletes,
94
- selected_athletes: show_athletes.selected_athletes.concat(athlete.athlete_id)
95
- })
96
-
43
+ }, /*#__PURE__*/React.createElement(Text, {
44
+ style: {
45
+ marginBottom: 10
46
+ },
47
+ theme: "header"
48
+ }, data.item.market.type), /*#__PURE__*/React.createElement(Switch, {
49
+ switch_type: "on_off",
50
+ value: data.item.included,
51
+ onChange: val => val ? onAddPrimaryMarket(data.item.market) : onRemovePrimaryMarket(data.item.market)
52
+ }));
53
+ };
54
+ const renderMarkets = data => {
55
+ const market = markets.find(m => m.market_id == data.item);
56
+ if (!market) {
57
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
58
+ }
59
+ const show_details = show_match_markets.includes(`${data.event_type}:${data.event_id}:${data.item}`) ? true : false;
60
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
61
+ style: {
62
+ flex: 1,
63
+ borderRadius: 8,
64
+ borderWidth: 1,
65
+ borderColor: Colors.shades.shade600,
66
+ padding: 10,
67
+ margin: 3,
68
+ minWidth: 125,
69
+ backgroundColor: show_details ? Colors.brand.midnight : Colors.shades.white
70
+ },
71
+ onPress: () => {
72
+ if (show_details) {
73
+ return setShowMatchMarkets(show_match_markets.filter(smm => smm != `${data.event_type}:${data.event_id}:${data.item}`));
74
+ }
75
+ return setShowMatchMarkets(show_match_markets.concat(`${data.event_type}:${data.event_id}:${data.item}`));
97
76
  }
98
- */
99
-
100
- /*
101
- const handleSelectMarket = async(market:MarketProps) => {
102
-
103
- if(!show_markets){ return alert('Unable to process') }
104
- if(market.level == 'event' && market.primary_market){
105
- let competition_match = competition_matches.find(cm => cm.event_id == show_markets.event_id && cm.event_type == show_markets.event_type && !cm.market_id_override)
106
- if(!competition_match){ return alert('Unable to process this primary market!') }
107
- //HERE IS HWERE WE WILL CREATE THE EMPTY MATCH MARKET!
108
- let latest_trades = await MarketApi.getLatestTradesByEventIds([show_markets.event_id], show_markets.event_type);
109
- latest_trades = latest_trades.filter(lt => lt.market_id == market.market_id && lt.market_type == 'FOR_MONEY');
110
- if(latest_trades.length != 2){ return alert('Unable to add this market') }
111
- const cmms:CompetitionMatchMarketProps[] = []
112
- latest_trades.map(t => cmms.push({ ...createCompetitionMatchMarketFromTrade(t), competition_match_id: competition_match.competition_match_id }))
113
- if(cmms.length != 2){ return alert('Unable to process') }
114
- onSaveCompetitionMatchMarkets(cmms)
115
- setShowMarkets({ ...show_markets, selected_markets: show_markets.selected_markets.concat(market.market_id)})
116
- return
77
+ }, /*#__PURE__*/React.createElement(View, {
78
+ style: {
79
+ flexDirection: 'row'
117
80
  }
118
- //Okay! This was a non-primary market
119
- //There will not be an existing competition match so we need to create a new one!
120
- if(market.event_type == 'team'){
121
- let event = team_events.find(e => e.event_id == show_markets.event_id);
122
- if(!event){ return alert('Unable to process this') }
123
- onSaveCompetitionMatch(competition.competition_id, show_markets.event_id, show_markets.event_type, market.level, event, market.market_id, market.level, undefined);
124
- setShowMarkets({ ...show_markets, selected_markets: show_markets.selected_markets.concat(market.market_id)})
125
- return
81
+ }, /*#__PURE__*/React.createElement(Button, {
82
+ title: "X",
83
+ title_color: Colors.shades.white,
84
+ backgroundColor: Colors.utility.error,
85
+ onPress: async () => {
86
+ const confirmed = await confirm('Are you sure you want to delete this market?');
87
+ if (!confirmed) {
88
+ return;
89
+ }
90
+ onDeleteMarket(data.event_id, data.event_type, market);
126
91
  }
127
-
128
- }
129
- */
130
-
131
- /*
132
- const renderMarkets = (data: { item:string, index:number, event_id:string, event_type:string }) => {
133
- const market = markets.find(m => m.market_id == data.item);
134
- if(!market){ return <></> }
135
- const show_details = show_match_markets.includes(`${data.event_type}:${data.event_id}:${data.item}`) ? true : false
136
- return (
137
- <TouchableOpacity style={{ flex:1,borderRadius:8, borderWidth:1, borderColor:Colors.shades.shade600, padding:10, margin:3, maxWidth:125, minWidth:75, backgroundColor:show_details ? Colors.brand.midnight : Colors.shades.white }}
138
- onPress={() => {
139
- if(show_details){ return setShowMatchMarkets(show_match_markets.filter(smm => smm != `${data.event_type}:${data.event_id}:${data.item}`)) }
140
- return setShowMatchMarkets(show_match_markets.concat(`${data.event_type}:${data.event_id}:${data.item}`))
141
- }}>
142
- <Text size={14} color={show_details?Colors.shades.white:Colors.brand.midnight} weight="bold" textAlign="center">{market.stat_label ?? market.type}</Text>
143
- <Text style={{ marginTop:3 }} size={12} color={show_details?Colors.shades.white:Colors.brand.midnight} textAlign="center">{market.description}</Text>
144
- {market.level == 'athlete' && show_details ?
145
- <Button
146
- title="Add Athlete"
147
- title_size={10}
148
- style={{ marginTop:5 }}
149
- title_color={Colors.brand.electric}
150
- backgroundColor={Colors.shades.white}
151
- onPress={async(evt) => {
152
-
153
- if(data.event_type != 'team'){ return alert('Only supported for team based events currently') }
154
- let latest_trades = await MarketApi.getLatestTradesByEventIds([data.event_id], data.event_type);
155
- latest_trades = latest_trades.filter(lt => lt.market_id == data.item && lt.market_type == 'FOR_MONEY' && lt.side_type == 'athlete');
156
- let restricted_ids = [ ...new Set(latest_trades.map(t => t.side_id)) ]
157
- const event = team_events.find(e => e.event_id == data.event_id)
158
- let team_ids = [event.away_team_id, event.home_team_id]
159
- const selected_athletes = competition_matches.filter(cm => cm.event_id == data.event_id && cm.event_type == data.event_type && cm.market_id_override == data.item && cm.side_type_override=='athlete').map(cm => cm.side_id_override);
160
- setShowAthletes({
161
- visible: true,
162
- selected_athletes,
163
- team_ids,
164
- market_id:data.item,
165
- restricted_ids,
166
- positions:market.supported_positions ?? [],
167
- event_id:data.event_id,
168
- event_type: data.event_type,
169
- top:evt.nativeEvent.offsetX,
170
- right:evt.nativeEvent.offsetY
171
- })
172
-
173
- }}
174
- />
175
- :<></>}
176
- </TouchableOpacity>
177
-
178
- )
179
- }
180
- */
181
-
182
- /*
183
- const showDetails = (show_event_id:string, show_event_type:string) => {
184
-
185
- let show_cms:CompetitionMatchProps[] = []
186
- show_match_markets.map(smm => {
187
- let split_smm = smm.split(':')
188
- let event_type = split_smm[0]
189
- let event_id = split_smm[1]
190
- let market_id = split_smm[2]
191
- if(event_id != show_event_id){ return }
192
- if(show_event_type != event_type){ return }
193
- const market = markets.find(m => m.market_id == market_id);
194
- if(market.level == 'event' && market.primary_market){
195
- const primary_cm = competition_matches.find(cm => cm.event_id == event_id && cm.event_type == event_type && !cm.market_id_override);
196
- const primary_cmms = competition_match_markets.filter(cmm => cmm.competition_match_id == primary_cm?.competition_match_id && cmm.market_id == market_id);
197
- show_cms.push({ ...primary_cm, competition_match_markets:primary_cmms })
198
- }
199
- if(market.level == 'athlete'){
200
- const cms = competition_matches.filter(cm => cm.event_id == event_id && cm.event_type == event_type && cm.market_id_override == market_id)
201
- cms.map(cm => {
202
- let cmm = competition_match_markets.filter(cmm => cmm.competition_match_id == cm.competition_match_id);
203
- if(cmm.length == 2){
204
- show_cms.push({ ...cm, competition_match_markets: cmm })
205
- }
206
- })
207
- }
208
-
209
- })
210
- return show_cms
211
-
212
- return []
213
- }
214
- */
215
-
216
- /*
217
- const getMatchTitle = (cm:CompetitionMatchProps, market:MarketProps):{image_url?:string, header:string, description:string} => {
218
-
219
- let error = { header: 'Market', description:market.description }
220
- switch(cm.event_type){
221
- case 'team':
222
- const event = team_events.find(e => e.event_id == cm.event_id)
223
- if(!event){ return error }
224
- if(!cm.market_id_override){
225
- //This is a primary one that we can just do the market name and event title
226
- return { header: event.event_title, description: market.description }
227
- }
228
- switch(cm.side_type_override){
229
- case 'athlete':
230
- const athlete = athletes.find(a => a.athlete_id == cm.side_id_override)
231
- if(!athlete){ return error }
232
- return { image_url:athlete.image?.url, header: `${athlete.first_name} ${athlete.last_name} ${market.stat_label}`, description:market.description }
233
- default: return error
234
- }
235
- default: return error
92
+ }), /*#__PURE__*/React.createElement(View, {
93
+ style: {
94
+ flex: 1
236
95
  }
237
-
238
- }
239
- */
240
-
241
- /*
242
- const renderCompetitionMatches = (data: { item:CompetitionMatchProps, index:number }) => {
243
- if(!data.item.competition_match_markets){ return }
244
- const market = markets.find(m => data.item.competition_match_markets && m.market_id == data.item.competition_match_markets[0]?.market_id)
245
- if(!market){ return <></> }
246
- const { image_url, header, description } = getMatchTitle(data.item, market)
247
- let match_summaries = competition_summaries.filter(cs => cs.competition_match_id == data.item.competition_match_id && cs.market_id == market.market_id)
248
- if(data.item.side_id_override){
249
- match_summaries = match_summaries.filter(ms => ms.side_id == data.item.side_id_override);
96
+ }, /*#__PURE__*/React.createElement(Text, {
97
+ size: 14,
98
+ color: show_details ? Colors.shades.white : Colors.brand.midnight,
99
+ weight: "bold",
100
+ textAlign: "center"
101
+ }, market.stat_label ?? market.type), /*#__PURE__*/React.createElement(Text, {
102
+ style: {
103
+ marginTop: 3
104
+ },
105
+ size: 12,
106
+ color: show_details ? Colors.shades.white : Colors.brand.midnight,
107
+ textAlign: "center"
108
+ }, market.description))), market.level == 'athlete' && show_details ? /*#__PURE__*/React.createElement(Button, {
109
+ title: "ADD ATHLETE",
110
+ style: {
111
+ marginTop: 5
112
+ },
113
+ padding: 10,
114
+ title_color: Colors.brand.electric,
115
+ backgroundColor: Colors.shades.white,
116
+ onPress: () => {
117
+ onShowAthletes(data.event_id, data.event_type, data.item);
250
118
  }
251
- return (
252
- <View style={{ padding:10, flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
253
- <Button
254
- title="X"
255
- style={{ marginRight:5 }}
256
- borderWidth={0}
257
- title_size={12}
258
- title_color={Colors.utility.error}
259
- onPress={() => {
260
- if(data.item.market_id_override){
261
- //return onDeleteCompetitionMatch(data.item.competition_match_id)
262
- }
263
- //return onDeleteCompetitionMatchMarkets(data.item.competition_match_markets)
264
- }}
265
- />
266
- {image_url ?
267
- <View style={{ padding:5 }}>
268
- <Image
269
- source={{ uri:image_url }}
270
- style={{ marginRight:10, height:40, width:40, borderRadius:100 }}
271
- resizeMode="center"
272
- />
273
- </View>
274
- :<></>}
275
- <View style={{ flex:1 }}>
276
- <Text size={14} weight='bold'>{header}</Text>
277
- <Text style={{ marginTop:3 }} size={12} weight='bold'>{description}</Text>
278
- </View>
279
- <CompetitionMatchMarketCard
280
- event_id={data.item.event_id}
281
- event_type={data.item.event_type}
282
- competition_match_id={data.item.competition_match_id}
283
- competition_match_markets={data.item.competition_match_markets}
284
- competition_summaries={match_summaries}
285
- market={market}
286
- onSaveMarkets={(cmms) => console.log(cmms)}
287
- onUpdateMarkets={(cmms) => console.log(cmms)}
288
- onGenerateMarkets={() => console.log('Blah')}
289
- />
290
- </View>
291
- )
292
- }
293
-
294
- const renderTeamEvents = (data: { item:string, index:number }) => {
295
- const event = events.find(e => e.event_id == data.item);
296
- if(!event){ return <></> }
297
- if(!event.supported_markets){ return <></> }
298
- const supported_markets = markets.filter(m => event.supported_markets?.map(sm => sm.market_id.toString()).includes(m.market_id.toString()));
299
- const cms = competition_matches.filter(cm => cm.event_id == data.item && cm.event_type == 'team');
300
- const cmms = competition_match_markets.filter(cmm => cms.map(cm => cm.competition_match_id.toString()).includes(cmm.competition_match_id));
301
- const unique_market_ids = [ ...new Set(cmms.map(cmm => cmm.market_id).concat(cms.filter(cm => cm.market_id_override).map(cm => cm.market_id_override))) ]
302
- const league = leagues.find(l => l.league_id == event.league_id);
303
- const visible_matches = showDetails(data.item, 'team')
304
- return (
305
- <View style={{ borderWidth:1, borderColor:Colors.shades.shade600, borderRadius:8, margin:10, zIndex: data.index * -1 }}>
306
- <View style={{ flexDirection:'row', padding:15, zIndex:1}}>
307
- {['pending','paused'].includes(competition.status) && cms.length == 1 && cmms.length == 0 ?
308
- <Button
309
- title="X"
310
- title_color={Colors.utility.error}
311
- borderRadius={8}
312
- borderWidth={1}
313
- borderColor={Colors.utility.error}
314
- onPress={() => onDeleteCompetitionMatch(cms[0]?.competition_match_id)}
315
- />
316
- :<></>}
317
- <View style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
318
- {league?.league_image ?
319
- <Image
320
- source={{ uri: league.league_image }}
321
- style={{ height:30, width:30, marginRight:10 }}
322
- resizeMode="cover"
323
- />
324
- :<></>}
325
- <View>
326
- <Text size={14} color={Colors.brand.midnight} weight='bold'>{event.away.market_name} {event.away.name} vs {event.home.market_name} {event.home.name}</Text>
327
- <Text style={{ marginTop:4 }} size={12} color={Colors.brand.midnight}>{moment(event.scheduled_datetime).format('MMMM DD hh:mm a')}</Text>
328
- </View>
329
- </View>
330
- <Button
331
- title="Add Markets"
332
- title_color={Colors.shades.white}
333
- backgroundColor={Colors.brand.midnight}
334
- onPress={() => {
335
- setShowMarkets({
336
- visible:true,
337
- event_id: data.item,
338
- event_type: 'team',
339
- selected_markets:unique_market_ids,
340
- supported_markets,
341
- })
342
- }}
343
- />
344
- <View style={{ position:'absolute', top:0, right:0, ...view_styles.section, maxWidth:300 }}>
345
- <MarketSelector
346
- visible={show_markets.event_id == data.item ? true : false}
347
- markets={show_markets.supported_markets}
348
- selected_markets={show_markets.selected_markets}
349
- onSelectMarket={(market) => handleSelectMarket(market)}
350
- onDeselectMarket={(market) => console.log(market)}
351
- onClose={() => setShowMarkets({ visible: false, supported_markets:[], selected_markets:[] })}
352
- />
353
- </View>
354
- </View>
355
- {unique_market_ids.length > 0 ?
356
- <View style={{ padding:10, backgroundColor:Colors.shades.shade100 }}>
357
- <Text style={{ marginBottom:5 }} size={16} weight='bold'>Selected Markets</Text>
358
- <View style={{ flexDirection:'row', flexWrap: 'wrap', padding:10 }}>
359
- {unique_market_ids.map((market_id, index) => {
360
- return (
361
- renderMarkets({ item: market_id, index, event_id:data.item, event_type:'team' })
362
- )
363
- })}
364
- </View>
365
- </View>
366
- :<></>}
367
- {visible_matches.length > 0 ?
368
- <FlatList
369
- data={visible_matches}
370
- renderItem={renderCompetitionMatches}
371
- keyExtractor={(item) => item.competition_match_id.toString()}
372
- />
373
- :<></>}
374
- </View>
375
- )
376
- }
377
- */
378
-
379
- return /*#__PURE__*/React.createElement(React.Fragment, null);
380
- /*
381
- return (
382
- <View style={{ ...view_styles.section, minWidth:350, flexGrow:1, maxWidth:width }}>
383
- <TouchableOpacity style={{ ...view_styles.section_header }} onPress={() => setExpanded(!expanded)}>
384
- <View style={{ flex:1, marginRight:10 }}>
385
- <Text theme='header'>Competition Contests</Text>
386
- <Text style={{ marginTop:3 }} theme='body'>Competitions require contests for users to make picks / wagers. Select 'Add Contests' to get started.</Text>
387
- </View>
388
- <Icons.ChevronIcon direction={expanded ? 'up' : 'down'} size={8} color={Colors.brand.midnight} />
389
- </TouchableOpacity>
390
- {expanded ?
391
- <View style={{ ...view_styles.section_body }}>
392
- {unique_team_events.map((id, index) => {
393
- return renderTeamEvents({ item:id, index })
394
- })}
395
- </View>
396
- :<></>}
397
- </View>
398
- )
399
- */
119
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null));
120
+ };
121
+ const showDetails = (show_event_id, show_event_type) => {
122
+ let show_cms = [];
123
+ show_match_markets.map(smm => {
124
+ let split_smm = smm.split(':');
125
+ let event_type = split_smm[0];
126
+ let event_id = split_smm[1];
127
+ let market_id = split_smm[2];
128
+ if (event_id != show_event_id) {
129
+ return;
130
+ }
131
+ if (show_event_type != event_type) {
132
+ return;
133
+ }
134
+ const market = markets.find(m => m.market_id == market_id);
135
+ if (!market) {
136
+ return;
137
+ }
138
+ if (market.level == 'event' && market.primary_market) {
139
+ const primary_cm = competition_matches.find(cm => cm.event_id == event_id && cm.event_type == event_type && !cm.market_id_override);
140
+ if (!primary_cm) {
141
+ return;
142
+ }
143
+ const primary_cmms = competition_match_markets.filter(cmm => cmm.competition_match_id == primary_cm?.competition_match_id && cmm.market_id == market_id);
144
+ show_cms.push({
145
+ ...primary_cm,
146
+ competition_match_markets: primary_cmms
147
+ });
148
+ }
149
+ if (market.level == 'athlete') {
150
+ const cms = competition_matches.filter(cm => cm.event_id == event_id && cm.event_type == event_type && cm.market_id_override == market_id);
151
+ cms.map(cm => {
152
+ let cmm = competition_match_markets.filter(cmm => cmm.competition_match_id == cm.competition_match_id);
153
+ //if(cmm.length == 2){
154
+ show_cms.push({
155
+ ...cm,
156
+ competition_match_markets: cmm
157
+ });
158
+ //}
159
+ });
160
+ }
161
+ });
162
+ return show_cms;
163
+ };
164
+ const getMatchTitle = (cm, market) => {
165
+ let error = {
166
+ header: 'Market',
167
+ description: market.description
168
+ };
169
+ switch (cm.event_type) {
170
+ case 'team':
171
+ const event = events.find(e => e.event_id == cm.event_id);
172
+ if (!event) {
173
+ return error;
174
+ }
175
+ if (!cm.market_id_override) {
176
+ //This is a primary one that we can just do the market name and event title
177
+ return {
178
+ header: event.event_title,
179
+ description: market.description
180
+ };
181
+ }
182
+ switch (cm.side_type_override) {
183
+ case 'athlete':
184
+ const athlete = athletes.find(a => a.athlete_id == cm.side_id_override);
185
+ if (!athlete) {
186
+ return error;
187
+ }
188
+ return {
189
+ image_url: athlete.image?.url,
190
+ header: `${athlete.first_name} ${athlete.last_name} ${market.stat_label}`,
191
+ description: market.description
192
+ };
193
+ default:
194
+ return error;
195
+ }
196
+ default:
197
+ return error;
198
+ }
199
+ };
200
+ const renderCompetitionMatches = data => {
201
+ if (!data.item.competition_match_markets) {
202
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
203
+ }
204
+ const market = markets.find(m => data.item.competition_match_markets && m.market_id == data.item.competition_match_markets[0]?.market_id);
205
+ if (!market) {
206
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
207
+ }
208
+ const {
209
+ image_url,
210
+ header,
211
+ description
212
+ } = getMatchTitle(data.item, market);
213
+ return /*#__PURE__*/React.createElement(View, {
214
+ style: {
215
+ padding: 10,
216
+ flexDirection: 'row',
217
+ alignItems: 'center',
218
+ borderBottomWidth: 1,
219
+ borderColor: Colors.shades.shade600
220
+ }
221
+ }, /*#__PURE__*/React.createElement(Button, {
222
+ title: "X",
223
+ style: {
224
+ marginRight: 5
225
+ },
226
+ borderWidth: 0,
227
+ title_size: 12,
228
+ title_color: Colors.utility.error,
229
+ onPress: () => {
230
+ if (data.item.market_id_override) {
231
+ return onDeleteCompetitionMatch(data.item.competition_match_id);
232
+ }
233
+ return onDeleteCompetitionMatchMarkets(data.item.competition_match_markets ?? []);
234
+ }
235
+ }), image_url ? /*#__PURE__*/React.createElement(View, {
236
+ style: {
237
+ padding: 5
238
+ }
239
+ }, /*#__PURE__*/React.createElement(Image, {
240
+ source: {
241
+ uri: image_url
242
+ },
243
+ style: {
244
+ marginRight: 10,
245
+ height: 40,
246
+ width: 40,
247
+ borderRadius: 100
248
+ },
249
+ resizeMode: "center"
250
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
251
+ style: {
252
+ flex: 1
253
+ }
254
+ }, /*#__PURE__*/React.createElement(Text, {
255
+ size: 14,
256
+ weight: "bold"
257
+ }, header), /*#__PURE__*/React.createElement(Text, {
258
+ style: {
259
+ marginTop: 3
260
+ },
261
+ size: 12,
262
+ weight: "bold"
263
+ }, description)), /*#__PURE__*/React.createElement(CompetitionMatchMarketCard, {
264
+ event_id: data.item.event_id,
265
+ event_type: data.item.event_type,
266
+ competition_match_id: data.item.competition_match_id,
267
+ competition_match_markets: data.item.competition_match_markets,
268
+ competition_summaries: [],
269
+ market: market,
270
+ onSaveMarkets: cmms => console.log(cmms),
271
+ onUpdateMarkets: cmms => console.log(cmms),
272
+ onGenerateMarkets: () => console.log('Blah')
273
+ }));
274
+ };
275
+ const renderTeamEvents = data => {
276
+ const event = events.find(e => e.event_id == data.item);
277
+ if (!event) {
278
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
279
+ }
280
+ if (!event.supported_markets) {
281
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
282
+ }
283
+ const cms = competition_matches.filter(cm => cm.event_id == data.item && cm.event_type == 'team');
284
+ const cmms = competition_match_markets.filter(cmm => cms.map(cm => cm.competition_match_id.toString()).includes(cmm.competition_match_id));
285
+ const unique_market_ids = [...new Set(cmms.map(cmm => cmm.market_id).concat(cms.filter(cm => cm.market_id_override).map(cm => cm.market_id_override ?? '0')))];
286
+ const league = leagues.find(l => l.league_id == event.league_id);
287
+ const visible_matches = showDetails(data.item, 'team');
288
+ const expanded = expanded_contests.includes(`${event.event_id}:team`) ? true : false;
289
+ return /*#__PURE__*/React.createElement(View, {
290
+ style: {
291
+ margin: 5,
292
+ backgroundColor: Colors.shades.white,
293
+ zIndex: data.index * -1,
294
+ maxWidth: width
295
+ }
296
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
297
+ style: {
298
+ flexDirection: 'row',
299
+ alignItems: 'center',
300
+ padding: 15,
301
+ zIndex: 1
302
+ },
303
+ onPress: () => {
304
+ if (expanded) {
305
+ return setExpandedContests(expanded_contests.filter(c => c != `${event.event_id}:team`));
306
+ } else {
307
+ return setExpandedContests(expanded_contests.concat(`${event.event_id}:team`));
308
+ }
309
+ }
310
+ }, ['pending', 'paused'].includes(competition.status) && cms.length == 1 && cmms.length == 0 ? /*#__PURE__*/React.createElement(Button, {
311
+ title: "X",
312
+ title_color: Colors.utility.error,
313
+ borderRadius: 8,
314
+ borderWidth: 1,
315
+ borderColor: Colors.utility.error,
316
+ onPress: () => onDeleteCompetitionMatch(cms[0]?.competition_match_id ?? '')
317
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
318
+ style: {
319
+ flex: 1,
320
+ marginLeft: 5,
321
+ flexDirection: 'row',
322
+ alignItems: 'center'
323
+ }
324
+ }, league?.league_image ? /*#__PURE__*/React.createElement(Image, {
325
+ source: {
326
+ uri: league.league_image
327
+ },
328
+ style: {
329
+ height: 30,
330
+ width: 30,
331
+ marginRight: 10
332
+ },
333
+ resizeMode: "cover"
334
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(View, {
335
+ style: {
336
+ flex: 1
337
+ }
338
+ }, /*#__PURE__*/React.createElement(Text, {
339
+ size: 14,
340
+ color: Colors.brand.midnight,
341
+ weight: "bold"
342
+ }, event.away?.market_name, " ", event.away?.name, " vs ", event.home?.market_name, " ", event.home?.name), /*#__PURE__*/React.createElement(Text, {
343
+ style: {
344
+ marginTop: 4
345
+ },
346
+ size: 12,
347
+ color: Colors.brand.midnight
348
+ }, moment(event.scheduled_datetime).format('MMMM DD hh:mm a')))), /*#__PURE__*/React.createElement(View, {
349
+ style: {
350
+ marginLeft: 5,
351
+ marginRight: 5,
352
+ height: 25,
353
+ width: 25,
354
+ justifyContent: 'center',
355
+ alignItems: 'center',
356
+ borderRadius: 100,
357
+ backgroundColor: Colors.brand.electric
358
+ }
359
+ }, /*#__PURE__*/React.createElement(Text, {
360
+ size: 10,
361
+ color: Colors.shades.white,
362
+ weight: "bold"
363
+ }, unique_market_ids.length)), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
364
+ direction: expanded ? 'up' : 'down',
365
+ size: 8,
366
+ color: Colors.brand.midnight
367
+ })), expanded ? /*#__PURE__*/React.createElement(View, {
368
+ style: {
369
+ padding: 10
370
+ }
371
+ }, /*#__PURE__*/React.createElement(View, {
372
+ style: {
373
+ flexDirection: 'row',
374
+ marginBottom: 5
375
+ }
376
+ }, /*#__PURE__*/React.createElement(Text, {
377
+ style: {
378
+ flex: 1
379
+ },
380
+ size: 16,
381
+ weight: "bold"
382
+ }, "Selected Markets"), /*#__PURE__*/React.createElement(Button, {
383
+ title: "Add Markets",
384
+ title_color: Colors.shades.white,
385
+ backgroundColor: Colors.brand.midnight,
386
+ onPress: () => {
387
+ onShowMarkets(data.item, 'team');
388
+ }
389
+ })), /*#__PURE__*/React.createElement(View, {
390
+ style: {
391
+ flexDirection: 'row',
392
+ flexWrap: 'wrap',
393
+ padding: 10
394
+ }
395
+ }, unique_market_ids.map((market_id, index) => {
396
+ return renderMarkets({
397
+ item: market_id,
398
+ index,
399
+ event_id: data.item,
400
+ event_type: 'team'
401
+ });
402
+ }))) : /*#__PURE__*/React.createElement(React.Fragment, null), visible_matches.length > 0 ? /*#__PURE__*/React.createElement(FlatList, {
403
+ data: visible_matches,
404
+ renderItem: renderCompetitionMatches,
405
+ keyExtractor: item => item.competition_match_id.toString()
406
+ }) : /*#__PURE__*/React.createElement(React.Fragment, null));
407
+ };
408
+ return /*#__PURE__*/React.createElement(View, {
409
+ style: {
410
+ ...view_styles.section,
411
+ minWidth: 350,
412
+ flexGrow: 1,
413
+ maxWidth: width
414
+ }
415
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
416
+ style: {
417
+ ...view_styles.section_header,
418
+ maxWidth: width
419
+ },
420
+ onPress: () => setExpanded(!expanded)
421
+ }, is_valid ? /*#__PURE__*/React.createElement(Icons.CheckCirlceIcon, {
422
+ size: 16,
423
+ color: Colors.utility.success
424
+ }) : /*#__PURE__*/React.createElement(Icons.AlertIcon, {
425
+ size: 16,
426
+ color: Colors.utility.warning
427
+ }), /*#__PURE__*/React.createElement(View, {
428
+ style: {
429
+ flex: 1,
430
+ marginRight: 10,
431
+ marginLeft: 10
432
+ }
433
+ }, /*#__PURE__*/React.createElement(Text, {
434
+ theme: "header"
435
+ }, "Competition Contests"), /*#__PURE__*/React.createElement(Text, {
436
+ style: {
437
+ marginTop: 3
438
+ },
439
+ theme: "body"
440
+ }, "Competitions require contests for users to make picks / wagers. Select 'Add Contests' to get started.")), /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
441
+ direction: expanded ? 'up' : 'down',
442
+ size: 8,
443
+ color: Colors.brand.midnight
444
+ })), expanded ? /*#__PURE__*/React.createElement(View, {
445
+ style: {
446
+ ...view_styles.section_body,
447
+ padding: 0,
448
+ backgroundColor: Colors.shades.shade100
449
+ }
450
+ }, /*#__PURE__*/React.createElement(View, {
451
+ style: {
452
+ ...view_styles.section_header
453
+ }
454
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
455
+ style: {
456
+ flex: 1
457
+ }
458
+ }, /*#__PURE__*/React.createElement(Text, {
459
+ theme: "header"
460
+ }, "Team Events"), /*#__PURE__*/React.createElement(Text, {
461
+ style: {
462
+ marginTop: 3
463
+ },
464
+ theme: "body"
465
+ }, "Select team based events to include in this competition")), /*#__PURE__*/React.createElement(Button, {
466
+ title: "ADD",
467
+ padding: 10,
468
+ title_color: Colors.shades.white,
469
+ backgroundColor: Colors.utility.success,
470
+ onPress: () => onShowContests()
471
+ })), /*#__PURE__*/React.createElement(View, {
472
+ style: {
473
+ padding: 10
474
+ }
475
+ }, /*#__PURE__*/React.createElement(Text, {
476
+ style: {
477
+ padding: 10
478
+ },
479
+ theme: "header_2"
480
+ }, "The following markets can be added to all events"), /*#__PURE__*/React.createElement(View, {
481
+ style: {
482
+ padding: 5
483
+ }
484
+ }, /*#__PURE__*/React.createElement(FlatList, {
485
+ data: primary_markets,
486
+ renderItem: renderPrimaryMarkets,
487
+ horizontal: true,
488
+ keyExtractor: item => item.market.market_id.toString()
489
+ }))), /*#__PURE__*/React.createElement(View, {
490
+ style: {
491
+ ...view_styles.section_body,
492
+ padding: 0
493
+ }
494
+ }, active_contest_type == 'team' ? /*#__PURE__*/React.createElement(View, null, unique_team_events.map((id, index) => {
495
+ return renderTeamEvents({
496
+ item: id,
497
+ index
498
+ });
499
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null))) : /*#__PURE__*/React.createElement(React.Fragment, null));
400
500
  };
401
501
  export default CompetitionContestsForm;
402
-
403
- /*
404
- <View style={{ position:'absolute', top:show_athletes.top, right:show_athletes.right }}>
405
- <AthleteSelector
406
- onClose={() => setShowAthletes({ visible:false, positions:[], selected_athletes: [], top:0, right:0, team_ids:[] })}
407
- onDeselectAthlete={(athlete) => console.log(athlete)}
408
- onSelectAthlete={(athlete) => handleSelectAthlete(athlete)}
409
- team_ids={show_athletes.team_ids}
410
- restricted_ids={show_athletes.restricted_ids}
411
- selected_athletes={show_athletes.selected_athletes}
412
- visible={show_athletes.visible}
413
- />
414
- </View>
415
- */
416
-
417
- /*
418
- <Button
419
- title="Add Contests"
420
- backgroundColor={Colors.brand.electric}
421
- title_color={Colors.shades.white}
422
- onPress={() => setContestsVisible(true)}
423
- />
424
- <View style={{ position:'absolute', top:0, right:0 }}>
425
- <ContestSelector
426
- visible={contests_visible}
427
- selected_events={unique_team_events}
428
- onSelectEvent={(event) => handleSelectEvent(event)}
429
- onDeselectEvent={(event) => console.log(event)}
430
- onClose={() => setContestsVisible(false)}
431
- />
432
- </View>
433
- */
434
502
  //# sourceMappingURL=CompetitionContestsForm.js.map