be-components 2.4.9 → 2.5.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.
- package/lib/commonjs/Components/Jerseys.js +14 -4
- package/lib/commonjs/Components/Jerseys.js.map +1 -1
- package/lib/commonjs/LocationTracker/LocationStatus.js +1 -0
- package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -1
- package/lib/commonjs/MarketComponents/api/index.js +40 -0
- package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/AthleteTournamentMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/MatchMarket/index.js +231 -0
- package/lib/commonjs/MarketComponents/components/MatchMarket/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.js +198 -0
- package/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/TournamentMarket/api/index.js +109 -0
- package/lib/commonjs/MarketComponents/components/TournamentMarket/api/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/TournamentMarket/index.js +382 -0
- package/lib/commonjs/MarketComponents/components/TournamentMarket/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/index.js +3 -1
- package/lib/commonjs/MarketComponents/index.js.map +1 -1
- package/lib/commonjs/MarketMaker/api/index.js +80 -9
- package/lib/commonjs/MarketMaker/api/index.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Contest.js +111 -40
- package/lib/commonjs/MarketMaker/components/Contest.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ContestMarkets.js +538 -161
- package/lib/commonjs/MarketMaker/components/ContestMarkets.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Dashboard.js +8 -2
- package/lib/commonjs/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/OrderForm.js +186 -0
- package/lib/commonjs/MarketMaker/components/OrderForm.js.map +1 -0
- package/lib/commonjs/MarketMaker/components/SetMarketForm.js +221 -77
- package/lib/commonjs/MarketMaker/components/SetMarketForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/WeightProgress.js +19 -8
- package/lib/commonjs/MarketMaker/components/WeightProgress.js.map +1 -1
- package/lib/commonjs/MarketMaker/index.js +138 -21
- package/lib/commonjs/MarketMaker/index.js.map +1 -1
- package/lib/commonjs/Socket/index.js +1 -1
- package/lib/commonjs/Socket/index.js.map +1 -1
- package/lib/module/Components/Jerseys.js +14 -4
- package/lib/module/Components/Jerseys.js.map +1 -1
- package/lib/module/LocationTracker/LocationStatus.js +1 -0
- package/lib/module/LocationTracker/LocationStatus.js.map +1 -1
- package/lib/module/MarketComponents/api/index.js +40 -0
- package/lib/module/MarketComponents/api/index.js.map +1 -1
- package/lib/module/MarketComponents/components/AthleteTournamentMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/MatchMarket/index.js +222 -0
- package/lib/module/MarketComponents/components/MatchMarket/index.js.map +1 -0
- package/lib/module/MarketComponents/components/TeamTournamentMarket/index.js +189 -0
- package/lib/module/MarketComponents/components/TeamTournamentMarket/index.js.map +1 -0
- package/lib/module/MarketComponents/components/TournamentMarket/api/index.js +103 -0
- package/lib/module/MarketComponents/components/TournamentMarket/api/index.js.map +1 -0
- package/lib/module/MarketComponents/components/TournamentMarket/index.js +373 -0
- package/lib/module/MarketComponents/components/TournamentMarket/index.js.map +1 -0
- package/lib/module/MarketComponents/index.js +3 -1
- package/lib/module/MarketComponents/index.js.map +1 -1
- package/lib/module/MarketMaker/api/index.js +80 -9
- package/lib/module/MarketMaker/api/index.js.map +1 -1
- package/lib/module/MarketMaker/components/Contest.js +110 -41
- package/lib/module/MarketMaker/components/Contest.js.map +1 -1
- package/lib/module/MarketMaker/components/ContestMarkets.js +541 -162
- package/lib/module/MarketMaker/components/ContestMarkets.js.map +1 -1
- package/lib/module/MarketMaker/components/Dashboard.js +8 -2
- package/lib/module/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/module/MarketMaker/components/OrderForm.js +177 -0
- package/lib/module/MarketMaker/components/OrderForm.js.map +1 -0
- package/lib/module/MarketMaker/components/SetMarketForm.js +221 -77
- package/lib/module/MarketMaker/components/SetMarketForm.js.map +1 -1
- package/lib/module/MarketMaker/components/WeightProgress.js +17 -8
- package/lib/module/MarketMaker/components/WeightProgress.js.map +1 -1
- package/lib/module/MarketMaker/index.js +138 -21
- package/lib/module/MarketMaker/index.js.map +1 -1
- package/lib/module/Socket/index.js +1 -1
- package/lib/module/Socket/index.js.map +1 -1
- package/lib/typescript/src/Components/Jerseys.d.ts +2 -1
- package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -1
- package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/api/index.d.ts +6 -0
- package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/AthleteTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/MatchMarket/index.d.ts +33 -0
- package/lib/typescript/src/MarketComponents/components/MatchMarket/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/TeamTournamentMarket/index.d.ts +29 -0
- package/lib/typescript/src/MarketComponents/components/TeamTournamentMarket/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/TournamentMarket/api/index.d.ts +13 -0
- package/lib/typescript/src/MarketComponents/components/TournamentMarket/api/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/TournamentMarket/index.d.ts +27 -0
- package/lib/typescript/src/MarketComponents/components/TournamentMarket/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/index.d.ts +22 -0
- package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/api/index.d.ts +18 -4
- package/lib/typescript/src/MarketMaker/api/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Contest.d.ts +5 -2
- package/lib/typescript/src/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestMarkets.d.ts +4 -1
- package/lib/typescript/src/MarketMaker/components/ContestMarkets.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts +4 -2
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts +12 -0
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts.map +1 -0
- package/lib/typescript/src/MarketMaker/components/SetMarketForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/SetMarketForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/WeightProgress.d.ts +2 -2
- package/lib/typescript/src/MarketMaker/components/WeightProgress.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/index.d.ts +3 -1
- package/lib/typescript/src/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/src/Socket/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Components/Jerseys.tsx +9 -4
- package/src/LocationTracker/LocationStatus.tsx +1 -0
- package/src/MarketComponents/api/index.ts +27 -0
- package/src/MarketComponents/components/AthleteTournamentMarket/index.tsx +0 -1
- package/src/MarketComponents/components/MatchMarket/index.tsx +149 -0
- package/src/MarketComponents/components/TeamTournamentMarket/index.tsx +121 -0
- package/src/MarketComponents/components/TournamentMarket/api/index.ts +74 -0
- package/src/MarketComponents/components/TournamentMarket/index.tsx +289 -0
- package/src/MarketComponents/index.tsx +3 -1
- package/src/MarketMaker/api/index.ts +61 -13
- package/src/MarketMaker/components/Contest.tsx +79 -29
- package/src/MarketMaker/components/ContestMarkets.tsx +400 -98
- package/src/MarketMaker/components/Dashboard.tsx +11 -5
- package/src/MarketMaker/components/OrderForm.tsx +134 -0
- package/src/MarketMaker/components/SetMarketForm.tsx +128 -77
- package/src/MarketMaker/components/WeightProgress.tsx +9 -5
- package/src/MarketMaker/index.tsx +122 -22
- package/src/Socket/index.tsx +5 -2
- package/src/types.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import type { AthleteProps, BestAvailableOrderProps, EventProps, ExternalPriceProps, FundOrderProps, FundProps, MarketProps, MatchProps, OrderProps, TeamProps, TournamentProps, TradeProps } from '../../types';
|
|
4
4
|
import { Button, Text } from '../../Components';
|
|
5
5
|
import { view_styles } from '../../constants/styles';
|
|
@@ -14,6 +14,8 @@ type ContestMarketProps = {
|
|
|
14
14
|
market:MarketProps,
|
|
15
15
|
best_available_orders:BestAvailableOrderProps[],
|
|
16
16
|
latest_trades:TradeProps[],
|
|
17
|
+
side_type?:string,
|
|
18
|
+
side_id?:string,
|
|
17
19
|
orders:OrderProps[],
|
|
18
20
|
fund_orders:FundOrderProps[],
|
|
19
21
|
var_1:number,
|
|
@@ -26,24 +28,36 @@ type ContestMarketProps = {
|
|
|
26
28
|
external_prices:ExternalPriceProps[],
|
|
27
29
|
backup_prices?:ExternalPriceProps[],
|
|
28
30
|
onSetMarket:(orders:OrderProps[], market:MarketProps, prices:ExternalPriceProps[]) => void
|
|
29
|
-
onClearMarket:(order_ids:string[]) => void
|
|
31
|
+
onClearMarket:(order_ids:string[]) => void,
|
|
32
|
+
onOrder:(order:OrderProps, available?:number) => void
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
const ContestMarket = ({ fund, event, external_prices,
|
|
33
|
-
const [ selected_var_1
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
const ContestMarket = ({ fund, event, external_prices, side_id, side_type, market, orders, best_available_orders, latest_trades, var_1, athlete, backup_prices, onSetMarket, onClearMarket, onOrder }:ContestMarketProps) => {
|
|
36
|
+
const [ selected_var_1 ] = useState(var_1);
|
|
37
|
+
/*
|
|
38
|
+
const [ review_order, setReviewOrder ] = useState<{
|
|
39
|
+
visible: boolean,
|
|
40
|
+
order?:OrderProps,
|
|
41
|
+
side: 'other' | 'trade'
|
|
42
|
+
}>({
|
|
43
|
+
visible:false,
|
|
44
|
+
side: 'trade'
|
|
45
|
+
});
|
|
46
|
+
*/
|
|
47
|
+
let work_allowed = fund.working_capital > 1 ? true : false;
|
|
48
|
+
const { var_1_orders, var_1_available, var_1_prices } = MarketMaketHelpers.filterByVar1(selected_var_1, orders, best_available_orders, external_prices, market, side_type, side_id, backup_prices);
|
|
49
|
+
const all_order_stats = MarketMaketHelpers.getOrderStats(var_1_orders);
|
|
50
|
+
const { o_side_ba_mine, trade_side_ba_mine, trade_side_orders, o_side_orders, trade_side_ba, o_side_ba } = MarketMaketHelpers.getSideMarketData(var_1_orders, var_1_available, latest_trades, market);
|
|
51
|
+
const trade_side_order_stats = MarketMaketHelpers.getOrderStats(trade_side_orders, !trade_side_ba_mine?trade_side_ba : undefined);
|
|
52
|
+
//const hedges = MarketMaketHelpers.getHedgesFromPositions(orders, [market]);
|
|
53
|
+
//const hedged_amt = (hedges.reduce((a,b) => a + b.delayed_cash_draw, 0) * -1) + hedges.reduce((a,b) => a + b.delayed_cash_no_draw, 0);
|
|
54
|
+
const o_side_order_stats = MarketMaketHelpers.getOrderStats(o_side_orders, !o_side_ba_mine?o_side_ba:undefined);
|
|
42
55
|
const stake_weight = MarketMaketHelpers.getWeight(o_side_order_stats.stake_potential_winnings, trade_side_order_stats.stake_potential_winnings, market);
|
|
43
|
-
|
|
56
|
+
// const open_weight = MarketMaketHelpers.getWeight(o_side_order_stats.open_potential_winnings, trade_side_order_stats.open_potential_winnings, market);
|
|
44
57
|
const o_price = var_1_prices.find(p => p.side != market.trade_side);
|
|
45
58
|
const trade_price = var_1_prices.find(p => p.side == market.trade_side);
|
|
46
59
|
|
|
60
|
+
|
|
47
61
|
const handleSelectBA = (ba:BestAvailableOrderProps) => {
|
|
48
62
|
const side_option = market.side_options.find(so => so.side == ba.side)
|
|
49
63
|
if(!side_option){ return alert('Unable to process') }
|
|
@@ -54,63 +68,266 @@ const ContestMarket = ({ fund, event, external_prices, unique_var_1, market, ord
|
|
|
54
68
|
//console.log(ba_trade);
|
|
55
69
|
const order = MarketMaketHelpers.getOrderFromTrade(ba_trade, 10, ba.order_id);
|
|
56
70
|
const order_title = MarketMaketHelpers.getOrderTitleForTeamEvent(order, market, event, athlete);
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
if(!order_title){ return alert('Unable to buy order') }
|
|
72
|
+
|
|
73
|
+
let working_pct = order.open_amt / fund.working_capital
|
|
74
|
+
if(working_pct > 1){ working_pct = 1 }
|
|
75
|
+
onOrder({
|
|
76
|
+
...order,
|
|
77
|
+
title: order_title,
|
|
78
|
+
expire_datetime: event.scheduled_datetime,
|
|
79
|
+
working_pct
|
|
80
|
+
}, ba.open_amt)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const handleActionSelect = (price?:ExternalPriceProps) => {
|
|
84
|
+
if(!price){ return alert('Unable to create order here') }
|
|
85
|
+
if(!event){ return alert('Not set up for events!!!') }
|
|
86
|
+
const side_option = market.side_options.find(so => so.side == price.side)
|
|
87
|
+
if(!side_option){ return alert('Unable to process') }
|
|
88
|
+
const side_id_data = MarketMaketHelpers.getTeamEventSideIds(event, market, side_option)
|
|
89
|
+
if(!side_id_data){ return alert('Unable to process') }
|
|
90
|
+
if(!o_price || !trade_price){ return alert('Unable to process') }
|
|
91
|
+
|
|
92
|
+
const trade = MarketMaketHelpers.getTradeFromPrice({ ...price, probability: price.probability - 0.05, odds: MarketMaketHelpers.calcAmericanOddsFromProbability(price.probability - 0.05) }, side_id_data.reversed_side_id);
|
|
93
|
+
const order = MarketMaketHelpers.getOrderFromTrade(trade, fund.working_capital);
|
|
94
|
+
const order_title = MarketMaketHelpers.getOrderTitleForTeamEvent(order, market, event, athlete);
|
|
95
|
+
if(!order_title){ return alert('Unable to buy order') }
|
|
96
|
+
|
|
97
|
+
let working_pct = order.open_amt / fund.working_capital
|
|
98
|
+
if(working_pct > 1){ working_pct = 1 }
|
|
99
|
+
onOrder({
|
|
100
|
+
...order,
|
|
101
|
+
title: order_title,
|
|
102
|
+
expire_datetime: event.scheduled_datetime,
|
|
103
|
+
working_pct
|
|
104
|
+
})
|
|
105
|
+
}
|
|
59
106
|
|
|
60
107
|
return (
|
|
61
|
-
<View style={{ }}>
|
|
62
|
-
<View style={{ ...view_styles.
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<Text weight={selected?'bold':'regular'} size={12} color={Colors.brand.midnight}>{var_1}</Text>
|
|
71
|
-
</TouchableOpacity>
|
|
72
|
-
)
|
|
73
|
-
})}
|
|
108
|
+
<View style={{ flex:1 }}>
|
|
109
|
+
<View style={{ ...view_styles.section_header }}>
|
|
110
|
+
<View style={{ flex:1 }}>
|
|
111
|
+
<Text theme='header_2'>{market.type == 'Stat' ? market.stat_label : market.type} {market.var_1_required?MarketMaketHelpers.getVar1Label(market, var_1):''}</Text>
|
|
112
|
+
</View>
|
|
113
|
+
{trade_price ?
|
|
114
|
+
<View>
|
|
115
|
+
<Text size={12} color={Colors.brand.midnight} weight='bold'>{MarketMaketHelpers.getOddsLabel(trade_price.odds)}</Text>
|
|
116
|
+
<Text theme='body_2'>{trade_price.external_name}</Text>
|
|
74
117
|
</View>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
118
|
+
:<></>}
|
|
119
|
+
{all_order_stats.open_amt == 0 ?
|
|
120
|
+
<Button
|
|
121
|
+
title='SET'
|
|
122
|
+
title_color={Colors.shades.white}
|
|
123
|
+
backgroundColor={Colors.brand.electric}
|
|
124
|
+
onPress={() => {
|
|
125
|
+
if(!event){ return alert('Unable to set market') }
|
|
126
|
+
const set_orders = MarketMaketHelpers.setMarkets(fund, var_1_available, var_1_prices, market, .05, event);
|
|
127
|
+
if(set_orders.length != 2){ return alert('Unable to set market at this time') }
|
|
128
|
+
return onSetMarket(set_orders, market, var_1_prices);
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
:
|
|
132
|
+
<Button
|
|
133
|
+
title='CLEAR'
|
|
134
|
+
backgroundColor={Colors.utility.error}
|
|
135
|
+
title_color={Colors.shades.white}
|
|
136
|
+
onPress={() => onClearMarket(orders.map(o => o.order_id))}
|
|
137
|
+
/>
|
|
138
|
+
}
|
|
79
139
|
</View>
|
|
80
|
-
<View style={{
|
|
140
|
+
<View style={{ flexDirection:'row', padding:0 }}>
|
|
81
141
|
<View style={{ flex:1, flexDirection:'row', justifyContent:'flex-start' }}>
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
142
|
+
<View style={{ backgroundColor:Colors.shades.shade100, padding:3, paddingLeft:10, paddingRight:10, margin:1 }}>
|
|
143
|
+
<View style={{ padding:2 }}>
|
|
144
|
+
<Text size={12} color={Colors.brand.midnight}>DEPLOYED</Text>
|
|
145
|
+
</View>
|
|
146
|
+
<View style={{ flex:1, padding:2 }}>
|
|
147
|
+
<Text size={16} color={Colors.brand.midnight} weight='bold' textAlign='center'>${o_side_order_stats.stake_potential_winnings.toFixed(2)}</Text>
|
|
148
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} textAlign='center'>{MarketMaketHelpers.getOddsLabel(o_side_order_stats.stake_odds)}</Text>
|
|
149
|
+
</View>
|
|
150
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} textAlign='center'>To Win</Text>
|
|
151
|
+
</View>
|
|
152
|
+
<View style={{ flex:1 }} />
|
|
153
|
+
<View style={{ padding:3, paddingLeft:10, paddingRight:10, margin:1 }}>
|
|
154
|
+
<View style={{ padding:2, borderBottomWidth:1, borderColor:Colors.shades.shade100 }}>
|
|
155
|
+
<Text size={12} color={Colors.brand.midnight} textAlign='center'>WORKING</Text>
|
|
156
|
+
</View>
|
|
157
|
+
<View style={{ padding:2 }}>
|
|
158
|
+
<Text size={12} color={Colors.brand.midnight} weight='bold' textAlign='center'>${o_side_order_stats.open_amt.toFixed(2)}</Text>
|
|
159
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular' textAlign='center'>{MarketMaketHelpers.getOddsLabel(o_side_order_stats.open_odds)}</Text>
|
|
160
|
+
</View>
|
|
161
|
+
{o_side_order_stats.open_amt > 0.01 ?
|
|
162
|
+
<Button
|
|
163
|
+
title='CANCEL'
|
|
164
|
+
title_color={Colors.shades.white}
|
|
165
|
+
padding={5}
|
|
166
|
+
title_size={10}
|
|
167
|
+
borderRadius={2}
|
|
168
|
+
backgroundColor={Colors.utility.error}
|
|
169
|
+
onPress={() => onClearMarket(o_side_orders.map(o => o.order_id))}
|
|
170
|
+
/>
|
|
171
|
+
:
|
|
172
|
+
<Button
|
|
173
|
+
title='WORK'
|
|
174
|
+
disabled={!work_allowed}
|
|
175
|
+
style={{ opacity: work_allowed ? 1 : 0.5 }}
|
|
176
|
+
title_color={Colors.shades.white}
|
|
177
|
+
padding={5}
|
|
178
|
+
title_size={10}
|
|
179
|
+
borderRadius={2}
|
|
180
|
+
backgroundColor={Colors.brand.electric}
|
|
181
|
+
onPress={() => handleActionSelect(o_price)}
|
|
182
|
+
/>
|
|
183
|
+
}
|
|
184
|
+
</View>
|
|
91
185
|
{o_side_ba ?
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
186
|
+
<View style={{ backgroundColor:MarketMaketHelpers.getOrderColor(o_side_ba), padding:3, paddingLeft:10, paddingRight:10, margin:1}}>
|
|
187
|
+
<View style={{ padding:2, borderBottomWidth:1, borderColor:Colors.shades.shade100 }}>
|
|
188
|
+
<Text size={12} color={Colors.brand.midnight} textAlign='center'>AVAIL</Text>
|
|
189
|
+
</View>
|
|
190
|
+
<View style={{ padding:2 }}>
|
|
191
|
+
<Text size={12} color={Colors.brand.midnight} weight='bold' textAlign='center'>${o_side_ba.open_amt.toFixed(2)}</Text>
|
|
192
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular' textAlign='center'>{MarketMaketHelpers.getOddsLabel(o_side_ba.odds)}</Text>
|
|
193
|
+
</View>
|
|
194
|
+
{!o_side_ba_mine ?
|
|
195
|
+
<Button
|
|
196
|
+
title='BUY'
|
|
197
|
+
title_color={Colors.shades.white}
|
|
198
|
+
disabled={!work_allowed}
|
|
199
|
+
style={{ opacity: work_allowed ? 1 : 0.5 }}
|
|
200
|
+
padding={5}
|
|
201
|
+
title_size={10}
|
|
202
|
+
borderRadius={2}
|
|
203
|
+
backgroundColor={Colors.utility.success}
|
|
204
|
+
onPress={() => handleSelectBA(o_side_ba)}
|
|
205
|
+
/>
|
|
206
|
+
:
|
|
207
|
+
<Button
|
|
208
|
+
title='MINE'
|
|
209
|
+
title_color={Colors.shades.white}
|
|
210
|
+
disabled
|
|
211
|
+
style={{ opacity:0.5 }}
|
|
212
|
+
padding={5}
|
|
213
|
+
title_size={10}
|
|
214
|
+
borderRadius={2}
|
|
215
|
+
backgroundColor={Colors.brand.slate}
|
|
216
|
+
onPress={() => console.log('')}
|
|
217
|
+
/>
|
|
218
|
+
}
|
|
219
|
+
</View>
|
|
97
220
|
:<></>}
|
|
98
221
|
</View>
|
|
99
|
-
<View style={{
|
|
100
|
-
|
|
222
|
+
<View style={{ borderWidth:1, borderColor:Colors.brand.midnight, height:70, alignSelf:'center', margin:5 }} />
|
|
223
|
+
<View style={{ flex:1, flexDirection:'row', justifyContent:'flex-end' }}>
|
|
224
|
+
{trade_side_ba ?
|
|
225
|
+
<View style={{ backgroundColor:MarketMaketHelpers.getOrderColor(trade_side_ba), padding:3, paddingLeft:10, paddingRight:10, margin:1}}>
|
|
226
|
+
<View style={{ padding:2, borderBottomWidth:1, borderColor:Colors.shades.shade100 }}>
|
|
227
|
+
<Text size={12} color={Colors.brand.midnight} textAlign='center'>AVAIL</Text>
|
|
228
|
+
</View>
|
|
229
|
+
<View style={{ padding:2 }}>
|
|
230
|
+
<Text size={12} color={Colors.brand.midnight} weight='bold' textAlign='center'>${trade_side_ba.open_amt.toFixed(2)}</Text>
|
|
231
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular' textAlign='center'>{MarketMaketHelpers.getOddsLabel(trade_side_ba.odds)}</Text>
|
|
232
|
+
</View>
|
|
233
|
+
{!trade_side_ba_mine ?
|
|
234
|
+
<Button
|
|
235
|
+
title='BUY'
|
|
236
|
+
title_color={Colors.shades.white}
|
|
237
|
+
disabled={!work_allowed}
|
|
238
|
+
style={{ opacity: work_allowed ? 1 : 0.5 }}
|
|
239
|
+
padding={5}
|
|
240
|
+
title_size={10}
|
|
241
|
+
borderRadius={2}
|
|
242
|
+
backgroundColor={Colors.utility.success}
|
|
243
|
+
onPress={() => handleSelectBA(trade_side_ba)}
|
|
244
|
+
/>
|
|
245
|
+
:
|
|
246
|
+
<Button
|
|
247
|
+
title='MINE'
|
|
248
|
+
title_color={Colors.shades.white}
|
|
249
|
+
disabled
|
|
250
|
+
style={{ opacity:0.5 }}
|
|
251
|
+
padding={5}
|
|
252
|
+
title_size={10}
|
|
253
|
+
borderRadius={2}
|
|
254
|
+
backgroundColor={Colors.brand.slate}
|
|
255
|
+
onPress={() => console.log('')}
|
|
256
|
+
/>
|
|
257
|
+
}
|
|
258
|
+
</View>
|
|
259
|
+
:<></>}
|
|
260
|
+
<View style={{ padding:3, paddingLeft:10, paddingRight:10, margin:1 }}>
|
|
261
|
+
<View style={{ padding:2, borderBottomWidth:1, borderColor:Colors.shades.shade100 }}>
|
|
262
|
+
<Text size={12} color={Colors.brand.midnight} textAlign='center'>WORKING</Text>
|
|
263
|
+
</View>
|
|
264
|
+
<View style={{ padding:2 }}>
|
|
265
|
+
<Text size={12} color={Colors.brand.midnight} weight='bold' textAlign='center'>${trade_side_order_stats.open_amt.toFixed(2)}</Text>
|
|
266
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular' textAlign='center'>{MarketMaketHelpers.getOddsLabel(trade_side_order_stats.open_odds)}</Text>
|
|
267
|
+
</View>
|
|
268
|
+
{trade_side_order_stats.open_amt > 0.01 ?
|
|
101
269
|
<Button
|
|
102
|
-
title='
|
|
103
|
-
|
|
270
|
+
title='CANCEL'
|
|
271
|
+
disabled={trade_side_order_stats.open_amt < 0.01 ? true : false}
|
|
272
|
+
style={{ opacity: trade_side_order_stats.open_amt < 0.01 ? 0.5: 1 }}
|
|
104
273
|
title_color={Colors.shades.white}
|
|
105
|
-
padding={
|
|
106
|
-
|
|
274
|
+
padding={5}
|
|
275
|
+
title_size={10}
|
|
276
|
+
borderRadius={2}
|
|
277
|
+
backgroundColor={Colors.utility.error}
|
|
278
|
+
onPress={() => onClearMarket(trade_side_orders.map(o => o.order_id))}
|
|
107
279
|
/>
|
|
108
280
|
:
|
|
281
|
+
<Button
|
|
282
|
+
title='WORK'
|
|
283
|
+
title_color={Colors.shades.white}
|
|
284
|
+
disabled={!work_allowed}
|
|
285
|
+
style={{ opacity: work_allowed ? 1 : 0.5 }}
|
|
286
|
+
padding={5}
|
|
287
|
+
title_size={10}
|
|
288
|
+
borderRadius={2}
|
|
289
|
+
backgroundColor={Colors.brand.electric}
|
|
290
|
+
onPress={() => handleActionSelect(trade_price)}
|
|
291
|
+
/>
|
|
292
|
+
}
|
|
293
|
+
</View>
|
|
294
|
+
<View style={{ flex:1 }} />
|
|
295
|
+
<View style={{ backgroundColor:Colors.shades.shade100, padding:3, paddingLeft:10, paddingRight:10, margin:1 }}>
|
|
296
|
+
<View style={{ padding:2 }}>
|
|
297
|
+
<Text size={12} color={Colors.brand.midnight}>DEPLOYED</Text>
|
|
298
|
+
</View>
|
|
299
|
+
<View style={{ flex:1, padding:2 }}>
|
|
300
|
+
<Text size={16} color={Colors.brand.midnight} weight='bold' textAlign='center'>${trade_side_order_stats.stake_potential_winnings.toFixed(2)}</Text>
|
|
301
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} textAlign='center'>{MarketMaketHelpers.getOddsLabel(trade_side_order_stats.stake_odds)}</Text>
|
|
302
|
+
</View>
|
|
303
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} textAlign='center'>To Win</Text>
|
|
304
|
+
</View>
|
|
305
|
+
</View>
|
|
306
|
+
</View>
|
|
307
|
+
<WeightProgress
|
|
308
|
+
min_value={0}
|
|
309
|
+
max_value={100}
|
|
310
|
+
value={stake_weight.weighted_pct}
|
|
311
|
+
bar_height={10}
|
|
312
|
+
/>
|
|
313
|
+
</View>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
)
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export default ContestMarket
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
/*
|
|
324
|
+
<View style={{}}>
|
|
325
|
+
<View style={{ height:50, borderWidth:2, borderColor:Colors.brand.midnight }} />
|
|
326
|
+
{all_order_stats.open_amt == 0 ?
|
|
109
327
|
<Button
|
|
110
328
|
title='SET'
|
|
111
|
-
backgroundColor={Colors.utility.success}
|
|
112
329
|
title_color={Colors.shades.white}
|
|
113
|
-
|
|
330
|
+
backgroundColor={Colors.brand.electric}
|
|
114
331
|
onPress={() => {
|
|
115
332
|
if(!event){ return alert('Unable to set market') }
|
|
116
333
|
const set_orders = MarketMaketHelpers.setMarkets(fund, var_1_available, var_1_prices, market, .05, event);
|
|
@@ -118,57 +335,142 @@ const ContestMarket = ({ fund, event, external_prices, unique_var_1, market, ord
|
|
|
118
335
|
return onSetMarket(set_orders, market, var_1_prices);
|
|
119
336
|
}}
|
|
120
337
|
/>
|
|
338
|
+
:
|
|
339
|
+
<Button
|
|
340
|
+
title='X'
|
|
341
|
+
backgroundColor={Colors.utility.error}
|
|
342
|
+
title_color={Colors.shades.white}
|
|
343
|
+
onPress={() => onClearMarket(orders.map(o => o.order_id))}
|
|
344
|
+
/>
|
|
121
345
|
}
|
|
122
346
|
</View>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<
|
|
137
|
-
<Text size={
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
/*
|
|
351
|
+
<View style={{ flexDirection:'row' }}>
|
|
352
|
+
<View style={{flex:1}}>
|
|
353
|
+
<View style={{ flexDirection:'row' }}>
|
|
354
|
+
<Text style={{ flex:0.5, padding:5 }} textAlign='center' size={14} color={Colors.brand.midnight}>Side</Text>
|
|
355
|
+
<Text style={{ flex:1, padding:5 }} textAlign='center' size={14}>Available</Text>
|
|
356
|
+
<Text style={{ flex:1, padding:5 }} textAlign='center' size={14}>My Action</Text>
|
|
357
|
+
<Text style={{ flex:1, padding:5, backgroundColor:Colors.shades.shade100 }} color={Colors.brand.midnight} weight='bold' textAlign='center' size={14}>Total Position</Text>
|
|
358
|
+
</View>
|
|
359
|
+
<View nativeID='o_side' style={{ flex:1, flexDirection:'row' }}>
|
|
360
|
+
<View style={{ flex:0.5, margin:2, padding:10 }}>
|
|
361
|
+
<Text size={14} color={Colors.brand.midnight} textAlign='center'>{market.side_options.find(o => o.side != market.trade_side)?.side.toUpperCase()}</Text>
|
|
362
|
+
</View>
|
|
363
|
+
<View style={{ flex:1, margin:2 }}>
|
|
364
|
+
{o_side_ba ?
|
|
365
|
+
<View style={{ flex:1, flexDirection:'row', alignItems:'center', borderRadius:8, borderWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
366
|
+
{!o_side_ba_mine ?
|
|
367
|
+
<Button
|
|
368
|
+
title='B'
|
|
369
|
+
title_color={Colors.shades.white}
|
|
370
|
+
style={{ marginLeft:2 }}
|
|
371
|
+
borderRadius={6}
|
|
372
|
+
backgroundColor={Colors.utility.success}
|
|
373
|
+
onPress={() => handleSelectBA(o_side_ba)}
|
|
374
|
+
/>
|
|
375
|
+
:<></>}
|
|
376
|
+
<Text style={{ padding:10, flex:1 }} size={14} color={Colors.brand.midnight} textAlign='center'>${o_side_ba.open_amt.toFixed(2)}</Text>
|
|
377
|
+
<Text style={{ padding:10, backgroundColor:MarketMaketHelpers.getOrderColor(o_side_ba), borderTopRightRadius:8, borderBottomRightRadius:8 }}>({MarketMaketHelpers.getOddsLabel(o_side_ba.odds)})</Text>
|
|
378
|
+
</View>
|
|
379
|
+
:<></>}
|
|
380
|
+
</View>
|
|
381
|
+
<View style={{ flex:1, margin:2 }}>
|
|
382
|
+
<View style={{ flex:1, flexDirection:'row', alignItems:'center', borderRadius:8, borderWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
383
|
+
{o_side_order_stats.open_amt > 0 ?
|
|
384
|
+
<Button
|
|
385
|
+
title='C'
|
|
386
|
+
title_color={Colors.shades.white}
|
|
387
|
+
style={{ marginLeft:2 }}
|
|
388
|
+
borderRadius={6}
|
|
389
|
+
backgroundColor={Colors.utility.error}
|
|
390
|
+
onPress={() => onClearMarket(o_side_orders.filter(o => o.status == 'approved').map(o => o.order_id))}
|
|
391
|
+
/>
|
|
392
|
+
:<></>}
|
|
393
|
+
<Text style={{ padding:10, flex:1 }} size={14} color={Colors.brand.midnight} textAlign='center'>${o_side_order_stats.open_earnings.toFixed(2)}</Text>
|
|
394
|
+
<Text style={{ padding:10, backgroundColor:Colors.shades.shade100, borderTopRightRadius:8, borderBottomRightRadius:8 }}>({MarketMaketHelpers.getOddsLabel(o_side_order_stats.open_odds)})</Text>
|
|
395
|
+
</View>
|
|
396
|
+
</View>
|
|
397
|
+
<View style={{ flex:1, padding:2, backgroundColor:Colors.shades.shade100, justifyContent:'center' }}>
|
|
398
|
+
<TouchableOpacity style={{}}>
|
|
399
|
+
<Text size={14} color={Colors.brand.midnight} textAlign='center' weight='bold'>${o_side_order_stats.stake_amt.toFixed(2)} to win ${o_side_order_stats.stake_potential_winnings.toFixed(2)}</Text>
|
|
138
400
|
</TouchableOpacity>
|
|
139
|
-
:<></>}
|
|
140
401
|
</View>
|
|
141
402
|
</View>
|
|
142
|
-
<View style={{
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
min_value={0}
|
|
146
|
-
max_value={100}
|
|
147
|
-
value={open_weight.weighted_pct}
|
|
148
|
-
/>
|
|
149
|
-
</View>
|
|
150
|
-
<View style={{ ...view_styles.body_row, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
151
|
-
<View style={{ flex:1 }}>
|
|
152
|
-
<Text size={12} color={Colors.brand.midnight} weight='bold'>${o_side_order_stats.stake_earnings.toFixed(2)}</Text>
|
|
403
|
+
<View nativeID='trade_side' style={{ flex:1, flexDirection:'row' }}>
|
|
404
|
+
<View style={{ flex:0.5, margin:2, padding:10 }}>
|
|
405
|
+
<Text size={14} color={Colors.brand.midnight} textAlign='center'>{market.trade_side.toUpperCase()}</Text>
|
|
153
406
|
</View>
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
<
|
|
407
|
+
<View style={{ flex:1, margin:2 }}>
|
|
408
|
+
{trade_side_ba ?
|
|
409
|
+
<View style={{ flex:1, flexDirection:'row', alignItems:'center', borderRadius:8, borderWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
410
|
+
{!trade_side_ba_mine ?
|
|
411
|
+
<Button
|
|
412
|
+
title='B'
|
|
413
|
+
title_color={Colors.shades.white}
|
|
414
|
+
style={{ marginLeft:2 }}
|
|
415
|
+
borderRadius={6}
|
|
416
|
+
backgroundColor={Colors.utility.success}
|
|
417
|
+
onPress={() => handleSelectBA(trade_side_ba)}
|
|
418
|
+
/>
|
|
419
|
+
:<></>}
|
|
420
|
+
<Text style={{ padding:10, flex:1 }} size={14} color={Colors.brand.midnight} textAlign='center' weight='bold'>${trade_side_ba.open_amt.toFixed(2)}</Text>
|
|
421
|
+
<Text style={{ padding:10, backgroundColor:MarketMaketHelpers.getOrderColor(trade_side_ba), borderTopRightRadius:8, borderBottomRightRadius:8 }}>({MarketMaketHelpers.getOddsLabel(trade_side_ba.odds)})</Text>
|
|
422
|
+
</View>
|
|
423
|
+
:<></>}
|
|
424
|
+
</View>
|
|
425
|
+
<View style={{ flex:1, margin:2 }}>
|
|
426
|
+
<View style={{ flex:1, flexDirection:'row', alignItems:'center', borderRadius:8, borderWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
427
|
+
{trade_side_order_stats.open_amt > 0 ?
|
|
428
|
+
<Button
|
|
429
|
+
title='C'
|
|
430
|
+
title_color={Colors.shades.white}
|
|
431
|
+
style={{ marginLeft:2 }}
|
|
432
|
+
borderRadius={6}
|
|
433
|
+
backgroundColor={Colors.utility.error}
|
|
434
|
+
onPress={() => onClearMarket(trade_side_orders.filter(o => o.status == 'approved').map(o => o.order_id))}
|
|
435
|
+
/>
|
|
436
|
+
:<></>}
|
|
437
|
+
<Text style={{ padding:10, flex:1 }} size={14} color={Colors.brand.midnight} textAlign='center'>${trade_side_order_stats.open_earnings.toFixed(2)}</Text>
|
|
438
|
+
<Text style={{ padding:10, backgroundColor:Colors.shades.shade100, borderTopRightRadius:8, borderBottomRightRadius:8 }}>({MarketMaketHelpers.getOddsLabel(trade_side_order_stats.open_odds)})</Text>
|
|
439
|
+
</View>
|
|
440
|
+
|
|
441
|
+
</View>
|
|
442
|
+
<View style={{ flex:1, padding:2, backgroundColor:Colors.shades.shade100, justifyContent:'center' }}>
|
|
443
|
+
<TouchableOpacity style={{}}>
|
|
444
|
+
<Text size={14} color={Colors.brand.midnight} textAlign='center' weight='bold'>${trade_side_order_stats.stake_amt.toFixed(2)} to win ${trade_side_order_stats.stake_potential_winnings.toFixed(2)}</Text>
|
|
445
|
+
</TouchableOpacity>
|
|
157
446
|
</View>
|
|
158
447
|
</View>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
448
|
+
|
|
449
|
+
</View>
|
|
450
|
+
</View>
|
|
451
|
+
<View style={{ ...view_styles.section_footer }}>
|
|
452
|
+
<View style={{ flex:1, flexDirection:'row' }}>
|
|
453
|
+
{o_side_order_stats.open_amt + trade_side_order_stats.open_amt > 0 ?
|
|
454
|
+
<Button
|
|
455
|
+
title='CLEAR'
|
|
456
|
+
style={{ marginRight:4 }}
|
|
457
|
+
backgroundColor={Colors.utility.error}
|
|
458
|
+
title_color={Colors.shades.white}
|
|
459
|
+
onPress={() => onClearMarket(orders.map(o => o.order_id))}
|
|
460
|
+
/>
|
|
461
|
+
:<></>}
|
|
462
|
+
<Button
|
|
463
|
+
title='Set Market'
|
|
464
|
+
title_color={Colors.shades.white}
|
|
465
|
+
backgroundColor={Colors.utility.success}
|
|
466
|
+
onPress={() => {
|
|
467
|
+
if(!event){ return alert('Unable to set market') }
|
|
468
|
+
const set_orders = MarketMaketHelpers.setMarkets(fund, var_1_available, var_1_prices, market, .05, event);
|
|
469
|
+
if(set_orders.length != 2){ return alert('Unable to set market at this time') }
|
|
470
|
+
return onSetMarket(set_orders, market, var_1_prices);
|
|
471
|
+
}}
|
|
167
472
|
/>
|
|
168
473
|
</View>
|
|
474
|
+
<Text size={14} weight='bold' color={Colors.brand.midnight}>${(Math.min(o_side_order_stats.stake_potential_winnings, trade_side_order_stats.stake_potential_winnings) - all_order_stats.stake_amt).toFixed(2)}</Text>
|
|
169
475
|
</View>
|
|
170
|
-
|
|
171
|
-
)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export default ContestMarket
|
|
476
|
+
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { View, ActivityIndicator } from 'react-native';
|
|
3
3
|
import { view_styles } from "../../constants/styles"
|
|
4
|
-
import type { BestAvailableOrderProps, EventProps, ExternalPriceProps, FundOrderProps, FundProps, LeagueProps, MarketProps, MatchProps, OrderProps, SortedContestProps, TournamentProps, TradeProps } from "../../types"
|
|
4
|
+
import type { AthleteProps, BestAvailableOrderProps, EventProps, ExternalPriceProps, FundOrderProps, FundProps, LeagueProps, MarketProps, MatchProps, OrderProps, SortedContestProps, TournamentProps, TradeProps } from "../../types"
|
|
5
5
|
import { Text } from '../../Components';
|
|
6
6
|
import Contest from './Contest';
|
|
7
7
|
import { MarketMaketHelpers } from '../api';
|
|
@@ -21,17 +21,20 @@ type DashboardProps = {
|
|
|
21
21
|
prices:ExternalPriceProps[],
|
|
22
22
|
orders:OrderProps[],
|
|
23
23
|
fund_orders:FundOrderProps[],
|
|
24
|
+
athletes:AthleteProps[],
|
|
24
25
|
external_name?:string,
|
|
25
26
|
onSetMarket:(orders:OrderProps[], market:MarketProps, prices:ExternalPriceProps[]) => void,
|
|
26
27
|
onClearMarket:(order_ids:string[]) => void,
|
|
27
28
|
onWorkCapital:(amount:number) => void,
|
|
28
29
|
onLayoffCapital: (amount: number) => void,
|
|
29
|
-
onDepositFund: (amount:number) => void
|
|
30
|
+
onDepositFund: (amount:number) => void,
|
|
31
|
+
onOrder:(order:OrderProps, available?:number) => void
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
|
|
33
|
-
const Dashboard = ({ fund, loaded, external_name, prices, leagues, events, tournaments, matches, markets, orders, fund_orders, best_available_orders, trades, onSetMarket, onClearMarket, onWorkCapital, onLayoffCapital, onDepositFund }:DashboardProps) => {
|
|
35
|
+
const Dashboard = ({ fund, loaded, external_name, athletes, prices, leagues, events, tournaments, matches, markets, orders, fund_orders, best_available_orders, trades, onOrder, onSetMarket, onClearMarket, onWorkCapital, onLayoffCapital, onDepositFund }:DashboardProps) => {
|
|
34
36
|
const [ dash_size, setDashSize ] = useState({ height:400, width:400 });
|
|
37
|
+
console.log(dash_size)
|
|
35
38
|
const contests = MarketMaketHelpers.sortContests(events, tournaments, matches, markets)
|
|
36
39
|
const renderContests = (data:{item:SortedContestProps, index:number}) => {
|
|
37
40
|
if(!fund){ return <></> }
|
|
@@ -47,15 +50,17 @@ const Dashboard = ({ fund, loaded, external_name, prices, leagues, events, tourn
|
|
|
47
50
|
const contest_prices = prices.filter(p => p.event_type == data.item.contest_type && p.event_id == data.item.id);
|
|
48
51
|
const book_prices = contest_prices.filter(p => p.external_name == external_name)
|
|
49
52
|
return (
|
|
50
|
-
<View style={{
|
|
53
|
+
<View style={{ flexGrow:1, flexShrink:1 }} key={`${data.item.contest_type}${data.item.id}`}>
|
|
51
54
|
<Contest
|
|
52
55
|
contest_id={data.item.id}
|
|
53
56
|
contest_type={data.item.contest_type}
|
|
54
57
|
time_detail={data.item.time_detail}
|
|
55
58
|
league={league}
|
|
56
59
|
event={event}
|
|
60
|
+
athletes={athletes}
|
|
57
61
|
tournament={tournament}
|
|
58
62
|
match={match}
|
|
63
|
+
init_show_detail={data.index == 0 ? true : false}
|
|
59
64
|
fund={fund}
|
|
60
65
|
contest_title={data.item.title}
|
|
61
66
|
latest_trades={contest_trades}
|
|
@@ -66,6 +71,7 @@ const Dashboard = ({ fund, loaded, external_name, prices, leagues, events, tourn
|
|
|
66
71
|
fund_orders={contest_fund_orders}
|
|
67
72
|
onSetMarket={onSetMarket}
|
|
68
73
|
onClearMarket={onClearMarket}
|
|
74
|
+
onOrder={onOrder}
|
|
69
75
|
markets={data.item.markets}
|
|
70
76
|
/>
|
|
71
77
|
</View>
|
|
@@ -92,7 +98,7 @@ const Dashboard = ({ fund, loaded, external_name, prices, leagues, events, tourn
|
|
|
92
98
|
onReleaseFunds={() => console.log('WITDHRAW!!!')}
|
|
93
99
|
/>
|
|
94
100
|
:<></>}
|
|
95
|
-
<View style={{
|
|
101
|
+
<View style={{ flexDirection:'row', flexWrap:'wrap' }}>
|
|
96
102
|
{contests.sort((a,b) => a.scheduled_datetime.unix() - b.scheduled_datetime.unix()).map((c,i) => {
|
|
97
103
|
return renderContests({ item: c, index:i })
|
|
98
104
|
})}
|