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.
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +12 -23
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +191 -100
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/commonjs/Competition/components/WagerPickForm.js +8 -2
- package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -1
- package/lib/commonjs/Competition/index.js +49 -9
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/Components/ConfirmationModal.js +11 -3
- package/lib/commonjs/Components/ConfirmationModal.js.map +1 -1
- package/lib/commonjs/Components/SearchBox.js +3 -1
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js +2 -0
- package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Contest.js +39 -41
- package/lib/commonjs/MarketMaker/components/Contest.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ContestSelector.js +48 -30
- package/lib/commonjs/MarketMaker/components/ContestSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Dashboard.js +14 -73
- package/lib/commonjs/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundOwnershipList.js +27 -30
- package/lib/commonjs/MarketMaker/components/FundOwnershipList.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundSelector.js +30 -33
- package/lib/commonjs/MarketMaker/components/FundSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundingRequestList.js +28 -41
- package/lib/commonjs/MarketMaker/components/FundingRequestList.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ManageFundForm.js +1 -1
- package/lib/commonjs/MarketMaker/components/ManageFundForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/MarketSelector.js +26 -24
- package/lib/commonjs/MarketMaker/components/MarketSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/OrderForm.js +7 -4
- package/lib/commonjs/MarketMaker/components/OrderForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/index.js +301 -227
- package/lib/commonjs/MarketMaker/index.js.map +1 -1
- package/lib/commonjs/Squares/index.js +28 -9
- package/lib/commonjs/Squares/index.js.map +1 -1
- package/lib/module/Competition/components/CompetitionLeaderboard.js +12 -23
- package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/module/Competition/components/EnterCompetitionPrompt.js +191 -100
- package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/module/Competition/components/WagerPickForm.js +8 -2
- package/lib/module/Competition/components/WagerPickForm.js.map +1 -1
- package/lib/module/Competition/index.js +49 -9
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/Components/ConfirmationModal.js +11 -3
- package/lib/module/Components/ConfirmationModal.js.map +1 -1
- package/lib/module/Components/SearchBox.js +3 -1
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/MarketComponents/components/ContestOrderStatsCard.js +2 -0
- package/lib/module/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
- package/lib/module/MarketMaker/components/Contest.js +21 -24
- package/lib/module/MarketMaker/components/Contest.js.map +1 -1
- package/lib/module/MarketMaker/components/ContestSelector.js +43 -25
- package/lib/module/MarketMaker/components/ContestSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/Dashboard.js +9 -66
- package/lib/module/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/module/MarketMaker/components/FundOwnershipList.js +19 -22
- package/lib/module/MarketMaker/components/FundOwnershipList.js.map +1 -1
- package/lib/module/MarketMaker/components/FundSelector.js +24 -27
- package/lib/module/MarketMaker/components/FundSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/FundingRequestList.js +18 -31
- package/lib/module/MarketMaker/components/FundingRequestList.js.map +1 -1
- package/lib/module/MarketMaker/components/ManageFundForm.js +1 -1
- package/lib/module/MarketMaker/components/ManageFundForm.js.map +1 -1
- package/lib/module/MarketMaker/components/MarketSelector.js +19 -17
- package/lib/module/MarketMaker/components/MarketSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/OrderForm.js +7 -4
- package/lib/module/MarketMaker/components/OrderForm.js.map +1 -1
- package/lib/module/MarketMaker/index.js +298 -223
- package/lib/module/MarketMaker/index.js.map +1 -1
- package/lib/module/Squares/index.js +28 -9
- package/lib/module/Squares/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/index.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/src/Competition/index.d.ts +2 -1
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/src/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts +1 -2
- package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/src/Squares/index.d.ts +2 -1
- package/lib/typescript/src/Squares/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/components/CompetitionLeaderboard.tsx +10 -21
- package/src/Competition/components/EnterCompetitionPrompt.tsx +98 -59
- package/src/Competition/components/WagerPickForm.tsx +4 -2
- package/src/Competition/index.tsx +33 -25
- package/src/Components/ConfirmationModal.tsx +5 -4
- package/src/Components/SearchBox.tsx +4 -2
- package/src/MarketComponents/components/ContestOrderStatsCard.tsx +3 -1
- package/src/MarketMaker/components/Contest.tsx +21 -21
- package/src/MarketMaker/components/ContestSelector.tsx +31 -22
- package/src/MarketMaker/components/Dashboard.tsx +9 -24
- package/src/MarketMaker/components/FundOwnershipList.tsx +13 -15
- package/src/MarketMaker/components/FundSelector.tsx +21 -23
- package/src/MarketMaker/components/FundingRequestList.tsx +14 -20
- package/src/MarketMaker/components/ManageFundForm.tsx +2 -2
- package/src/MarketMaker/components/MarketSelector.tsx +14 -16
- package/src/MarketMaker/components/OrderForm.tsx +6 -5
- package/src/MarketMaker/index.tsx +166 -94
- 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 {
|
|
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
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
<
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
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
|
-
|
|
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
|
-
|
|
418
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
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
|
-
|
|
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
|
-
</
|
|
529
|
+
</Modal>
|
|
458
530
|
<SocketManager
|
|
459
531
|
subscribed_events={['V1_LOAD_BEST_AVAILABLE', 'V1_UPDATE_FUND']}
|
|
460
532
|
access_token={access_token}
|
package/src/Squares/index.tsx
CHANGED
|
@@ -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
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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={{
|
|
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
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
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
|