be-components 4.2.1 → 4.2.2

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 (182) hide show
  1. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +12 -23
  2. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
  3. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +191 -100
  4. package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
  5. package/lib/commonjs/Competition/components/WagerPickForm.js +8 -2
  6. package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -1
  7. package/lib/commonjs/Competition/index.js +49 -9
  8. package/lib/commonjs/Competition/index.js.map +1 -1
  9. package/lib/commonjs/Components/ConfirmationModal.js +11 -3
  10. package/lib/commonjs/Components/ConfirmationModal.js.map +1 -1
  11. package/lib/commonjs/Components/SearchBox.js +3 -1
  12. package/lib/commonjs/Components/SearchBox.js.map +1 -1
  13. package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js +2 -0
  14. package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
  15. package/lib/commonjs/MarketMaker/components/Contest.js +39 -41
  16. package/lib/commonjs/MarketMaker/components/Contest.js.map +1 -1
  17. package/lib/commonjs/MarketMaker/components/ContestSelector.js +48 -30
  18. package/lib/commonjs/MarketMaker/components/ContestSelector.js.map +1 -1
  19. package/lib/commonjs/MarketMaker/components/Dashboard.js +14 -73
  20. package/lib/commonjs/MarketMaker/components/Dashboard.js.map +1 -1
  21. package/lib/commonjs/MarketMaker/components/FundOwnershipList.js +27 -30
  22. package/lib/commonjs/MarketMaker/components/FundOwnershipList.js.map +1 -1
  23. package/lib/commonjs/MarketMaker/components/FundSelector.js +30 -33
  24. package/lib/commonjs/MarketMaker/components/FundSelector.js.map +1 -1
  25. package/lib/commonjs/MarketMaker/components/FundingRequestList.js +28 -41
  26. package/lib/commonjs/MarketMaker/components/FundingRequestList.js.map +1 -1
  27. package/lib/commonjs/MarketMaker/components/ManageFundForm.js +1 -1
  28. package/lib/commonjs/MarketMaker/components/ManageFundForm.js.map +1 -1
  29. package/lib/commonjs/MarketMaker/components/MarketSelector.js +26 -24
  30. package/lib/commonjs/MarketMaker/components/MarketSelector.js.map +1 -1
  31. package/lib/commonjs/MarketMaker/components/OrderForm.js +7 -4
  32. package/lib/commonjs/MarketMaker/components/OrderForm.js.map +1 -1
  33. package/lib/commonjs/MarketMaker/index.js +301 -227
  34. package/lib/commonjs/MarketMaker/index.js.map +1 -1
  35. package/lib/commonjs/Squares/index.js +28 -9
  36. package/lib/commonjs/Squares/index.js.map +1 -1
  37. package/lib/module/Competition/components/CompetitionLeaderboard.js +12 -23
  38. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
  39. package/lib/module/Competition/components/EnterCompetitionPrompt.js +191 -100
  40. package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
  41. package/lib/module/Competition/components/WagerPickForm.js +8 -2
  42. package/lib/module/Competition/components/WagerPickForm.js.map +1 -1
  43. package/lib/module/Competition/index.js +49 -9
  44. package/lib/module/Competition/index.js.map +1 -1
  45. package/lib/module/Components/ConfirmationModal.js +11 -3
  46. package/lib/module/Components/ConfirmationModal.js.map +1 -1
  47. package/lib/module/Components/SearchBox.js +3 -1
  48. package/lib/module/Components/SearchBox.js.map +1 -1
  49. package/lib/module/MarketComponents/components/ContestOrderStatsCard.js +2 -0
  50. package/lib/module/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
  51. package/lib/module/MarketMaker/components/Contest.js +21 -24
  52. package/lib/module/MarketMaker/components/Contest.js.map +1 -1
  53. package/lib/module/MarketMaker/components/ContestSelector.js +43 -25
  54. package/lib/module/MarketMaker/components/ContestSelector.js.map +1 -1
  55. package/lib/module/MarketMaker/components/Dashboard.js +9 -66
  56. package/lib/module/MarketMaker/components/Dashboard.js.map +1 -1
  57. package/lib/module/MarketMaker/components/FundOwnershipList.js +19 -22
  58. package/lib/module/MarketMaker/components/FundOwnershipList.js.map +1 -1
  59. package/lib/module/MarketMaker/components/FundSelector.js +24 -27
  60. package/lib/module/MarketMaker/components/FundSelector.js.map +1 -1
  61. package/lib/module/MarketMaker/components/FundingRequestList.js +18 -31
  62. package/lib/module/MarketMaker/components/FundingRequestList.js.map +1 -1
  63. package/lib/module/MarketMaker/components/ManageFundForm.js +1 -1
  64. package/lib/module/MarketMaker/components/ManageFundForm.js.map +1 -1
  65. package/lib/module/MarketMaker/components/MarketSelector.js +19 -17
  66. package/lib/module/MarketMaker/components/MarketSelector.js.map +1 -1
  67. package/lib/module/MarketMaker/components/OrderForm.js +7 -4
  68. package/lib/module/MarketMaker/components/OrderForm.js.map +1 -1
  69. package/lib/module/MarketMaker/index.js +298 -223
  70. package/lib/module/MarketMaker/index.js.map +1 -1
  71. package/lib/module/Squares/index.js +28 -9
  72. package/lib/module/Squares/index.js.map +1 -1
  73. package/lib/typescript/lib/commonjs/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  74. package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
  75. package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
  76. package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts +3 -1
  77. package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts.map +1 -1
  78. package/lib/typescript/lib/commonjs/Competition/index.d.ts +2 -1
  79. package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
  80. package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts +2 -1
  81. package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts.map +1 -1
  82. package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts +2 -1
  83. package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
  84. package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
  85. package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
  86. package/lib/typescript/lib/commonjs/MarketMaker/components/Contest.d.ts.map +1 -1
  87. package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts +1 -2
  88. package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts.map +1 -1
  89. package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts +1 -2
  90. package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts.map +1 -1
  91. package/lib/typescript/lib/commonjs/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
  92. package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts +1 -2
  93. package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts.map +1 -1
  94. package/lib/typescript/lib/commonjs/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
  95. package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts +1 -2
  96. package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts.map +1 -1
  97. package/lib/typescript/lib/commonjs/MarketMaker/components/OrderForm.d.ts.map +1 -1
  98. package/lib/typescript/lib/commonjs/MarketMaker/index.d.ts.map +1 -1
  99. package/lib/typescript/lib/commonjs/Squares/index.d.ts +2 -1
  100. package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
  101. package/lib/typescript/lib/module/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  102. package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
  103. package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
  104. package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts +3 -1
  105. package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts.map +1 -1
  106. package/lib/typescript/lib/module/Competition/index.d.ts +2 -1
  107. package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
  108. package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts +2 -1
  109. package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts.map +1 -1
  110. package/lib/typescript/lib/module/Components/SearchBox.d.ts +2 -1
  111. package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
  112. package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
  113. package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
  114. package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts +1 -2
  115. package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts.map +1 -1
  116. package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts +2 -4
  117. package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts.map +1 -1
  118. package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts +2 -4
  119. package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts.map +1 -1
  120. package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts +1 -2
  121. package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
  122. package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts +2 -4
  123. package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts.map +1 -1
  124. package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts +1 -2
  125. package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
  126. package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts +2 -4
  127. package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts.map +1 -1
  128. package/lib/typescript/lib/module/MarketMaker/components/OrderForm.d.ts.map +1 -1
  129. package/lib/typescript/lib/module/MarketMaker/index.d.ts +1 -2
  130. package/lib/typescript/lib/module/MarketMaker/index.d.ts.map +1 -1
  131. package/lib/typescript/lib/module/Squares/index.d.ts +2 -1
  132. package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
  133. package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
  134. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
  135. package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
  136. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +3 -1
  137. package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -1
  138. package/lib/typescript/src/Competition/index.d.ts +2 -1
  139. package/lib/typescript/src/Competition/index.d.ts.map +1 -1
  140. package/lib/typescript/src/Components/ConfirmationModal.d.ts +2 -1
  141. package/lib/typescript/src/Components/ConfirmationModal.d.ts.map +1 -1
  142. package/lib/typescript/src/Components/SearchBox.d.ts +2 -1
  143. package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
  144. package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
  145. package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
  146. package/lib/typescript/src/MarketMaker/components/Contest.d.ts.map +1 -1
  147. package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts +1 -1
  148. package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts.map +1 -1
  149. package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts +1 -1
  150. package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts.map +1 -1
  151. package/lib/typescript/src/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
  152. package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts +1 -2
  153. package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts.map +1 -1
  154. package/lib/typescript/src/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
  155. package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts +1 -1
  156. package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts.map +1 -1
  157. package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts +1 -2
  158. package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts.map +1 -1
  159. package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts +1 -1
  160. package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts.map +1 -1
  161. package/lib/typescript/src/MarketMaker/index.d.ts.map +1 -1
  162. package/lib/typescript/src/Squares/index.d.ts +2 -1
  163. package/lib/typescript/src/Squares/index.d.ts.map +1 -1
  164. package/package.json +1 -1
  165. package/src/Competition/components/CompetitionLeaderboard.tsx +10 -21
  166. package/src/Competition/components/EnterCompetitionPrompt.tsx +98 -59
  167. package/src/Competition/components/WagerPickForm.tsx +4 -2
  168. package/src/Competition/index.tsx +33 -25
  169. package/src/Components/ConfirmationModal.tsx +5 -4
  170. package/src/Components/SearchBox.tsx +4 -2
  171. package/src/MarketComponents/components/ContestOrderStatsCard.tsx +3 -1
  172. package/src/MarketMaker/components/Contest.tsx +21 -21
  173. package/src/MarketMaker/components/ContestSelector.tsx +31 -22
  174. package/src/MarketMaker/components/Dashboard.tsx +9 -24
  175. package/src/MarketMaker/components/FundOwnershipList.tsx +13 -15
  176. package/src/MarketMaker/components/FundSelector.tsx +21 -23
  177. package/src/MarketMaker/components/FundingRequestList.tsx +14 -20
  178. package/src/MarketMaker/components/ManageFundForm.tsx +2 -2
  179. package/src/MarketMaker/components/MarketSelector.tsx +14 -16
  180. package/src/MarketMaker/components/OrderForm.tsx +6 -5
  181. package/src/MarketMaker/index.tsx +166 -94
  182. package/src/Squares/index.tsx +29 -19
