be-components 6.4.6 → 6.4.7
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/ApiOverrides/index.js +16 -0
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Authenticator/Components/StrategyForm.js +1 -1
- package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/commonjs/Authenticator/api/index.js.map +1 -1
- package/lib/commonjs/Components/AutoScrollFlatList.js +2 -1
- package/lib/commonjs/Components/AutoScrollFlatList.js.map +1 -1
- package/lib/commonjs/Components/Dropdown.js +9 -2
- package/lib/commonjs/Components/Dropdown.js.map +1 -1
- package/lib/commonjs/FlashMarket/FlashHolder.js +4 -1
- package/lib/commonjs/FlashMarket/FlashHolder.js.map +1 -1
- package/lib/commonjs/FlashMarket/api/index.js +8 -0
- package/lib/commonjs/FlashMarket/api/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/api/index.js +12 -0
- package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js +4 -2
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +2 -2
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/commonjs/ProfileManager/api/index.js +7 -2
- package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +16 -0
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Authenticator/Components/StrategyForm.js +1 -1
- package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/module/Authenticator/api/index.js.map +1 -1
- package/lib/module/Components/AutoScrollFlatList.js +2 -1
- package/lib/module/Components/AutoScrollFlatList.js.map +1 -1
- package/lib/module/Components/Dropdown.js +9 -2
- package/lib/module/Components/Dropdown.js.map +1 -1
- package/lib/module/FlashMarket/FlashHolder.js +4 -1
- package/lib/module/FlashMarket/FlashHolder.js.map +1 -1
- package/lib/module/FlashMarket/api/index.js +8 -0
- package/lib/module/FlashMarket/api/index.js.map +1 -1
- package/lib/module/MarketComponents/api/index.js +12 -0
- package/lib/module/MarketComponents/api/index.js.map +1 -1
- package/lib/module/MarketComponents/components/AthleteMarket/index.js +4 -2
- package/lib/module/MarketComponents/components/AthleteMarket/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js +2 -2
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/module/ProfileManager/api/index.js +7 -2
- package/lib/module/ProfileManager/api/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/AutoScrollFlatList.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/AutoScrollFlatList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Dropdown.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts +2 -1
- package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/FlashMarket/api/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/FlashMarket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/AutoScrollFlatList.d.ts +2 -1
- package/lib/typescript/lib/module/Components/AutoScrollFlatList.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Dropdown.d.ts +1 -1
- package/lib/typescript/lib/module/Components/Dropdown.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts +2 -1
- package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/api/index.d.ts +1 -0
- package/lib/typescript/lib/module/FlashMarket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/api/index.d.ts +1 -0
- package/lib/typescript/lib/module/MarketComponents/api/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/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts +2 -2
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/api/index.d.ts +1 -0
- package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/AutoScrollFlatList.d.ts +2 -1
- package/lib/typescript/src/Components/AutoScrollFlatList.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/FlashHolder.d.ts +2 -1
- package/lib/typescript/src/FlashMarket/FlashHolder.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/api/index.d.ts +1 -0
- package/lib/typescript/src/FlashMarket/api/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/api/index.d.ts +5 -0
- package/lib/typescript/src/MarketComponents/api/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/index.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/ApiOverrides/index.ts +18 -2
- package/src/Authenticator/Components/StrategyForm.tsx +2 -1
- package/src/Authenticator/api/index.ts +1 -1
- package/src/Components/AutoScrollFlatList.tsx +3 -1
- package/src/Components/Dropdown.tsx +6 -6
- package/src/FlashMarket/FlashHolder.tsx +6 -2
- package/src/FlashMarket/api/index.ts +8 -0
- package/src/MarketComponents/api/index.ts +8 -0
- package/src/MarketComponents/components/AthleteMarket/index.tsx +4 -3
- package/src/MarketComponents/components/TeamEventMarket/index.tsx +2 -2
- package/src/ProfileManager/api/index.ts +7 -2
|
@@ -36,6 +36,7 @@ const StrategyForm = ({ visible, strategy, auth_strategy_id, onFocusPosition, co
|
|
|
36
36
|
const [ code_details, setCodeDetails ] = useState<{
|
|
37
37
|
player_referral?:PlayerReferralProps,
|
|
38
38
|
promo?:PromoProps,
|
|
39
|
+
company?:CompanyProps,
|
|
39
40
|
referrer?:PublicPlayerProps
|
|
40
41
|
}>({})
|
|
41
42
|
//const [ active_mini_index, setActiveMiniIndex ] = useState(0);
|
|
@@ -181,7 +182,7 @@ const StrategyForm = ({ visible, strategy, auth_strategy_id, onFocusPosition, co
|
|
|
181
182
|
<Icons.GiftIcon size={40} color={C.text.gold} />
|
|
182
183
|
</View>
|
|
183
184
|
<View transparent style={{flex:1, backgroundColor:C.views.gold, padding:10, borderTopRightRadius:8, borderBottomRightRadius:8 }}>
|
|
184
|
-
<Text theme='h1'>@{code_details.referrer?.username} has a gift for you</Text>
|
|
185
|
+
<Text theme='h1'>@{code_details.company ? code_details.company.company_name : code_details.referrer?.username} has a gift for you</Text>
|
|
185
186
|
<Text style={{ paddingTop:5 }} theme='h2'>{ProfileHelpers.getReferralDescription(code_details.promo)}</Text>
|
|
186
187
|
</View>
|
|
187
188
|
</View>
|
|
@@ -48,7 +48,7 @@ const AuthenticateApi = {
|
|
|
48
48
|
let resp = await axios.post(`${AUTH_SVC_API}/v1/players/player/phone/verify`, { token, device_id })
|
|
49
49
|
return resp.data
|
|
50
50
|
},
|
|
51
|
-
getReferralByCode: async(code:string):Promise<{ player_referral?:PlayerReferralProps, promo?:PromoProps, referrer?:PublicPlayerProps }> => {
|
|
51
|
+
getReferralByCode: async(code:string):Promise<{ player_referral?:PlayerReferralProps, promo?:PromoProps, referrer?:PublicPlayerProps, company?:CompanyProps }> => {
|
|
52
52
|
const resp = await axios.get(`${AUTH_SVC_API}/v1/promos/referral/code/${code}`)
|
|
53
53
|
return resp.data
|
|
54
54
|
},
|
|
@@ -14,6 +14,7 @@ type AutoScrollingFlatListProps<T> = {
|
|
|
14
14
|
data: T[];
|
|
15
15
|
renderItem: ({ item, index }: { item: T; index: number }) => React.ReactElement;
|
|
16
16
|
horizontal?: boolean;
|
|
17
|
+
width?:number,
|
|
17
18
|
style?: ViewStyle;
|
|
18
19
|
speed: number; // pixels per second
|
|
19
20
|
minDuration?: number; // milliseconds (optional)
|
|
@@ -27,6 +28,7 @@ const AutoScrollingFlatList = <T,>({
|
|
|
27
28
|
horizontal = false,
|
|
28
29
|
style,
|
|
29
30
|
speed,
|
|
31
|
+
width,
|
|
30
32
|
minDuration = 0,
|
|
31
33
|
onCompleteScroll,
|
|
32
34
|
resetKey,
|
|
@@ -178,7 +180,7 @@ const AutoScrollingFlatList = <T,>({
|
|
|
178
180
|
{
|
|
179
181
|
overflow: 'hidden', flex:1,
|
|
180
182
|
height: horizontal ? '100%' : windowSize.height,
|
|
181
|
-
width: horizontal ? windowSize.width : '100%',
|
|
183
|
+
width: horizontal ? width ?? windowSize.width : '100%',
|
|
182
184
|
},
|
|
183
185
|
style,
|
|
184
186
|
]}
|
|
@@ -37,17 +37,17 @@ const DropDown = ({ invalid, errors, read_only, selected_value, dropdown_options
|
|
|
37
37
|
const renderOptions = (data: { item: string, index:number }) => {
|
|
38
38
|
const last_item = data.index == options.length - 1 ? true : false
|
|
39
39
|
return (
|
|
40
|
-
<Button style={{ paddingTop:10, paddingBottom:last_item?0:10, borderBottomWidth:last_item?0:1, borderColor:Colors.borders.light }} onPress={() => handleOptionSelect(data.item)}>
|
|
40
|
+
<Button transparent style={{ paddingTop:10, paddingBottom:last_item?0:10, borderBottomWidth:last_item?0:1, borderColor:Colors.borders.light }} onPress={() => handleOptionSelect(data.item)}>
|
|
41
41
|
<Text size={14} theme='description'>{data.item}</Text>
|
|
42
42
|
</Button>
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
|
-
<View>
|
|
48
|
-
<View style={{ borderRadius:8, borderWidth:1, borderColor:invalid?Colors.text.error:Colors.borders.light }}>
|
|
49
|
-
<Button disabled={read_only} style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => setExpanded(!expanded)}>
|
|
50
|
-
<Text style={{ flex:1 }} size={14} theme='h2'>{selected_value && selected_value != '' ? selected_value : 'Select Value'}</Text>
|
|
47
|
+
<View transparent>
|
|
48
|
+
<View float style={{ borderRadius:8, borderWidth:1, borderColor:invalid?Colors.text.error:Colors.borders.light }}>
|
|
49
|
+
<Button transparent disabled={read_only} style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => setExpanded(!expanded)}>
|
|
50
|
+
<Text style={{ flex:1, marginRight:6 }} size={14} theme='h2'>{selected_value && selected_value != '' ? selected_value : 'Select Value'}</Text>
|
|
51
51
|
{!read_only ?
|
|
52
52
|
<Icons.ChevronIcon
|
|
53
53
|
direction={expanded?'up':'down'}
|
|
@@ -57,7 +57,7 @@ const DropDown = ({ invalid, errors, read_only, selected_value, dropdown_options
|
|
|
57
57
|
:<></>}
|
|
58
58
|
</Button>
|
|
59
59
|
{expanded ?
|
|
60
|
-
<View style={{padding:10 }}>
|
|
60
|
+
<View transparent style={{padding:10 }}>
|
|
61
61
|
<FlatList
|
|
62
62
|
data={options}
|
|
63
63
|
renderItem={renderOptions}
|
|
@@ -16,6 +16,7 @@ type FlashHolderProps = {
|
|
|
16
16
|
distinct_id?:string,
|
|
17
17
|
compact?:boolean,
|
|
18
18
|
player?:MyPlayerProps,
|
|
19
|
+
company_id?:string,
|
|
19
20
|
init_expanded?:boolean,
|
|
20
21
|
contest_type?:string,
|
|
21
22
|
parent_style?:ViewStyle,
|
|
@@ -35,7 +36,7 @@ type FlashHolderProps = {
|
|
|
35
36
|
onRequestAuthenticate: () => void
|
|
36
37
|
}
|
|
37
38
|
const sections = [ 'selector','explainer','flash_market','options','footer' ]
|
|
38
|
-
const FlashHolder = ({ float, compact, style, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation } : FlashHolderProps) => {
|
|
39
|
+
const FlashHolder = ({ float, company_id, compact, style, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation } : FlashHolderProps) => {
|
|
39
40
|
const Colors = useColors();
|
|
40
41
|
const [ needs_reload, setNeedsReload ] = useState(false);
|
|
41
42
|
const [ socket_campaigns, setSocketCampaigns ] = useState<PollCampaignProps[]>([]);
|
|
@@ -153,8 +154,11 @@ const FlashHolder = ({ float, compact, style, hide_timer, distinct_id, hide_foot
|
|
|
153
154
|
setFlashData({ ...flash_data, loaded:true, holder_loading: false });
|
|
154
155
|
return handleSelectPoll(poll_id, options);
|
|
155
156
|
}
|
|
157
|
+
|
|
156
158
|
let found_polls:PollProps[] = []
|
|
157
|
-
if(
|
|
159
|
+
if(company_id){
|
|
160
|
+
found_polls = await FlashMarketApi.getActiveMarkets(company_id);
|
|
161
|
+
} else if(league_id || contest_type || contest_id || side_type || side_id){
|
|
158
162
|
found_polls = await FlashMarketApi.getActiveLinkedFlashMarkets(league_id, contest_type, contest_id, side_type, side_id);
|
|
159
163
|
} else {
|
|
160
164
|
found_polls = await FlashMarketApi.getActiveFlashMarkets();
|
|
@@ -38,6 +38,14 @@ const FlashMarketApi = {
|
|
|
38
38
|
return []
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
getActiveMarkets: async(company_id?:string):Promise<PollProps[]> => {
|
|
42
|
+
try {
|
|
43
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v2/pm/active?company_id=${company_id}`);
|
|
44
|
+
return resp.data.polls
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return []
|
|
47
|
+
}
|
|
48
|
+
},
|
|
41
49
|
getActiveLinkedFlashMarkets: async(league_id?:string, contest_type?:string, contest_id?:string, side_type?:string, side_id?:string):Promise<PollProps[]> => {
|
|
42
50
|
try {
|
|
43
51
|
const resp = await axios.get(`${AUTH_SVC_API}/v2/pm/flash/linked?league_id=${league_id}&contest_type=${contest_type}&contest_id=${contest_id}&side_type=${side_type}&side_id=${side_id}`);
|
|
@@ -202,6 +202,14 @@ const MarketComponentApi = {
|
|
|
202
202
|
return []
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
|
+
getEventsByDate: async(league_id:string, date:string, timezone?:string):Promise<{day:string, days:string[], events:EventProps[]}> => {
|
|
206
|
+
try {
|
|
207
|
+
const resp = await axios.get(`${EVENT_SVC_API}/v1/events/league/date/${league_id}/${date}?timezone=${timezone}`);
|
|
208
|
+
return resp.data
|
|
209
|
+
} catch (e) {
|
|
210
|
+
return { day: date, days:[], events: [] }
|
|
211
|
+
}
|
|
212
|
+
},
|
|
205
213
|
getMatchesByMatchIds: async(match_ids:string[]):Promise<MatchProps[]> => {
|
|
206
214
|
try {
|
|
207
215
|
if(match_ids.length == 0){ return [] }
|
|
@@ -21,6 +21,7 @@ type AthleteMarketProps = {
|
|
|
21
21
|
float?:boolean,
|
|
22
22
|
direction?:'horizontal'|'vertical',
|
|
23
23
|
style?:any,
|
|
24
|
+
image_size?:number,
|
|
24
25
|
league?:LeagueProps,
|
|
25
26
|
hide_image?:boolean,
|
|
26
27
|
show_event?:boolean,
|
|
@@ -35,7 +36,7 @@ type AthleteMarketProps = {
|
|
|
35
36
|
onTradeLongPress:(trade:TradeProps) => void
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
const AthleteMarket = ({ event, show_event, disabled_markets, float, hide_image, direction, league, hide_liquidity, style, hide_stat_banner, athlete, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress, onSetMarket }:AthleteMarketProps) => {
|
|
39
|
+
const AthleteMarket = ({ event, show_event, disabled_markets, float, image_size, hide_image, direction, league, hide_liquidity, style, hide_stat_banner, athlete, market, event_order_stats, default_price_view, latest_trades, show_grades, best_available_orders, onOrder, onView, onTradeLongPress, onSetMarket }:AthleteMarketProps) => {
|
|
39
40
|
const C = useColors();
|
|
40
41
|
|
|
41
42
|
const { liquidity, open_order_count } = useMemo(() => MarketComponentHelpers.getLiqudity(event_order_stats), [JSON.stringify(event_order_stats)])
|
|
@@ -52,7 +53,7 @@ const AthleteMarket = ({ event, show_event, disabled_markets, float, hide_image,
|
|
|
52
53
|
let disabled = false
|
|
53
54
|
if(disabled_markets && disabled_markets.includes(data.market.market_id.toString())){ disabled = true }
|
|
54
55
|
return (
|
|
55
|
-
<View key={`${event.event_id}_${athlete.athlete_id}_${market.market_id}_${data.item.side}`} style={{ margin:2, height:50,
|
|
56
|
+
<View key={`${event.event_id}_${athlete.athlete_id}_${market.market_id}_${data.item.side}`} style={{ margin:2, height:50, minWidth:65, flexGrow:1 }}>
|
|
56
57
|
<MarketButton
|
|
57
58
|
side_option={data.item}
|
|
58
59
|
market={data.market}
|
|
@@ -92,7 +93,7 @@ const AthleteMarket = ({ event, show_event, disabled_markets, float, hide_image,
|
|
|
92
93
|
<AthleteImage
|
|
93
94
|
athlete={athlete}
|
|
94
95
|
league={league}
|
|
95
|
-
size={
|
|
96
|
+
size={image_size ?? 50}
|
|
96
97
|
number_size={12}
|
|
97
98
|
/>
|
|
98
99
|
:<></>}
|
|
@@ -252,7 +252,7 @@ const TeamEventMarket = ({ event, parlays, hide_non_primary, disabled_markets, f
|
|
|
252
252
|
let disabled = false
|
|
253
253
|
if(disabled_markets && disabled_markets.includes(data.market.market_id.toString())){ disabled = true }
|
|
254
254
|
return (
|
|
255
|
-
<View transparent key={`${event.event_id}_${data.item.side}`} style={{
|
|
255
|
+
<View transparent key={`${event.event_id}_${data.item.side}`} style={{ minWidth:primary_width }}>
|
|
256
256
|
<View transparent style={{ height:50, margin:2 }}>
|
|
257
257
|
<MarketButton
|
|
258
258
|
side_option={data.item}
|
|
@@ -598,7 +598,7 @@ const TeamEventMarket = ({ event, parlays, hide_non_primary, disabled_markets, f
|
|
|
598
598
|
{event_status == 'active' ?
|
|
599
599
|
<View transparent nativeID='primary_market_details' style={{ padding:5, flex:1 }} onLayout={(ev) => {
|
|
600
600
|
const { width } = ev.nativeEvent.layout
|
|
601
|
-
setMarketWidth(width
|
|
601
|
+
setMarketWidth(width);
|
|
602
602
|
}}>
|
|
603
603
|
<View transparent style={{ marginTop:5, marginBottom:5 }}>
|
|
604
604
|
<FlatList
|
|
@@ -66,8 +66,13 @@ const ProfileApi = {
|
|
|
66
66
|
return resp.data.player
|
|
67
67
|
},
|
|
68
68
|
getMyDetails : async():Promise<{ player:MyPlayerProps, player_premium_items:PlayerPremiumItem[] }> => {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
try {
|
|
70
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/me`)
|
|
71
|
+
return resp.data
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.log(e)
|
|
74
|
+
throw new Error('')
|
|
75
|
+
}
|
|
71
76
|
},
|
|
72
77
|
getPremiumItems: async():Promise<PremiumItemProps[]> => {
|
|
73
78
|
try {
|