be-components 6.1.0 → 6.1.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/BetMatch/api/index.js +67 -1
- package/lib/commonjs/BetMatch/api/index.js.map +1 -1
- package/lib/commonjs/BetMatch/components/BetMatchCard.js +100 -46
- package/lib/commonjs/BetMatch/components/BetMatchCard.js.map +1 -1
- package/lib/commonjs/BetMatch/components/ManageFilter.js +1342 -0
- package/lib/commonjs/BetMatch/components/ManageFilter.js.map +1 -0
- package/lib/commonjs/BetMatch/index.js +204 -64
- package/lib/commonjs/BetMatch/index.js.map +1 -1
- package/lib/commonjs/Components/AthleteLozenge.js +81 -0
- package/lib/commonjs/Components/AthleteLozenge.js.map +1 -0
- package/lib/commonjs/Components/AutoScrollFlatList.js +50 -7
- package/lib/commonjs/Components/AutoScrollFlatList.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +2 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/Jerseys.js +30 -11
- package/lib/commonjs/Components/Jerseys.js.map +1 -1
- package/lib/commonjs/Components/LeagueLozenge.js +59 -0
- package/lib/commonjs/Components/LeagueLozenge.js.map +1 -0
- package/lib/commonjs/Components/MarketLozenge.js +48 -0
- package/lib/commonjs/Components/MarketLozenge.js.map +1 -0
- package/lib/commonjs/Components/PlayerLozenge.js +61 -0
- package/lib/commonjs/Components/PlayerLozenge.js.map +1 -0
- package/lib/commonjs/Components/PremiumIcons.js +366 -0
- package/lib/commonjs/Components/PremiumIcons.js.map +1 -0
- package/lib/commonjs/Components/TeamLozenge.js +70 -0
- package/lib/commonjs/Components/TeamLozenge.js.map +1 -0
- package/lib/commonjs/Components/index.js +35 -0
- package/lib/commonjs/Components/index.js.map +1 -1
- package/lib/commonjs/FlashMarket/index.js +27 -0
- package/lib/commonjs/FlashMarket/index.js.map +1 -1
- package/lib/commonjs/Premium/api/index.js +50 -0
- package/lib/commonjs/Premium/api/index.js.map +1 -0
- package/lib/commonjs/Premium/components/ALaCartePremium.js +314 -0
- package/lib/commonjs/Premium/components/ALaCartePremium.js.map +1 -0
- package/lib/commonjs/Premium/index.js +12 -0
- package/lib/commonjs/Premium/index.js.map +1 -0
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +3 -3
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/api/index.js +10 -1
- package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
- package/lib/commonjs/ProfileManager/index.js +2 -2
- package/lib/commonjs/ProfileManager/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/api/index.js +12 -0
- package/lib/commonjs/SocialComponents/api/index.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/BetMatch/api/index.js +66 -0
- package/lib/module/BetMatch/api/index.js.map +1 -1
- package/lib/module/BetMatch/components/BetMatchCard.js +102 -48
- package/lib/module/BetMatch/components/BetMatchCard.js.map +1 -1
- package/lib/module/BetMatch/components/ManageFilter.js +1333 -0
- package/lib/module/BetMatch/components/ManageFilter.js.map +1 -0
- package/lib/module/BetMatch/index.js +206 -66
- package/lib/module/BetMatch/index.js.map +1 -1
- package/lib/module/Components/AthleteLozenge.js +73 -0
- package/lib/module/Components/AthleteLozenge.js.map +1 -0
- package/lib/module/Components/AutoScrollFlatList.js +51 -8
- package/lib/module/Components/AutoScrollFlatList.js.map +1 -1
- package/lib/module/Components/Icons.js +3 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/Jerseys.js +30 -11
- package/lib/module/Components/Jerseys.js.map +1 -1
- package/lib/module/Components/LeagueLozenge.js +51 -0
- package/lib/module/Components/LeagueLozenge.js.map +1 -0
- package/lib/module/Components/MarketLozenge.js +40 -0
- package/lib/module/Components/MarketLozenge.js.map +1 -0
- package/lib/module/Components/PlayerLozenge.js +53 -0
- package/lib/module/Components/PlayerLozenge.js.map +1 -0
- package/lib/module/Components/PremiumIcons.js +359 -0
- package/lib/module/Components/PremiumIcons.js.map +1 -0
- package/lib/module/Components/TeamLozenge.js +62 -0
- package/lib/module/Components/TeamLozenge.js.map +1 -0
- package/lib/module/Components/index.js +6 -1
- package/lib/module/Components/index.js.map +1 -1
- package/lib/module/FlashMarket/index.js +27 -0
- package/lib/module/FlashMarket/index.js.map +1 -1
- package/lib/module/Premium/api/index.js +43 -0
- package/lib/module/Premium/api/index.js.map +1 -0
- package/lib/module/Premium/components/ALaCartePremium.js +305 -0
- package/lib/module/Premium/components/ALaCartePremium.js.map +1 -0
- package/lib/module/Premium/index.js +5 -0
- package/lib/module/Premium/index.js.map +1 -0
- package/lib/module/ProfileManager/Components/VouchCard.js +3 -3
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/api/index.js +10 -1
- package/lib/module/ProfileManager/api/index.js.map +1 -1
- package/lib/module/ProfileManager/index.js +2 -2
- package/lib/module/ProfileManager/index.js.map +1 -1
- package/lib/module/SocialComponents/api/index.js +12 -0
- package/lib/module/SocialComponents/api/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/BetMatch/api/index.d.ts +7 -0
- package/lib/typescript/lib/commonjs/BetMatch/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCard.d.ts +10 -2
- package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/BetMatch/components/ManageFilter.d.ts +10 -0
- package/lib/typescript/lib/commonjs/BetMatch/components/ManageFilter.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BetMatch/index.d.ts +12 -1
- package/lib/typescript/lib/commonjs/BetMatch/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/AthleteLozenge.d.ts +11 -0
- package/lib/typescript/lib/commonjs/Components/AthleteLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/AutoScrollFlatList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Jerseys.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/LeagueLozenge.d.ts +10 -0
- package/lib/typescript/lib/commonjs/Components/LeagueLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/MarketLozenge.d.ts +10 -0
- package/lib/typescript/lib/commonjs/Components/MarketLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/PlayerLozenge.d.ts +9 -0
- package/lib/typescript/lib/commonjs/Components/PlayerLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/PremiumIcons.d.ts +85 -0
- package/lib/typescript/lib/commonjs/Components/PremiumIcons.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/TeamLozenge.d.ts +10 -0
- package/lib/typescript/lib/commonjs/Components/TeamLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Components/index.d.ts +5 -0
- package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Premium/api/index.d.ts +18 -0
- package/lib/typescript/lib/commonjs/Premium/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Premium/components/ALaCartePremium.d.ts +12 -0
- package/lib/typescript/lib/commonjs/Premium/components/ALaCartePremium.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Premium/index.d.ts +6 -0
- package/lib/typescript/lib/commonjs/Premium/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/api/index.d.ts +6 -6
- package/lib/typescript/lib/commonjs/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/BetMatch/api/index.d.ts +7 -0
- package/lib/typescript/lib/module/BetMatch/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/BetMatch/components/BetMatchCard.d.ts +10 -2
- package/lib/typescript/lib/module/BetMatch/components/BetMatchCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/BetMatch/components/ManageFilter.d.ts +10 -0
- package/lib/typescript/lib/module/BetMatch/components/ManageFilter.d.ts.map +1 -0
- package/lib/typescript/lib/module/BetMatch/index.d.ts +12 -1
- package/lib/typescript/lib/module/BetMatch/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/AthleteLozenge.d.ts +11 -0
- package/lib/typescript/lib/module/Components/AthleteLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/AutoScrollFlatList.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Jerseys.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/LeagueLozenge.d.ts +10 -0
- package/lib/typescript/lib/module/Components/LeagueLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/MarketLozenge.d.ts +10 -0
- package/lib/typescript/lib/module/Components/MarketLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/PlayerLozenge.d.ts +9 -0
- package/lib/typescript/lib/module/Components/PlayerLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/PremiumIcons.d.ts +86 -0
- package/lib/typescript/lib/module/Components/PremiumIcons.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/TeamLozenge.d.ts +10 -0
- package/lib/typescript/lib/module/Components/TeamLozenge.d.ts.map +1 -0
- package/lib/typescript/lib/module/Components/index.d.ts +6 -1
- package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Premium/api/index.d.ts +17 -0
- package/lib/typescript/lib/module/Premium/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/Premium/components/ALaCartePremium.d.ts +17 -0
- package/lib/typescript/lib/module/Premium/components/ALaCartePremium.d.ts.map +1 -0
- package/lib/typescript/lib/module/Premium/index.d.ts +6 -0
- package/lib/typescript/lib/module/Premium/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/ProfileManager/api/index.d.ts +1 -0
- package/lib/typescript/lib/module/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/api/index.d.ts +6 -6
- package/lib/typescript/lib/module/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +3 -1
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/BetMatch/api/index.d.ts +8 -1
- package/lib/typescript/src/BetMatch/api/index.d.ts.map +1 -1
- package/lib/typescript/src/BetMatch/components/BetMatchCard.d.ts +12 -4
- package/lib/typescript/src/BetMatch/components/BetMatchCard.d.ts.map +1 -1
- package/lib/typescript/src/BetMatch/components/ManageFilter.d.ts +12 -0
- package/lib/typescript/src/BetMatch/components/ManageFilter.d.ts.map +1 -0
- package/lib/typescript/src/BetMatch/index.d.ts +23 -2
- package/lib/typescript/src/BetMatch/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/AthleteLozenge.d.ts +13 -0
- package/lib/typescript/src/Components/AthleteLozenge.d.ts.map +1 -0
- package/lib/typescript/src/Components/AutoScrollFlatList.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -1
- package/lib/typescript/src/Components/LeagueLozenge.d.ts +13 -0
- package/lib/typescript/src/Components/LeagueLozenge.d.ts.map +1 -0
- package/lib/typescript/src/Components/MarketLozenge.d.ts +13 -0
- package/lib/typescript/src/Components/MarketLozenge.d.ts.map +1 -0
- package/lib/typescript/src/Components/PlayerLozenge.d.ts +11 -0
- package/lib/typescript/src/Components/PlayerLozenge.d.ts.map +1 -0
- package/lib/typescript/src/Components/PremiumIcons.d.ts +27 -0
- package/lib/typescript/src/Components/PremiumIcons.d.ts.map +1 -0
- package/lib/typescript/src/Components/TeamLozenge.d.ts +12 -0
- package/lib/typescript/src/Components/TeamLozenge.d.ts.map +1 -0
- package/lib/typescript/src/Components/index.d.ts +6 -1
- package/lib/typescript/src/Components/index.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/Premium/api/index.d.ts +12 -0
- package/lib/typescript/src/Premium/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Premium/components/ALaCartePremium.d.ts +16 -0
- package/lib/typescript/src/Premium/components/ALaCartePremium.d.ts.map +1 -0
- package/lib/typescript/src/Premium/index.d.ts +13 -0
- package/lib/typescript/src/Premium/index.d.ts.map +1 -0
- package/lib/typescript/src/ProfileManager/api/index.d.ts +6 -2
- package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/api/index.d.ts +1 -1
- package/lib/typescript/src/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BetMatch/api/index.ts +54 -2
- package/src/BetMatch/components/BetMatchCard.tsx +82 -43
- package/src/BetMatch/components/ManageFilter.tsx +830 -0
- package/src/BetMatch/index.tsx +142 -45
- package/src/Components/AthleteLozenge.tsx +52 -0
- package/src/Components/AutoScrollFlatList.tsx +50 -15
- package/src/Components/Icons.tsx +5 -0
- package/src/Components/Jerseys.tsx +19 -10
- package/src/Components/LeagueLozenge.tsx +36 -0
- package/src/Components/MarketLozenge.tsx +29 -0
- package/src/Components/PlayerLozenge.tsx +37 -0
- package/src/Components/PremiumIcons.tsx +201 -0
- package/src/Components/TeamLozenge.tsx +44 -0
- package/src/Components/index.tsx +10 -0
- package/src/FlashMarket/index.tsx +15 -0
- package/src/Premium/api/index.ts +32 -0
- package/src/Premium/components/ALaCartePremium.tsx +145 -0
- package/src/Premium/index.tsx +5 -0
- package/src/ProfileManager/Components/VouchCard.tsx +3 -3
- package/src/ProfileManager/api/index.ts +12 -3
- package/src/ProfileManager/index.tsx +2 -2
- package/src/SocialComponents/api/index.ts +9 -1
- package/src/index.tsx +4 -0
- package/src/types.d.ts +37 -1
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { Button, Text, View } from "../../Components/Themed"
|
|
3
|
-
import { FlatList, Image } from 'react-native';
|
|
4
|
-
import type { AthleteProps, ExternalPriceProps, LeagueProps, OrderProps, PublicPlayerProps, TeamProps } from '../../types';
|
|
3
|
+
import { ActivityIndicator, FlatList, Image } from 'react-native';
|
|
4
|
+
import type { AthleteProps, ExternalPriceProps, LeagueProps, MyPlayerProps, OrderProps, PlayerPremiumItem, PremiumItemProps, PublicPlayerProps, TeamProps } from '../../types';
|
|
5
5
|
import moment from 'moment-mini';
|
|
6
6
|
import { AthleteImage, TeamImage } from '../../Components/Jerseys';
|
|
7
7
|
import OrderGradeBar from '../../MarketComponents/components/OrderGradeBar';
|
|
8
8
|
import { MarketComponentApi, MarketComponentHelpers } from '../../MarketComponents/api';
|
|
9
9
|
import { Icons } from '../../Components';
|
|
10
10
|
import { useColors } from '../../constants/useColors';
|
|
11
|
-
import
|
|
11
|
+
import { PremiumHelpers } from '../../Premium/api';
|
|
12
|
+
import ALaCartePremium from '../../Premium/components/ALaCartePremium';
|
|
12
13
|
|
|
13
14
|
type BetMatchCardProps = {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
player?:PublicPlayerProps,
|
|
16
|
+
me?:MyPlayerProps,
|
|
16
17
|
contest_title:string,
|
|
17
18
|
time_detail:string,
|
|
18
19
|
league?:LeagueProps,
|
|
19
20
|
team?:TeamProps,
|
|
21
|
+
player_premium_items?:PlayerPremiumItem[],
|
|
22
|
+
premium_items?:PremiumItemProps[]
|
|
20
23
|
athlete?:AthleteProps,
|
|
21
24
|
order:OrderProps,
|
|
22
|
-
|
|
25
|
+
action_loading:boolean,
|
|
26
|
+
onViewPremium?:(premium_item_id?:string) => void,
|
|
27
|
+
onSelectGrade:(order:OrderProps) => void,
|
|
28
|
+
onViewPlayer:(player:PublicPlayerProps) => void,
|
|
29
|
+
onOrder:(order:OrderProps) => void,
|
|
30
|
+
onReject:(order:OrderProps) => void,
|
|
31
|
+
onPurchasePremium:(ppi:PlayerPremiumItem) => void
|
|
23
32
|
}
|
|
24
33
|
const sections = ['header', 'page', 'offer', 'details','available', 'actions']
|
|
25
|
-
const BetMatchCard = ({ order,
|
|
34
|
+
const BetMatchCard = ({ me, premium_items, player_premium_items, order, action_loading, player, contest_title, league, team, athlete, onViewPremium, onViewPlayer, onPurchasePremium, onOrder, onReject }:BetMatchCardProps) => {
|
|
26
35
|
const Colors = useColors();
|
|
27
36
|
const [ betmatch, setBetMatch ] = useState<{
|
|
28
37
|
loading:boolean,
|
|
@@ -30,14 +39,20 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
30
39
|
}>({
|
|
31
40
|
loading:false
|
|
32
41
|
})
|
|
33
|
-
const { external_price } = betmatch;
|
|
42
|
+
const { loading, external_price } = betmatch;
|
|
43
|
+
|
|
44
|
+
const premium_external_price = PremiumHelpers.getItemFromIdentifer('external_pricing', premium_items, player_premium_items);
|
|
45
|
+
const premium_order_grades = PremiumHelpers.getItemFromIdentifer('order_grades', premium_items, player_premium_items);
|
|
46
|
+
const show_external_prices = premium_external_price.player_premium_item?.status == 'active' || me?.type == 'premium' ? true : false
|
|
47
|
+
const show_grades = premium_order_grades.player_premium_item?.status == 'active' || me?.type == 'premium' ? true : false
|
|
34
48
|
|
|
35
49
|
useEffect(() => {
|
|
36
50
|
MarketComponentApi.setEnvironment();
|
|
37
51
|
getExternalPrice()
|
|
38
|
-
},[order.order_id]);
|
|
52
|
+
},[order.order_id, show_external_prices]);
|
|
39
53
|
|
|
40
54
|
const getExternalPrice = async() => {
|
|
55
|
+
if(!show_external_prices){ return }
|
|
41
56
|
setBetMatch({ loading:true });
|
|
42
57
|
let external_prices = await MarketComponentApi.getExternalPrices(order.event_type, order.event_id, order.market_id, order.side);
|
|
43
58
|
if(order.side_type == 'athlete'){
|
|
@@ -49,13 +64,15 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
49
64
|
//Find consensus!
|
|
50
65
|
let consensus_price = external_prices.find(p => p.external_name.toLowerCase() == 'consensus');
|
|
51
66
|
if(!consensus_price){ consensus_price = external_prices[0] }
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
setBetMatch({
|
|
69
|
+
loading:false,
|
|
70
|
+
external_price: consensus_price
|
|
71
|
+
})
|
|
72
|
+
}, 250);
|
|
56
73
|
}
|
|
57
74
|
|
|
58
|
-
const renderSections = (data:{ item:string, index:number }) => {
|
|
75
|
+
const renderSections = useCallback((data:{ item:string, index:number }) => {
|
|
59
76
|
switch(data.item){
|
|
60
77
|
case 'header':
|
|
61
78
|
return (
|
|
@@ -72,7 +89,7 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
72
89
|
)
|
|
73
90
|
case 'offer':
|
|
74
91
|
return (
|
|
75
|
-
<View transparent type='row' style={{ margin:
|
|
92
|
+
<View transparent type='row' style={{ margin:10 }}>
|
|
76
93
|
<View float style={{ borderRadius:100, padding:2 }}>
|
|
77
94
|
{athlete ?
|
|
78
95
|
<AthleteImage
|
|
@@ -101,8 +118,8 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
101
118
|
)
|
|
102
119
|
case 'details':
|
|
103
120
|
return (
|
|
104
|
-
<View transparent style={{ margin:
|
|
105
|
-
<View transparent type='row' style={{ padding:
|
|
121
|
+
<View transparent style={{ margin:10 }}>
|
|
122
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
106
123
|
<View transparent style={{ flex:1 }}>
|
|
107
124
|
<Text theme='description'>Offer Probability</Text>
|
|
108
125
|
<Text theme='h1' size={18} style={{ marginTop:4 }}>{(order.probability * 100).toFixed(2)}%</Text>
|
|
@@ -112,22 +129,39 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
112
129
|
<Text theme='h1' size={18} style={{ marginTop:4 }}>{MarketComponentHelpers.getOddsLabel(order.odds)}</Text>
|
|
113
130
|
</View>
|
|
114
131
|
</View>
|
|
115
|
-
{
|
|
116
|
-
<View transparent type='row' style={{ padding:
|
|
132
|
+
{show_external_prices ?
|
|
133
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
117
134
|
<View transparent style={{ flex:1 }}>
|
|
118
135
|
<Text theme='description'>External Price</Text>
|
|
119
|
-
|
|
136
|
+
{loading ?
|
|
137
|
+
<ActivityIndicator size={20} color={Colors.text.h1} style={{ alignSelf:'flex-start', marginTop:4 }} />
|
|
138
|
+
: !show_external_prices ?
|
|
139
|
+
<Text theme='error' size={14} style={{ marginTop:4 }}>{!show_external_prices ? 'External prices not enabled for account' : external_price ? external_price.external_name: 'Unable to find'}</Text>
|
|
140
|
+
:
|
|
141
|
+
<Text theme='h1' size={18} style={{ marginTop:4 }}>{external_price ? external_price.external_name: 'Unable to find'}</Text>
|
|
142
|
+
}
|
|
120
143
|
</View>
|
|
121
144
|
<View transparent style={{ flex:1 }}>
|
|
122
145
|
<Text theme='description'>Suggested Odds</Text>
|
|
123
|
-
<Text theme='h1' size={18} style={{ marginTop:4 }}>{MarketComponentHelpers.getOddsLabel(external_price.odds)}</Text>
|
|
146
|
+
<Text theme='h1' size={18} style={{ marginTop:4 }}>{external_price ? MarketComponentHelpers.getOddsLabel(external_price.odds): '...'}</Text>
|
|
124
147
|
</View>
|
|
125
148
|
</View>
|
|
149
|
+
:premium_external_price.premium_item ?
|
|
150
|
+
<ALaCartePremium
|
|
151
|
+
style={{ margin:5 }}
|
|
152
|
+
premium_item={premium_external_price.premium_item}
|
|
153
|
+
player_premium_item={premium_external_price.player_premium_item}
|
|
154
|
+
player={me}
|
|
155
|
+
identifier='external_pricing'
|
|
156
|
+
onPurchaseItem={onPurchasePremium}
|
|
157
|
+
onViewPremium={(id) => onViewPremium ? onViewPremium(id) : console.log('')}
|
|
158
|
+
/>
|
|
126
159
|
:<></>}
|
|
127
|
-
|
|
160
|
+
{show_grades ?
|
|
161
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
128
162
|
<View transparent style={{ flex:1 }}>
|
|
129
163
|
<Text theme='description'>Offer Grade</Text>
|
|
130
|
-
{!order?.grade ?
|
|
164
|
+
{!order?.grade || !show_grades ?
|
|
131
165
|
<Text style={{ marginTop:3 }} theme="h1">N/A</Text>
|
|
132
166
|
:order.grade > 105 ?
|
|
133
167
|
<Text style={{ marginTop:3 }} theme="h1" color={Colors.text.success}>Amazing Price!</Text>
|
|
@@ -140,8 +174,19 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
140
174
|
}
|
|
141
175
|
<Text theme='h1' size={18} style={{ marginTop:4 }}></Text>
|
|
142
176
|
</View>
|
|
143
|
-
<OrderGradeBar grade={order.grade} view_type='card' />
|
|
177
|
+
<OrderGradeBar mask={!show_grades} grade={order.grade} view_type='card' onSelectGrade={() => console.log('')}/>
|
|
144
178
|
</View>
|
|
179
|
+
:premium_order_grades.premium_item ?
|
|
180
|
+
<ALaCartePremium
|
|
181
|
+
style={{ margin:5 }}
|
|
182
|
+
premium_item={premium_order_grades.premium_item}
|
|
183
|
+
player_premium_item={premium_order_grades.player_premium_item}
|
|
184
|
+
player={me}
|
|
185
|
+
identifier='order_grades'
|
|
186
|
+
onPurchaseItem={onPurchasePremium}
|
|
187
|
+
onViewPremium={(id) => onViewPremium ? onViewPremium(id) : console.log('')}
|
|
188
|
+
/>
|
|
189
|
+
:<></>}
|
|
145
190
|
</View>
|
|
146
191
|
)
|
|
147
192
|
case 'available':
|
|
@@ -150,22 +195,22 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
150
195
|
<View transparent type='row' style={{ padding:15 }}>
|
|
151
196
|
<View transparent style={{ flex:1 }}>
|
|
152
197
|
<Text theme='description'>Available</Text>
|
|
153
|
-
<Text theme='h1' size={
|
|
198
|
+
<Text theme='h1' size={24} style={{ marginTop:4 }}>${order.open_amt.toFixed(2)}</Text>
|
|
154
199
|
</View>
|
|
155
200
|
<View transparent style={{ flex:1 }}>
|
|
156
201
|
<Text theme='description'>Potential Winnings</Text>
|
|
157
|
-
<Text theme='h1' size={
|
|
202
|
+
<Text theme='h1' size={24} style={{ marginTop:4 }}>${order.potential_winnings.toFixed(2)}</Text>
|
|
158
203
|
</View>
|
|
159
204
|
</View>
|
|
160
205
|
</View>
|
|
161
206
|
)
|
|
162
207
|
default: return <></>
|
|
163
208
|
}
|
|
164
|
-
}
|
|
209
|
+
}, [JSON.stringify(external_price), order.order_id])
|
|
165
210
|
|
|
166
211
|
return (
|
|
167
|
-
<View style={{ flex:1
|
|
168
|
-
<View float transparent style={{
|
|
212
|
+
<View float style={{ flex:1 }}>
|
|
213
|
+
<View float transparent style={{ marginBottom:30, flex:1 }}>
|
|
169
214
|
<View float type='footer' style={{ position:'absolute', left:0, right:0, bottom: -30, height:50, margin:0, borderRadius:8 }} />
|
|
170
215
|
<View float type='footer' style={{ position:'absolute', left:0, right:0, bottom: -15, height:50, margin:-5, borderRadius:8 }} />
|
|
171
216
|
<View transparent style={{ flex:1 }}>
|
|
@@ -177,23 +222,24 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
177
222
|
/>
|
|
178
223
|
</View>
|
|
179
224
|
<View type='footer' style={{ flexDirection:'row', padding:5 }}>
|
|
180
|
-
<Button float style={{ flex:1, marginRight:4, flexDirection:'row', justifyContent:'center', alignItems:'center' }}>
|
|
225
|
+
<Button float disabled={action_loading} loading={action_loading} style={{ flex:1, marginRight:4, flexDirection:'row', justifyContent:'center', alignItems:'center', opacity: action_loading?0.5:1 }} onPress={() => onReject(order)}>
|
|
181
226
|
<Icons.CloseIcon size={14} color={Colors.text.error}/>
|
|
182
227
|
<Text theme='h2' style={{ marginLeft:10 }} color={Colors.text.error}>Decline</Text>
|
|
183
228
|
</Button>
|
|
184
|
-
<Button float style={{ flex:1, marginLeft:4, flexDirection:'row', justifyContent:'center', alignItems:'center' }}>
|
|
229
|
+
<Button float disabled={action_loading} loading={action_loading} style={{ flex:1, marginLeft:4, flexDirection:'row', justifyContent:'center', alignItems:'center', opacity: action_loading?0.5:1 }} onPress={() => onOrder(order)}>
|
|
185
230
|
<Icons.CheckIcon size={14} color={Colors.text.success}/>
|
|
186
231
|
<Text theme='h2' style={{ marginLeft:10 }} color={Colors.text.success}>Accept</Text>
|
|
187
232
|
</Button>
|
|
188
233
|
</View>
|
|
234
|
+
{player ?
|
|
189
235
|
<View float type='footer' style={{ flexDirection:'row', alignItems:'center', borderRadius:8, margin:-10, marginTop:0, padding:10 }}>
|
|
190
|
-
<
|
|
236
|
+
<Button transparent float style={{ padding:2, borderRadius:100 }} onPress={() => onViewPlayer(player)}>
|
|
191
237
|
<Image
|
|
192
238
|
source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
193
239
|
style={{ height:40, width:40, borderRadius:100}}
|
|
194
240
|
resizeMode='cover'
|
|
195
241
|
/>
|
|
196
|
-
</
|
|
242
|
+
</Button>
|
|
197
243
|
<View transparent style={{ flex:1, marginLeft:15 }}>
|
|
198
244
|
<Text theme='h1'>@{player.username}</Text>
|
|
199
245
|
<Text theme='description' style={{ marginTop:3 }}>Joined {moment(player.create_datetime).fromNow()}</Text>
|
|
@@ -203,15 +249,8 @@ const BetMatchCard = ({ order, height, player, contest_title, league, team, athl
|
|
|
203
249
|
<Text theme='h2'>{order.region}</Text>
|
|
204
250
|
</View>
|
|
205
251
|
</View>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<Pagination
|
|
209
|
-
pages={10}
|
|
210
|
-
onNext={() => console.log('')}
|
|
211
|
-
onPrevious={() => console.log('')}
|
|
212
|
-
offset={0}
|
|
213
|
-
/>
|
|
214
|
-
</View>
|
|
252
|
+
:<></>}
|
|
253
|
+
</View>
|
|
215
254
|
</View>
|
|
216
255
|
)
|
|
217
256
|
}
|