@@ -1,9 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View } from 'react-native';
3
2
  import { MarketMakerApi, MarketMaketHelpers } from './api';
4
3
  import type { AthleteProps, BestAvailableResponseProps, EventProps, ExternalPriceProps, FundingRequestProps, FundOrderProps, FundOwnershipProps, FundProps, LeagueProps, MarketProps, MatchProps, OrderProps, PublicPlayerProps, TournamentProps, TradeProps } from '../types';
5
- //import { view_styles } from '../constants/styles';
6
- import Colors from '../constants/colors';
7
4
  import ContestSelector from './components/ContestSelector';
8
5
  import Dashboard from './components/Dashboard';
9
6
  import MarketSelector from './components/MarketSelector';
@@ -15,6 +12,8 @@ import FundingRequestList from './components/FundingRequestList';
15
12
  import FundOwnershipList from './components/FundOwnershipList';
16
13
  import SocketManager from '../Socket';
17
14
  import OrderForm from './components/OrderForm';
15
+ import { Text, View } from '../Components/Themed';
16
+ import { FlatList, Modal } from 'react-native';
18
17
 
19
18
  type MarketMakerProps = {
20
19
  player_id:string,
@@ -22,6 +21,9 @@ type MarketMakerProps = {
22
21
  distinct_id:string
23
22
  }
24
23
 
24
+ const contest_sections = ['header', 'toggle', 'funds', 'fund_owners', 'fund_requests', 'contests', 'markets']
25
+ const dashboard_sections = ['dashboard']
26
+
25
27
  const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps) => {
26
28
  const [ ba_socket_data, setBASocketData ] = useState<BestAvailableResponseProps | undefined>(undefined);
27
29
  const [ socket_fund, setSocketFund ] = useState<{ fund:FundProps, orders:OrderProps[] } | undefined>(undefined);
@@ -44,7 +46,7 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
44
46
  tournaments:[],
45
47
  matches:[]
46
48
  });
