be-components 3.3.3 → 3.3.5
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/MarketComponents/components/AthleteMarket/index.js +19 -8
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/AthleteTournamentMarket/index.js +19 -8
- package/lib/commonjs/MarketComponents/components/AthleteTournamentMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/EventMarket/index.js +20 -8
- package/lib/commonjs/MarketComponents/components/EventMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/MatchMarket/index.js +17 -6
- package/lib/commonjs/MarketComponents/components/MatchMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +36 -11
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.js +17 -7
- package/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/AthleteMarket/index.js +20 -9
- package/lib/module/MarketComponents/components/AthleteMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/AthleteTournamentMarket/index.js +20 -9
- package/lib/module/MarketComponents/components/AthleteTournamentMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/EventMarket/index.js +21 -9
- package/lib/module/MarketComponents/components/EventMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/MatchMarket/index.js +18 -7
- package/lib/module/MarketComponents/components/MatchMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js +37 -12
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TeamTournamentMarket/index.js +18 -8
- package/lib/module/MarketComponents/components/TeamTournamentMarket/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/AthleteTournamentMarket/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/AthleteTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/EventMarket/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/EventMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/MatchMarket/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/MatchMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/AthleteMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/AthleteMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/AthleteTournamentMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/AthleteTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/EventMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/EventMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/MatchMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/MatchMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/TeamEventMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/TeamTournamentMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/TeamTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/AthleteMarket/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/AthleteMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/AthleteTournamentMarket/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/AthleteTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/EventMarket/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/EventMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/MatchMarket/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/MatchMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/TeamTournamentMarket/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/TeamTournamentMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/index.d.ts +12 -6
- package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MarketComponents/components/AthleteMarket/index.tsx +13 -5
- package/src/MarketComponents/components/AthleteTournamentMarket/index.tsx +14 -4
- package/src/MarketComponents/components/EventMarket/index.tsx +14 -4
- package/src/MarketComponents/components/MatchMarket/index.tsx +14 -3
- package/src/MarketComponents/components/TeamEventMarket/index.tsx +33 -10
- package/src/MarketComponents/components/TeamTournamentMarket/index.tsx +13 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
|
-
import { View, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import type { AthleteProps, BestAvailableOrderProps, EventOrderStatProps, MarketProps, MarketSideOptionProps, OrderProps, TournamentProps, TradeProps } from "../../../types"
|
|
4
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
5
|
import MarketButton from '../../components/MarketButton';
|
|
@@ -17,6 +17,7 @@ type AthleteTournamentMarketProps = {
|
|
|
17
17
|
width?:number,
|
|
18
18
|
market:MarketProps,
|
|
19
19
|
hide_image?:boolean,
|
|
20
|
+
style?:any,
|
|
20
21
|
show_event?:boolean,
|
|
21
22
|
direction?:'horizontal'|'vertical',
|
|
22
23
|
hide_liquidity?:boolean,
|
|
@@ -30,7 +31,12 @@ type AthleteTournamentMarketProps = {
|
|
|
30
31
|
onTradeLongPress:(trade:TradeProps) => void
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
const AthleteTournamentMarket = ({ tournament, hide_image, direction, show_event, hide_liquidity, hide_stat_banner, width, athlete, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress }:AthleteTournamentMarketProps) => {
|
|
34
|
+
const AthleteTournamentMarket = ({ tournament, style, hide_image, direction, show_event, hide_liquidity, hide_stat_banner, width, athlete, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress }:AthleteTournamentMarketProps) => {
|
|
35
|
+
let set_style = { ...styles.container_style, width }
|
|
36
|
+
if(style){
|
|
37
|
+
set_style = style
|
|
38
|
+
}
|
|
39
|
+
|
|
34
40
|
const { liquidity, open_order_count } = MarketComponentHelpers.getLiqudity(event_order_stats);
|
|
35
41
|
const is_locked = useMemo(() => MarketComponentHelpers.isTournamentMarketLocked(tournament, market.market_id),[JSON.stringify(tournament.supported_markets)])
|
|
36
42
|
|
|
@@ -63,7 +69,7 @@ const AthleteTournamentMarket = ({ tournament, hide_image, direction, show_event
|
|
|
63
69
|
},[JSON.stringify(best_available_orders)])
|
|
64
70
|
|
|
65
71
|
return (
|
|
66
|
-
<View style={
|
|
72
|
+
<View style={set_style}>
|
|
67
73
|
{!hide_stat_banner ?
|
|
68
74
|
<LinearDiagnal
|
|
69
75
|
label={market.stat_label ?? market.type}
|
|
@@ -78,7 +84,7 @@ const AthleteTournamentMarket = ({ tournament, hide_image, direction, show_event
|
|
|
78
84
|
<Text size={12} color={Colors.brand.midnight} textAlign='center' weight='semibold'>{tournament.tournament_name}</Text>
|
|
79
85
|
</View>
|
|
80
86
|
:<></>}
|
|
81
|
-
<View style={{ flexDirection:direction == 'horizontal' ? 'row' : 'column' }}>
|
|
87
|
+
<View style={{ flexDirection:direction == 'horizontal' ? 'row' : 'column', flex:1 }}>
|
|
82
88
|
|
|
83
89
|
<View style={{ ...view_styles.section_body, flexDirection:direction == 'horizontal' ? 'row' : 'column', flexGrow:2, padding:0, justifyContent:'center', alignItems:'center' }}>
|
|
84
90
|
{!hide_image ?
|
|
@@ -128,4 +134,8 @@ const AthleteTournamentMarket = ({ tournament, hide_image, direction, show_event
|
|
|
128
134
|
)
|
|
129
135
|
}
|
|
130
136
|
|
|
137
|
+
const styles = StyleSheet.create({
|
|
138
|
+
container_style: { ...view_styles.section, flexGrow:1, borderWidth:1, borderColor:Colors.shades.shade600 }
|
|
139
|
+
})
|
|
140
|
+
|
|
131
141
|
export default AthleteTournamentMarket
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { View, Image, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { View, Image, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import type { BestAvailableOrderProps, EventOrderStatProps, EventProps, MarketProps, MarketSideOptionProps, OrderProps, TradeProps } from '../../../types';
|
|
4
4
|
import { MarketButtonHelpers } from '../MarketButton/api';
|
|
5
5
|
import MarketButton from '../../components/MarketButton';
|
|
@@ -16,6 +16,7 @@ type EventMarketProps = {
|
|
|
16
16
|
hide_market_banner?:boolean,
|
|
17
17
|
latest_trades:TradeProps[],
|
|
18
18
|
hide_liquidity?:boolean,
|
|
19
|
+
style?:any,
|
|
19
20
|
direction?:'horizontal'|'vertical',
|
|
20
21
|
best_available_orders:BestAvailableOrderProps[],
|
|
21
22
|
event_order_stats:EventOrderStatProps[],
|
|
@@ -26,7 +27,12 @@ type EventMarketProps = {
|
|
|
26
27
|
onTradeLongPress:(trade:TradeProps) => void
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const EventMarket = ({ width, event, direction, hide_liquidity, market, latest_trades, best_available_orders, hide_market_banner, event_order_stats, show_grades, default_price_view, onOrder, onView, onTradeLongPress }:EventMarketProps) => {
|
|
30
|
+
const EventMarket = ({ width, event, style, direction, hide_liquidity, market, latest_trades, best_available_orders, hide_market_banner, event_order_stats, show_grades, default_price_view, onOrder, onView, onTradeLongPress }:EventMarketProps) => {
|
|
31
|
+
let set_style = { ...styles.container_style, width, maxWidth:direction == 'horizontal'?undefined:175 }
|
|
32
|
+
if(style){
|
|
33
|
+
set_style = style
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
const { liquidity, open_order_count } = MarketComponentHelpers.getLiqudity(event_order_stats);
|
|
31
37
|
const is_locked = MarketComponentHelpers.isEventMarketLocked(event, market.market_id);
|
|
32
38
|
const renderSides = useCallback((data:{ item:MarketSideOptionProps, index:number, market:MarketProps }) => {
|
|
@@ -61,7 +67,7 @@ const EventMarket = ({ width, event, direction, hide_liquidity, market, latest_t
|
|
|
61
67
|
},[JSON.stringify(best_available_orders)])
|
|
62
68
|
|
|
63
69
|
return (
|
|
64
|
-
<View style={
|
|
70
|
+
<View style={set_style}>
|
|
65
71
|
{!hide_market_banner ?
|
|
66
72
|
<LinearDiagnal
|
|
67
73
|
label={market.stat_label ?? market.type}
|
|
@@ -71,7 +77,7 @@ const EventMarket = ({ width, event, direction, hide_liquidity, market, latest_t
|
|
|
71
77
|
right_color={'#ebd197'}
|
|
72
78
|
/>
|
|
73
79
|
:<></>}
|
|
74
|
-
<View style={{ flexDirection:direction == 'horizontal' ? 'row' : 'column' }}>
|
|
80
|
+
<View style={{ flexDirection:direction == 'horizontal' ? 'row' : 'column', flex:1 }}>
|
|
75
81
|
|
|
76
82
|
<View style={{ ...view_styles.section_body, flexDirection:direction == 'horizontal' ? 'row' : 'column', flexGrow:2, padding:0, justifyContent:'center', alignItems:'center' }}>
|
|
77
83
|
{direction != 'horizontal' ?
|
|
@@ -128,4 +134,8 @@ const EventMarket = ({ width, event, direction, hide_liquidity, market, latest_t
|
|
|
128
134
|
)
|
|
129
135
|
}
|
|
130
136
|
|
|
137
|
+
const styles = StyleSheet.create({
|
|
138
|
+
container_style: { ...view_styles.section, flexGrow:1, borderWidth:1, borderColor:Colors.shades.shade600 }
|
|
139
|
+
})
|
|
140
|
+
|
|
131
141
|
export default EventMarket
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
|
-
import { View, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import type { AthleteProps, BestAvailableOrderProps, EventOrderStatProps, LeagueProps, MarketProps, MarketSideOptionProps, MatchProps, OrderProps, TeamProps, TournamentProps, TradeProps } from "../../../types"
|
|
4
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
5
|
import MarketButton from '../../components/MarketButton';
|
|
@@ -19,6 +19,7 @@ type MatchMarketProps = {
|
|
|
19
19
|
home_team?:TeamProps,
|
|
20
20
|
hide_stat_banner?:boolean,
|
|
21
21
|
width?:number,
|
|
22
|
+
style?:any,
|
|
22
23
|
market:MarketProps,
|
|
23
24
|
show_event?:boolean,
|
|
24
25
|
hide_liquidity?:boolean,
|
|
@@ -32,7 +33,11 @@ type MatchMarketProps = {
|
|
|
32
33
|
onTradeLongPress:(trade:TradeProps) => void
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
const MatchMarket = ({ league, match, show_event, hide_liquidity, hide_stat_banner, width, away_athlete, home_athlete, away_team, home_team, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress }:MatchMarketProps) => {
|
|
36
|
+
const MatchMarket = ({ league, match, show_event, style, hide_liquidity, hide_stat_banner, width, away_athlete, home_athlete, away_team, home_team, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress }:MatchMarketProps) => {
|
|
37
|
+
let set_style = { ...styles.container_style, width }
|
|
38
|
+
if(style){
|
|
39
|
+
set_style = style
|
|
40
|
+
}
|
|
36
41
|
|
|
37
42
|
const { liquidity, open_order_count } = MarketComponentHelpers.getLiqudity(event_order_stats)
|
|
38
43
|
const is_locked = useMemo(() => MarketComponentHelpers.isMatchMarketLocked(match, market.market_id),[JSON.stringify(match.supported_markets)])
|
|
@@ -78,7 +83,7 @@ const MatchMarket = ({ league, match, show_event, hide_liquidity, hide_stat_bann
|
|
|
78
83
|
if(match.participant_type == 'athlete' && (!home_athlete || !away_athlete)){ return <></> }
|
|
79
84
|
if(match.participant_type == 'team' && (!home_team || !away_team)){ return <></> }
|
|
80
85
|
return (
|
|
81
|
-
<View style={
|
|
86
|
+
<View style={set_style}>
|
|
82
87
|
{!hide_stat_banner ?
|
|
83
88
|
<LinearDiagnal
|
|
84
89
|
label={market.stat_label ?? market.type}
|
|
@@ -155,4 +160,10 @@ const MatchMarket = ({ league, match, show_event, hide_liquidity, hide_stat_bann
|
|
|
155
160
|
)
|
|
156
161
|
}
|
|
157
162
|
|
|
163
|
+
|
|
164
|
+
const styles = StyleSheet.create({
|
|
165
|
+
container_style: { ...view_styles.section, flexGrow:1, borderWidth:1, borderColor:Colors.shades.shade600 }
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
|
|
158
169
|
export default MatchMarket
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
-
import { View, Image, FlatList, TouchableOpacity, ActivityIndicator, ScrollView } from 'react-native';
|
|
2
|
+
import { View, Image, FlatList, TouchableOpacity, ActivityIndicator, ScrollView, StyleSheet } from 'react-native';
|
|
3
3
|
import type { AthleteProps, BEEventProps, BestAvailableOrderProps, CompanyProps, CompetitionProps, EventOrderStatProps, EventProps, LeagueProps, MarketProps, MarketSideOptionProps, OrderProps, PodcastProps, SquaresCompetitionProps, TradeProps } from '../../../types';
|
|
4
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
5
|
import { Button, Icons, LinearDiagnal, Text } from '../../../Components';
|
|
@@ -28,6 +28,7 @@ type TeamEventMarketProps = {
|
|
|
28
28
|
show_podcasts?:boolean,
|
|
29
29
|
squares_competitions?:SquaresCompetitionProps[],
|
|
30
30
|
latest_trades:TradeProps[],
|
|
31
|
+
style?:any,
|
|
31
32
|
best_available_orders:BestAvailableOrderProps[],
|
|
32
33
|
event_order_stats:EventOrderStatProps[],
|
|
33
34
|
default_price_view: 'last_trade'|'best_available',
|
|
@@ -46,7 +47,12 @@ type TeamEventMarketProps = {
|
|
|
46
47
|
onActivate?:(event_id:string, event_type:string) => void
|
|
47
48
|
activate_loading?:boolean
|
|
48
49
|
}
|
|
49
|
-
const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction, show_id, hide_liquidity, show_podcasts, activate_loading, competitions, squares_competitions, show_grades, markets, latest_trades, best_available_orders, event_order_stats, default_price_view, onTeamSelect, onSquaresSelect, onCompetitionSelect, onExpand, onOrder, onView, onViewAdditionalMarkets, onTradeLongPress, onActivate, onEvent, onShare, onPodcastSelect }:TeamEventMarketProps) => {
|
|
50
|
+
const TeamEventMarket = ({ event, league, style, init_expanded, hot_markets_direction, show_id, hide_liquidity, show_podcasts, activate_loading, competitions, squares_competitions, show_grades, markets, latest_trades, best_available_orders, event_order_stats, default_price_view, onTeamSelect, onSquaresSelect, onCompetitionSelect, onExpand, onOrder, onView, onViewAdditionalMarkets, onTradeLongPress, onActivate, onEvent, onShare, onPodcastSelect }:TeamEventMarketProps) => {
|
|
51
|
+
let set_style = { ...styles.container_style }
|
|
52
|
+
if(style){
|
|
53
|
+
set_style = style
|
|
54
|
+
}
|
|
55
|
+
const [ market_width, setMarketWidth ] = useState(180);
|
|
50
56
|
const [ expanded_data, setExpandedData ] = useState<{
|
|
51
57
|
expanded:boolean,
|
|
52
58
|
loaded:boolean,
|
|
@@ -128,7 +134,12 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
128
134
|
|
|
129
135
|
const primary_markets = useMemo(() => {
|
|
130
136
|
return TeamEventMarketHelpers.getPrimaryMarkets(event, markets)
|
|
131
|
-
}, [JSON.stringify(markets)])
|
|
137
|
+
}, [JSON.stringify(markets)]);
|
|
138
|
+
|
|
139
|
+
let primary_width = 180
|
|
140
|
+
if(primary_markets.length > 0){
|
|
141
|
+
primary_width = (market_width - (primary_markets.length * 8)) / (primary_markets.length)
|
|
142
|
+
}
|
|
132
143
|
|
|
133
144
|
const handleSelectCompetition = () => {
|
|
134
145
|
if(!competitions || competitions.length == 0){ return }
|
|
@@ -190,7 +201,7 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
190
201
|
}
|
|
191
202
|
if(!trade){ return <></> }
|
|
192
203
|
return (
|
|
193
|
-
<View key={`${event.event_id}_${data.item.side}`} style={{ margin:2, width:
|
|
204
|
+
<View key={`${event.event_id}_${data.item.side}`} style={{ margin:2, width:primary_width, height:50 }}>
|
|
194
205
|
<MarketButton
|
|
195
206
|
side_option={data.item}
|
|
196
207
|
market={data.market}
|
|
@@ -207,15 +218,15 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
207
218
|
/>
|
|
208
219
|
</View>
|
|
209
220
|
)
|
|
210
|
-
},[JSON.stringify(best_available_orders), JSON.stringify(latest_trades)])
|
|
221
|
+
},[JSON.stringify(best_available_orders), JSON.stringify(latest_trades), primary_width])
|
|
211
222
|
|
|
212
223
|
const renderMarketHeaders = useCallback((data:{ item:MarketProps, index:number }) => {
|
|
213
224
|
return (
|
|
214
|
-
<View style={{ width:
|
|
225
|
+
<View style={{ width:primary_width, marginLeft:2, marginRight:2 }}>
|
|
215
226
|
<Text size={12} color={Colors.brand.midnight} textAlign='center'>{data.item.type.toUpperCase()}</Text>
|
|
216
227
|
</View>
|
|
217
228
|
)
|
|
218
|
-
},[primary_markets.length])
|
|
229
|
+
},[primary_markets.length, primary_width])
|
|
219
230
|
|
|
220
231
|
const renderPodcasts = useCallback((data:{ item:PodcastProps, index:number }) => {
|
|
221
232
|
return (
|
|
@@ -292,6 +303,7 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
292
303
|
<View>
|
|
293
304
|
<FlatList
|
|
294
305
|
key={`${event.event_id}_side_options`}
|
|
306
|
+
scrollEnabled={false}
|
|
295
307
|
data={data.item.side_options.sort((a,b) => {
|
|
296
308
|
let a_t = a.side == data.item.trade_side ? 1 : 0
|
|
297
309
|
let b_t = b.side == data.item.trade_side ? 1 : 0
|
|
@@ -302,7 +314,7 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
302
314
|
/>
|
|
303
315
|
</View>
|
|
304
316
|
)
|
|
305
|
-
},[JSON.stringify(best_available_orders), JSON.stringify(latest_trades)])
|
|
317
|
+
},[JSON.stringify(best_available_orders), JSON.stringify(latest_trades), primary_width])
|
|
306
318
|
|
|
307
319
|
if(!event.away || !event.home){ return <></> }
|
|
308
320
|
|
|
@@ -310,7 +322,7 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
310
322
|
const { non_primary_markets, available } = useMemo(() => TeamEventMarketHelpers.sortNonPrimaryMarkets(TeamEventMarketHelpers.getNonPrimaryMarkets(event, markets), event_order_stats, latest_trades),[])
|
|
311
323
|
|
|
312
324
|
return (
|
|
313
|
-
<View ref={ref} style={
|
|
325
|
+
<View ref={ref} style={set_style}>
|
|
314
326
|
{sponsor ?
|
|
315
327
|
<LinearGradient style={{ marginTop:-1, marginLeft:-1, marginRight:-1, padding:10, flexDirection:'row', alignItems:'center', borderTopRightRadius:8, borderTopLeftRadius:8 }} start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[sponsor.brand_primary ?? Colors.brand.midnight, sponsor.brand_secondary ?? Colors.brand.cyan]}>
|
|
316
328
|
<View style={{ height:30, width:30, borderRadius:4, backgroundColor:Colors.shades.white }}>
|
|
@@ -451,13 +463,17 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
451
463
|
</TouchableOpacity>
|
|
452
464
|
</View>
|
|
453
465
|
{event_status == 'active' ?
|
|
454
|
-
<View nativeID='primary_market_details' style={{ padding:5 }}
|
|
466
|
+
<View nativeID='primary_market_details' style={{ padding:5, flex:1 }} onLayout={(ev) => {
|
|
467
|
+
const { width } = ev.nativeEvent.layout
|
|
468
|
+
setMarketWidth(width);
|
|
469
|
+
}}>
|
|
455
470
|
<View style={{ marginTop:5, marginBottom:5 }}>
|
|
456
471
|
<FlatList
|
|
457
472
|
key={`${event.event_id}_market_headers`}
|
|
458
473
|
data={primary_markets}
|
|
459
474
|
keyExtractor={(item) => item.market_id.toString()}
|
|
460
475
|
horizontal
|
|
476
|
+
scrollEnabled={false}
|
|
461
477
|
renderItem={renderMarketHeaders}
|
|
462
478
|
/>
|
|
463
479
|
</View>
|
|
@@ -465,6 +481,7 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
465
481
|
key={`${event.event_id}_primary_markets`}
|
|
466
482
|
data={primary_markets.sort((a,b) => parseInt(a.market_id) - parseInt(b.market_id))}
|
|
467
483
|
horizontal
|
|
484
|
+
scrollEnabled={false}
|
|
468
485
|
renderItem={renderPrimaryMarkets}
|
|
469
486
|
keyExtractor={(item) => item.market_id.toString()}
|
|
470
487
|
/>
|
|
@@ -627,6 +644,12 @@ const TeamEventMarket = ({ event, league, init_expanded, hot_markets_direction,
|
|
|
627
644
|
)
|
|
628
645
|
}
|
|
629
646
|
|
|
647
|
+
|
|
648
|
+
const styles = StyleSheet.create({
|
|
649
|
+
container_style: { ...view_styles.section, borderWidth:1, borderColor:Colors.shades.shade600 }
|
|
650
|
+
})
|
|
651
|
+
|
|
652
|
+
|
|
630
653
|
export default React.memo(TeamEventMarket, (left, right) => {
|
|
631
654
|
if(JSON.stringify(left) != JSON.stringify(right)){ return false }
|
|
632
655
|
return true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
|
-
import { View, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { View, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
3
|
import type { BestAvailableOrderProps, EventOrderStatProps, MarketProps, MarketSideOptionProps, OrderProps, TeamProps, TournamentProps, TradeProps } from "../../../types"
|
|
4
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
5
|
import MarketButton from '../../components/MarketButton';
|
|
@@ -19,6 +19,7 @@ type TeamTournamentMarketProps = {
|
|
|
19
19
|
direction?:'horizontal'|'vertical',
|
|
20
20
|
show_event?:boolean,
|
|
21
21
|
hide_liquidity?:boolean,
|
|
22
|
+
style?:any,
|
|
22
23
|
latest_trades:TradeProps[],
|
|
23
24
|
best_available_orders:BestAvailableOrderProps[],
|
|
24
25
|
event_order_stats:EventOrderStatProps[],
|
|
@@ -29,7 +30,12 @@ type TeamTournamentMarketProps = {
|
|
|
29
30
|
onTradeLongPress:(trade:TradeProps) => void
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const TeamTournamentMarket = ({ tournament, direction, show_event, hide_liquidity, hide_stat_banner, width, team, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress }:TeamTournamentMarketProps) => {
|
|
33
|
+
const TeamTournamentMarket = ({ tournament, direction, show_event, hide_liquidity, hide_stat_banner, style, width, team, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress }:TeamTournamentMarketProps) => {
|
|
34
|
+
let set_style = { ...styles.container_style, width }
|
|
35
|
+
if(style){
|
|
36
|
+
set_style = style
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
const { liquidity, open_order_count } = MarketComponentHelpers.getLiqudity(event_order_stats);
|
|
34
40
|
const is_locked = useMemo(() => MarketComponentHelpers.isTournamentMarketLocked(tournament, market.market_id),[JSON.stringify(tournament.supported_markets)])
|
|
35
41
|
|
|
@@ -63,7 +69,7 @@ const TeamTournamentMarket = ({ tournament, direction, show_event, hide_liquidit
|
|
|
63
69
|
},[JSON.stringify(best_available_orders)])
|
|
64
70
|
|
|
65
71
|
return (
|
|
66
|
-
<View style={
|
|
72
|
+
<View style={set_style}>
|
|
67
73
|
{!hide_stat_banner ?
|
|
68
74
|
<LinearDiagnal
|
|
69
75
|
label={market.stat_label ?? market.type}
|
|
@@ -124,4 +130,8 @@ const TeamTournamentMarket = ({ tournament, direction, show_event, hide_liquidit
|
|
|
124
130
|
)
|
|
125
131
|
}
|
|
126
132
|
|
|
133
|
+
const styles = StyleSheet.create({
|
|
134
|
+
container_style: { ...view_styles.section, flexGrow:1, borderWidth:1, borderColor:Colors.shades.shade600 }
|
|
135
|
+
})
|
|
136
|
+
|
|
127
137
|
export default TeamTournamentMarket
|