47
- const { loaded, leagues, events, markets, funds } = module_data;
49
+ const { leagues, events, markets, funds } = module_data;
48
50
 
49
51
  const [ editing_fund, setEditingFund ] = useState<FundProps | undefined>(undefined);
50
52
  const [ draft_order, setDraftOrder ] = useState<{
@@ -119,11 +121,6 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
119
121
  getLocation()
120
122
  },[player_id]);
121
123
 
122
- useEffect(() => {
123
- if(!fund?.fund_id || !loaded){ return }
124
- getDashData(fund.fund_id);
125
- },[fund]);
126
-
127
124
  useEffect(() => {
128
125
  if(!ba_socket_data){ return }
129
126
  //Reconcile and update ba_socket data!
@@ -163,6 +160,7 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
163
160
  }
164
161
 
165
162
  const getDashData = async(fund_id:string) => {
163
+ setDashData({ ...dash_data, loading:true })
166
164
  //Now load Dash data
167
165
  console.log('1')
168
166
  const ba = await MarketMakerApi.getBestAvailableOrders();
@@ -194,6 +192,7 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
194
192
  ...dash_data,
195
193
  loaded:true,
196
194
  loading:false,
195
+ fund: fund_response.fund,
197
196
  funding_requests:fr_requests,
198
197
  players:plays,
199
198
  fund_ownerships: fund_response.fund_ownerships,
@@ -207,6 +206,10 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
207
206
  }
208
207
 
209
208
 
209
+ const handleSelectFund = async(fund:FundProps) => {
210
+ await getDashData(fund.fund_id);
211
+ }
212
+
210
213
  const getDataForMyAction = async(orders:OrderProps[], markets:MarketProps[]) => {
211
214
  const ev_ids = orders.filter(o => o.event_type == 'team').map(o => o.event_id);
212
215
  const mks = markets.filter(m => orders.map(o => o.market_id.toString()).includes(m.market_id.toString()))
@@ -243,39 +246,81 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
243
246
  })
244
247
  }
245
248
 
249
+ const renderSections = (data:{ item:string, index:number }) => {
250
+ switch(data.item){
251
+ case 'header':
252
+ return (
253
+ <View>
254
+ <Text>Fund Manager!</Text>
255
+ </View>
256
+ )
257
+ case 'funds':
258
+ return (
259
+ <View style={{ margin:5 }}>
260
+ <FundSelector
261
+ funds={funds}
262
+ selected_fund_id={dash_data.fund?.fund_id}
263
+ onEditFund={(f) => {
264
+ setEditingFund(f)
265
+ }}
266
+ onCreateFund={(f) => {
267
+ setDashData({
268
+ ...dash_data,
269
+ fund:f
270
+ })
271
+ setEditingFund(f);
272
+ }}
273
+ onSelectFund={(f) => handleSelectFund(f)}
274
+ />
275
+ </View>
276
+
277
+ )
278
+ case 'contests':
279
+ return (
280
+ <View style={{ margin:5 }}>
281
+ <ContestSelector
282
+ maxHeight={300}
283
+ leagues={leagues.filter(l => l.status == 'active')}
284
+ events={events}
285
+ onSelectEvent={(e) => handleSelectEvent(e)}
286
+ onDeselectEvent={(e) => handleDeselectEvent(e)}
287
+ onSelectMatch={(m) => console.log(m)}
288
+ onSelectTournament={(t) => console.log(t)}
289
+ tournaments={[]}
290
+ matches={[]}
291
+ selected_events={selected_events.map(e => e.event_id)}
292
+ selected_matches={[]}
293
+ selected_tournaments={[]}
294
+ />
295
+ </View>
296
+ )
297
+ case 'markets':
298
+ return (
299
+ <View style={{ margin:5 }}>
300
+ <MarketSelector
301
+ markets={selectable_markets.sort((a,b) => parseInt(a.market_id) - parseInt(b.market_id))}
302
+ onSelectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.concat(m) })}
303
+ onDeselectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.filter(se => se.market_id != m.market_id) })}
304
+ selected_markets={selected_markets.map(m => m.market_id)}
305
+ />
306
+ </View>
307
+
308
+ )
309
+ case 'fund_owners':
310
+ if(!fund){ return <></> }
311
+ return (
312
+ <View style={{ margin:5 }}>
313
+ <FundOwnershipList
314
+ fund_ownerships={fund_ownerships}
315
+ players={players}
316
+ />
317
+ </View>
246
318
 
247
- return (
248
- <View style={{ flex:1, backgroundColor:Colors.shades.white }}>
249
- <View style={{ flexDirection:'row' }}>
250
- <View>
251
- <FundSelector
252
- funds={funds}
253
- maxHeight={300}
254
- selected_fund_id={dash_data.fund?.fund_id}
255
- onEditFund={(f) => {
256
- setEditingFund(f)
257
- }}
258
- onCreateFund={(f) => {
259
- setDashData({
260
- ...dash_data,
261
- fund:f
262
- })
263
- setEditingFund(f);
264
- }}
265
- onSelectFund={(f) => {
266
- setDashData({
267
- ...dash_data,
268
- fund:f
269
- })
270
- }}
271
- />
272
- {fund ?
273
- <FundOwnershipList
274
- fund_ownerships={fund_ownerships}
275
- players={players}
276
- />
277
- :<></>}
278
- {fund?
319
+ )
320
+ case 'fund_requests':
321
+ if(!fund){ return <></> }
322
+ return (
323
+ <View style={{ margin:5 }}>
279
324
  <FundingRequestList
280
325
  funding_requests={funding_requests}
281
326
  players={players}
@@ -298,30 +343,11 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
298
343
  })
299
344
  }}
300
345
  />
301
- :<></>}
302
- <ContestSelector
303
- maxHeight={300}
304
- leagues={leagues.filter(l => l.status == 'active')}
305
- events={events}
306
- onSelectEvent={(e) => handleSelectEvent(e)}
307
- onDeselectEvent={(e) => handleDeselectEvent(e)}
308
- onSelectMatch={(m) => console.log(m)}
309
- onSelectTournament={(t) => console.log(t)}
310
- tournaments={[]}
311
- matches={[]}
312
- selected_events={selected_events.map(e => e.event_id)}
313
- selected_matches={[]}
314
- selected_tournaments={[]}
315
- />
316
- <MarketSelector
317
- maxHeight={300}
318
- markets={selectable_markets.sort((a,b) => parseInt(a.market_id) - parseInt(b.market_id))}
319
- onSelectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.concat(m) })}
320
- onDeselectMarket={(m) => setDashData({ ...dash_data, selected_markets: dash_data.selected_markets.filter(se => se.market_id != m.market_id) })}
321
- selected_markets={selected_markets.map(m => m.market_id)}
322
- />
323
- </View>
324
- <View style={{ flexGrow:1, flexShrink:1}}>
346
+ </View>
347
+ )
348
+ case 'dashboard':
349
+ return (
350
+ <View style={{ margin:5 }}>
325
351
  <Dashboard
326
352
  loaded={dash_data.loaded}
327
353
  leagues={leagues}
@@ -392,30 +418,62 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
392
418
  })
393
419
  }}
394
420
  />
395
- {fund && draft_order.order && draft_order.visible ?
396
- <View style={{ position:'absolute', bottom:0, left:0, right:0, top:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
397
- <OrderForm
398
- fund={fund}
399
- order={draft_order.order}
400
- available={draft_order.available}
401
- onClose={() => setDraftOrder({ visible:false })}
402
- onSubmit={async(order) => {
403
- if(!fund){ return alert('Unable to process') }
404
- if(!location.region || !location.coordinates){ return alert('Location could not be verified to process orders') }
405
- const new_orders = await MarketMakerApi.addOrdersToFund(fund.fund_id, [{ ...order, location: location.coordinates, region: location.region }]);
421
+ </View>
422
+ )
423
+ default: return <></>
424
+ }
425
+ }
426
+
427
+ return (
428
+ <View style={{ flex:1 }}>
429
+ <View style={{ flexDirection:'row' }}>
430
+ <View style={{ flex:1 }}>
431
+ <FlatList
432
+ data={contest_sections}
433
+ key={'contest_sections'}
434
+ keyExtractor={item => item}
435
+ renderItem={renderSections}
436
+ />
437
+ </View>
438
+ <View style={{ flex:3 }}>
439
+ <FlatList
440
+ data={dashboard_sections}
441
+ key={'dashboard_sections'}
442
+ keyExtractor={item => item}
443
+ renderItem={renderSections}
444
+ />
445
+ </View>
446
+ </View>
447
+ <Modal
448
+ visible={editing_fund ? true : false}
449
+ transparent
450
+ style={{ flex:1 }}
451
+ >
452
+ <View type='blur' style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
453
+ <View style={{ width:500 }}>
454
+ <ManageFundForm
455
+ fund={editing_fund}
456
+ onClose={() => setEditingFund(undefined)}
457
+ onFundUpdate={(f) => {
458
+ setEditingFund(undefined);
406
459
  setDashData({
407
460
  ...dash_data,
408
- fund_orders: fund_orders.concat(new_orders.fund_orders),
409
- orders:orders.concat(new_orders.orders)
461
+ fund: f
410
462
  })
411
- setDraftOrder({ visible:false });
412
463
  }}
413
-
414
464
  />
415
465
  </View>
416
- :<></>}
417
- {fund && set_market_form_visible && set_market_market ?
418
- <View style={{ position:'absolute', bottom:0, left:0, right:0, top:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
466
+ </View>
467
+ </Modal>
468
+
469
+ <Modal
470
+ visible={fund && set_market_form_visible && set_market_market ? true : false}
471
+ style={{ flex:1 }}
472
+ transparent
473
+ >
474
+ <View type='blur' style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
475
+ <View style={{ width:500 }}>
476
+ {fund && set_market_market ?
419
477
  <SetMarketForm
420
478
  fund={fund}
421
479
  form_key={set_market_form_key}
@@ -436,25 +494,39 @@ const MarketMaker = ({ player_id, access_token, distinct_id }:MarketMakerProps)
436
494
  }}
437
495
  onClose={() => setMarketFormData({ set_market_form_visible: false, set_market_orders:[], set_market_form_key:'', set_market_prices:[] })}
438
496
  />
497
+ :<></>}
439
498
  </View>
440
- :<></>}
441
- {editing_fund ?
442
- <View style={{ position:'absolute', bottom:0, left:0, right:0, top:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
443
- <ManageFundForm
444
- fund={editing_fund}
445
- onClose={() => setEditingFund(undefined)}
446
- onFundUpdate={(f) => {
447
- setEditingFund(undefined);
499
+ </View>
500
+ </Modal>
501
+ <Modal
502
+ visible={draft_order.order ? true : false}
503
+ style={{ flex:1 }}
504
+ transparent
505
+ >
506
+ <View type='blur' style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
507
+ <View style={{ width:500 }}>
508
+ {fund ?
509
+ <OrderForm
510
+ fund={fund}
511
+ order={draft_order.order}
512
+ available={draft_order.available}
513
+ onClose={() => setDraftOrder({ visible:false })}
514
+ onSubmit={async(order) => {
515
+ if(!fund){ return alert('Unable to process') }
516
+ if(!location.region || !location.coordinates){ return alert('Location could not be verified to process orders') }
517
+ const new_orders = await MarketMakerApi.addOrdersToFund(fund.fund_id, [{ ...order, location: location.coordinates, region: location.region }]);
448
518
  setDashData({
449
519
  ...dash_data,
450
- fund: f
520
+ fund_orders: fund_orders.concat(new_orders.fund_orders),
521
+ orders:orders.concat(new_orders.orders)
451
522
  })
523
+ setDraftOrder({ visible:false });
452
524
  }}
453
525
  />
526
+ :<></>}
454
527
  </View>
455
- :<></>}
456
528
  </View>
457
- </View>
529
+ </Modal>
458
530
  <SocketManager
459
531
  subscribed_events={['V1_LOAD_BEST_AVAILABLE', 'V1_UPDATE_FUND']}
460
532
  access_token={access_token}
@@ -23,6 +23,7 @@ import { useColors } from "../constants/useColors";
23
23
  type SquaresModuleProps = {
24
24
  player_id?:string,
25
25
  distinct_id:string,
26
+ view_mode:'desktop'|'mobile',
26
27
  sq_comp_id:string,
27
28
  insets?: { top:number, bottom:number },
28
29
  onRequestAuthenticate: (auth_strategy_id?:string) => void,
@@ -33,7 +34,7 @@ type SquaresModuleProps = {
33
34
 
34
35
  const squares_sections = ['header', 'toggle', 'event', 'board', 'board_stats', 'my_stats', 'results', 'my_squares', 'winners','hidden_prizes','details', 'owners']
35
36
 
36
- const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAuthenticate, onShareCompetition, onPlayerSelect }:SquaresModuleProps) => {
37
+ const SquaresModule = ({ sq_comp_id, view_mode, insets, player_id, distinct_id, onRequestAuthenticate, onShareCompetition, onPlayerSelect }:SquaresModuleProps) => {
37
38
  const C = useColors();
38
39
  const [ active_tab, setActiveTab ] = useState('board');
39
40
  const [ needs_reload, setNeedsReload ] = useState(false);
@@ -354,7 +355,7 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
354
355
  )
355
356
  case 'toggle':
356
357
  return (
357
- <View style={{ padding:8 }}>
358
+ <View style={{ padding:8, width:view_mode == 'desktop'?800: undefined, alignSelf:view_mode == 'desktop'?'center':undefined }}>
358
359
  <Toggle
359
360
  options={toggle_options}
360
361
  active_toggle_color={C.text.action}
@@ -377,13 +378,14 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
377
378
  case 'board_stats':
378
379
  if(!squares_competition){ return <></> }
379
380
  return (
380
- <BoardStats
381
- hidden={active_tab == 'stats' ? false : true}
382
- disable_collapse
383
- squares_competition={squares_competition}
384
- squares={squares}
385
- player_squares={player_squares}
386
- />
381
+ <BoardStats
382
+ hidden={active_tab == 'stats' ? false : true}
383
+ disable_collapse
384
+ squares_competition={squares_competition}
385
+ squares={squares}
386
+ player_squares={player_squares}
387
+ />
388
+
387
389
  )
388
390
  case 'my_stats':
389
391
  if(!squares_competition){ return <></> }
@@ -421,6 +423,8 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
421
423
  )
422
424
  case 'hidden_prizes':
423
425
  return (
426
+ <View style={{ padding:10 }}>
427
+
424
428
  <PrizeCard
425
429
  square_prizes={square_prizes}
426
430
  squares={squares}
@@ -429,6 +433,7 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
429
433
  players={players}
430
434
  event={event}
431
435
  />
436
+ </View>
432
437
  )
433
438
  case 'details':
434
439
  if(!squares_competition){ return <></> }
@@ -440,6 +445,7 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
440
445
  squares_payout_type={squares_payout_type}
441
446
  squares_type={squares_type}
442
447
  />
448
+
443
449
  )
444
450
  case 'owners':
445
451
  return (
@@ -453,7 +459,7 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
453
459
  case 'board':
454
460
  if(!squares_competition){ return <></> }
455
461
  return (
456
- <View style={{ paddingBottom:20 }}>
462
+ <View style={{ alignItems:view_mode == 'desktop' ? 'center': undefined }}>
457
463
  <SquaresBoard
458
464
  player_id={player_id}
459
465
  hidden={active_tab == 'board' ? false : true}
@@ -476,6 +482,8 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
476
482
  case 'my_squares':
477
483
  if(my_squares.length == 0){ return <></> }
478
484
  return (
485
+ <View style={{ padding:10 }}>
486
+
479
487
  <MySquaresCard
480
488
  player_squares={my_squares}
481
489
  hidden={active_tab == 'my_squares' ? false : true}
@@ -488,6 +496,7 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
488
496
  comp_status={comp_status}
489
497
  onSquareOffer={handleSquareOffer}
490
498
  />
499
+ </View>
491
500
  )
492
501
  default: return <></>
493
502
  }
@@ -507,13 +516,12 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
507
516
  const { width, height } = ev.nativeEvent.layout
508
517
  setModuleSize({ width, height })
509
518
  }}>
510
- <FlatList
511
- key='squares_section'
512
- data={squares_sections}
513
- renderItem={renderSections}
514
- keyExtractor={(item) => item}
515
- />
516
-
519
+ <FlatList
520
+ key='squares_section'
521
+ data={squares_sections}
522
+ renderItem={renderSections}
523
+ keyExtractor={(item) => item}
524
+ />
517
525
  {square_offers.length > 0 ?
518
526
  <SquareOffersCard
519
527
  player_squares={player_squares}
@@ -552,9 +560,10 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
552
560
  <Modal
553
561
  transparent
554
562
  visible={bid_form_expanded}
555
- animationType='slide'
563
+ animationType={view_mode=='desktop' ? 'fade' : 'slide'}
556
564
  >
557
- <View type='blur' style={{ flex:1, justifyContent:'flex-end', paddingBottom:insets?.bottom }}>
565
+ <View type='blur' style={view_mode=='desktop'?{ flex:1, justifyContent:'center', alignItems:'center' }:{ flex:1, justifyContent:'flex-end', paddingBottom:insets?.bottom }}>
566
+ <View style={view_mode=='desktop'?{ width:500 }:undefined}>
558
567
  <BidForm
559
568
  player_id={player_id}
560
569
  player_balance={player_balance}
@@ -576,6 +585,7 @@ const SquaresModule = ({ sq_comp_id, insets, player_id, distinct_id, onRequestAu
576
585
  onSubmitBid={(promo_balance) => handleSubmitBid(promo_balance)}
577
586
  />
578
587
  </View>
588
+ </View>
579
589
  </Modal>
580
590
  <Modal
581
591
  transparent