be-components 4.2.1 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +12 -23
- package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +191 -100
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/commonjs/Competition/components/WagerPickForm.js +8 -2
- package/lib/commonjs/Competition/components/WagerPickForm.js.map +1 -1
- package/lib/commonjs/Competition/index.js +49 -9
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/Components/ConfirmationModal.js +11 -3
- package/lib/commonjs/Components/ConfirmationModal.js.map +1 -1
- package/lib/commonjs/Components/SearchBox.js +3 -1
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js +2 -0
- package/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Contest.js +39 -41
- package/lib/commonjs/MarketMaker/components/Contest.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ContestSelector.js +48 -30
- package/lib/commonjs/MarketMaker/components/ContestSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/Dashboard.js +14 -73
- package/lib/commonjs/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundOwnershipList.js +27 -30
- package/lib/commonjs/MarketMaker/components/FundOwnershipList.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundSelector.js +30 -33
- package/lib/commonjs/MarketMaker/components/FundSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/FundingRequestList.js +28 -41
- package/lib/commonjs/MarketMaker/components/FundingRequestList.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/ManageFundForm.js +1 -1
- package/lib/commonjs/MarketMaker/components/ManageFundForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/MarketSelector.js +26 -24
- package/lib/commonjs/MarketMaker/components/MarketSelector.js.map +1 -1
- package/lib/commonjs/MarketMaker/components/OrderForm.js +7 -4
- package/lib/commonjs/MarketMaker/components/OrderForm.js.map +1 -1
- package/lib/commonjs/MarketMaker/index.js +301 -227
- package/lib/commonjs/MarketMaker/index.js.map +1 -1
- package/lib/commonjs/Squares/index.js +28 -9
- package/lib/commonjs/Squares/index.js.map +1 -1
- package/lib/module/Competition/components/CompetitionLeaderboard.js +12 -23
- package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/module/Competition/components/EnterCompetitionPrompt.js +191 -100
- package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/module/Competition/components/WagerPickForm.js +8 -2
- package/lib/module/Competition/components/WagerPickForm.js.map +1 -1
- package/lib/module/Competition/index.js +49 -9
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/Components/ConfirmationModal.js +11 -3
- package/lib/module/Components/ConfirmationModal.js.map +1 -1
- package/lib/module/Components/SearchBox.js +3 -1
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/MarketComponents/components/ContestOrderStatsCard.js +2 -0
- package/lib/module/MarketComponents/components/ContestOrderStatsCard.js.map +1 -1
- package/lib/module/MarketMaker/components/Contest.js +21 -24
- package/lib/module/MarketMaker/components/Contest.js.map +1 -1
- package/lib/module/MarketMaker/components/ContestSelector.js +43 -25
- package/lib/module/MarketMaker/components/ContestSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/Dashboard.js +9 -66
- package/lib/module/MarketMaker/components/Dashboard.js.map +1 -1
- package/lib/module/MarketMaker/components/FundOwnershipList.js +19 -22
- package/lib/module/MarketMaker/components/FundOwnershipList.js.map +1 -1
- package/lib/module/MarketMaker/components/FundSelector.js +24 -27
- package/lib/module/MarketMaker/components/FundSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/FundingRequestList.js +18 -31
- package/lib/module/MarketMaker/components/FundingRequestList.js.map +1 -1
- package/lib/module/MarketMaker/components/ManageFundForm.js +1 -1
- package/lib/module/MarketMaker/components/ManageFundForm.js.map +1 -1
- package/lib/module/MarketMaker/components/MarketSelector.js +19 -17
- package/lib/module/MarketMaker/components/MarketSelector.js.map +1 -1
- package/lib/module/MarketMaker/components/OrderForm.js +7 -4
- package/lib/module/MarketMaker/components/OrderForm.js.map +1 -1
- package/lib/module/MarketMaker/index.js +298 -223
- package/lib/module/MarketMaker/index.js.map +1 -1
- package/lib/module/Squares/index.js +28 -9
- package/lib/module/Squares/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/lib/commonjs/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/lib/module/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/lib/module/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts +2 -4
- package/lib/typescript/lib/module/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/index.d.ts +1 -2
- package/lib/typescript/lib/module/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts +2 -1
- package/lib/typescript/src/Competition/components/EnterCompetitionPrompt.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts +3 -1
- package/lib/typescript/src/Competition/components/WagerPickForm.d.ts.map +1 -1
- package/lib/typescript/src/Competition/index.d.ts +2 -1
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts +2 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/src/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts +2 -1
- package/lib/typescript/src/MarketComponents/components/ContestOrderStatsCard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Contest.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/Dashboard.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundOwnershipList.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts +1 -2
- package/lib/typescript/src/MarketMaker/components/FundSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/FundingRequestList.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/ManageFundForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/src/MarketMaker/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/components/OrderForm.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/index.d.ts.map +1 -1
- package/lib/typescript/src/Squares/index.d.ts +2 -1
- package/lib/typescript/src/Squares/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/components/CompetitionLeaderboard.tsx +10 -21
- package/src/Competition/components/EnterCompetitionPrompt.tsx +98 -59
- package/src/Competition/components/WagerPickForm.tsx +4 -2
- package/src/Competition/index.tsx +33 -25
- package/src/Components/ConfirmationModal.tsx +5 -4
- package/src/Components/SearchBox.tsx +4 -2
- package/src/MarketComponents/components/ContestOrderStatsCard.tsx +3 -1
- package/src/MarketMaker/components/Contest.tsx +21 -21
- package/src/MarketMaker/components/ContestSelector.tsx +31 -22
- package/src/MarketMaker/components/Dashboard.tsx +9 -24
- package/src/MarketMaker/components/FundOwnershipList.tsx +13 -15
- package/src/MarketMaker/components/FundSelector.tsx +21 -23
- package/src/MarketMaker/components/FundingRequestList.tsx +14 -20
- package/src/MarketMaker/components/ManageFundForm.tsx +2 -2
- package/src/MarketMaker/components/MarketSelector.tsx +14 -16
- package/src/MarketMaker/components/OrderForm.tsx +6 -5
- package/src/MarketMaker/index.tsx +166 -94
- package/src/Squares/index.tsx +29 -19
|
@@ -4,9 +4,9 @@ import type { CompetitionProps, CompetitionRecordProps, CompetitionResultProps,
|
|
|
4
4
|
import { CompetitionApi, CompetitionHelpers, CompetitionResultApi } from "../api"
|
|
5
5
|
import { Icons } from "../../Components"
|
|
6
6
|
import Colors from "../../constants/colors"
|
|
7
|
-
import { view_styles } from "../../constants/styles"
|
|
8
7
|
import { Button, Text, View } from "../../Components/Themed"
|
|
9
8
|
import { useColors } from "../../constants/useColors"
|
|
9
|
+
import Pagination from "../../Components/Pagination"
|
|
10
10
|
|
|
11
11
|
type CompetitionLeaderboardProps = {
|
|
12
12
|
competition:CompetitionProps,
|
|
@@ -116,7 +116,7 @@ const CompetitionLeaderboard = ({ hidden, disable_collapse, competition, competi
|
|
|
116
116
|
if(hidden){ return <></> }
|
|
117
117
|
|
|
118
118
|
return (
|
|
119
|
-
<View float nativeID="leaderboard" style={{flex:1}}>
|
|
119
|
+
<View float nativeID="leaderboard" style={{flex:1, borderRadius: view_mode == 'full' ? 22 : undefined}}>
|
|
120
120
|
{view_mode == 'short' ?
|
|
121
121
|
<Button
|
|
122
122
|
disabled={disable_collapse}
|
|
@@ -189,28 +189,17 @@ const CompetitionLeaderboard = ({ hidden, disable_collapse, competition, competi
|
|
|
189
189
|
</View>
|
|
190
190
|
:<></>}
|
|
191
191
|
{onClose ?
|
|
192
|
-
<View style={{ padding:10,
|
|
193
|
-
<
|
|
194
|
-
{offset
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
onPress={() => getLeaderboardFromServer(competition.competition_id, offset - 1)}
|
|
200
|
-
/>
|
|
201
|
-
:<View/>}
|
|
202
|
-
<Button
|
|
203
|
-
title='NEXT'
|
|
204
|
-
title_color={Colors.brand.electric}
|
|
205
|
-
backgroundColor='transparent'
|
|
206
|
-
onPress={() => getLeaderboardFromServer(competition.competition_id, offset + 1)}
|
|
207
|
-
/>
|
|
208
|
-
</View>
|
|
192
|
+
<View type='footer' style={{ padding:10, borderBottomRightRadius:22, borderBottomLeftRadius:22 }}>
|
|
193
|
+
<Pagination
|
|
194
|
+
offset={offset}
|
|
195
|
+
onNext={() => getLeaderboardFromServer(competition.competition_id, offset+1)}
|
|
196
|
+
onPrevious={() => getLeaderboardFromServer(competition.competition_id, offset-1)}
|
|
197
|
+
|
|
198
|
+
/>
|
|
209
199
|
<Button
|
|
210
200
|
title='Close'
|
|
211
201
|
style={{ padding:15 }}
|
|
212
|
-
|
|
213
|
-
backgroundColor={Colors.utility.error}
|
|
202
|
+
type='close'
|
|
214
203
|
onPress={() => onClose()}
|
|
215
204
|
/>
|
|
216
205
|
</View>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import type { CompetitionProps, CompetitionResultTypeProps, CompetitionTypeProps, MyPlayerProps, PlayerBalanceProps } from "../../types"
|
|
3
|
-
import Colors from "../../constants/colors"
|
|
4
|
-
import { Icons } from "../../Components"
|
|
5
3
|
import { CompetitionHelpers } from "../api"
|
|
6
|
-
import { view_styles } from "../../constants/styles"
|
|
7
4
|
import moment from "moment-mini"
|
|
8
5
|
import { Button, Text, View } from "../../Components/Themed"
|
|
9
6
|
import { useColors } from "../../constants/useColors"
|
|
7
|
+
import { Image } from "react-native"
|
|
10
8
|
|
|
11
9
|
type EnterCompetitionPromptProps = {
|
|
12
10
|
player?:MyPlayerProps,
|
|
@@ -15,15 +13,40 @@ type EnterCompetitionPromptProps = {
|
|
|
15
13
|
competition_type:CompetitionTypeProps,
|
|
16
14
|
competition_result_type:CompetitionResultTypeProps,
|
|
17
15
|
width:number,
|
|
16
|
+
mode:'desktop'|'mobile',
|
|
18
17
|
onVerify: () => void
|
|
19
18
|
onCancel:() => void,
|
|
20
19
|
onEnter: (promo_balance?:boolean) => void
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
const EnterCompetitionPrompt = ({ player, player_balance, competition, competition_type, competition_result_type, onCancel, onEnter, onVerify }:EnterCompetitionPromptProps) => {
|
|
22
|
+
const EnterCompetitionPrompt = ({ player, mode, player_balance, competition, competition_type, competition_result_type, onCancel, onEnter, onVerify }:EnterCompetitionPromptProps) => {
|
|
24
23
|
const C = useColors();
|
|
25
|
-
const [ use_promo_balance, setUsePromoBalance ] = useState(false)
|
|
26
|
-
|
|
24
|
+
const [ use_promo_balance, setUsePromoBalance ] = useState(false);
|
|
25
|
+
let potential_winnings = competition.ticket_revenue
|
|
26
|
+
if(competition.promo_payout){
|
|
27
|
+
potential_winnings += competition.promo_payout
|
|
28
|
+
}
|
|
29
|
+
if(competition.guaranteed_payout){
|
|
30
|
+
if(potential_winnings < parseFloat(competition.guaranteed_payout as string)){ potential_winnings = parseFloat(competition.guaranteed_payout as string) }
|
|
31
|
+
}
|
|
32
|
+
const isBalanceEnough = () => {
|
|
33
|
+
if(!player_balance){ return false }
|
|
34
|
+
let buy_in = parseFloat(competition.buy_in as string);
|
|
35
|
+
switch(competition.market_type){
|
|
36
|
+
case 'FREE':
|
|
37
|
+
if(player_balance.free_market_balance < buy_in){ return false }
|
|
38
|
+
return true
|
|
39
|
+
case 'FOR_MONEY':
|
|
40
|
+
if(use_promo_balance){
|
|
41
|
+
if(player_balance.promo_balance < buy_in){ return false }
|
|
42
|
+
return true
|
|
43
|
+
}
|
|
44
|
+
if(player_balance.balance < buy_in){ return false }
|
|
45
|
+
return true
|
|
46
|
+
default: return false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const balance_enough = isBalanceEnough();
|
|
27
50
|
|
|
28
51
|
useEffect(() => {
|
|
29
52
|
if(!player){ return }
|
|
@@ -32,66 +55,52 @@ const EnterCompetitionPrompt = ({ player, player_balance, competition, competiti
|
|
|
32
55
|
const requires_verification = player && parseInt(competition?.buy_in as string ?? 0) > 0 && competition?.market_type == 'FOR_MONEY' && player?.vouched_status != 'verified' ? true : false
|
|
33
56
|
const cl = competition.market_type == 'FOR_MONEY'?'$':'E'
|
|
34
57
|
return (
|
|
35
|
-
<View float style={{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
:
|
|
48
|
-
<Icons.EyeOnIcon color={Colors.brand.midnight} size={14}/>
|
|
49
|
-
}
|
|
50
|
-
</View>
|
|
58
|
+
<View float style={mode=='desktop'?{borderRadius:22, width:400 }:{ borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
59
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
60
|
+
<Image
|
|
61
|
+
source={{ uri: competition.image?.url }}
|
|
62
|
+
style={{ height:40, width:40, borderRadius:4 }}
|
|
63
|
+
/>
|
|
64
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
65
|
+
<Text theme="h1">{competition.competition_name}</Text>
|
|
66
|
+
<Text theme="description" style={{ marginTop:3 }}>{competition.competition_description}</Text>
|
|
67
|
+
</View>
|
|
68
|
+
<View transparent style={{ padding:10, marginRight:4, backgroundColor: CompetitionHelpers.getCompColors(competition_type.type).borderColor, borderRadius:4 }}>
|
|
69
|
+
<Text size={12} theme="h2" color={C.text.white}>{competition_type.type_label}</Text>
|
|
51
70
|
</View>
|
|
52
|
-
:<></>}
|
|
53
|
-
<Text size={14} theme="h2" textAlign="center">{competition.competition_name}</Text>
|
|
54
71
|
</View>
|
|
55
72
|
<View transparent>
|
|
56
|
-
<Text style={{ marginTop:5 }} theme="description" textAlign="center">{moment(competition.scheduled_datetime).format('MMM DD - hh:mm a')}</Text>
|
|
57
|
-
{competition.competition_description ?
|
|
58
|
-
<Text style={{ marginTop:5 }} theme="description" textAlign="center">{competition.competition_description}</Text>
|
|
59
|
-
:<></>}
|
|
60
73
|
{competition_result_type ?
|
|
61
|
-
<
|
|
74
|
+
<View type='row' style={{ padding:5, paddingLeft:15, paddingRight:15 }}>
|
|
75
|
+
<Text style={{ flex:1 }} theme="h2">Payout Type</Text>
|
|
76
|
+
<Text theme="h1">{competition_result_type.label}</Text>
|
|
77
|
+
</View>
|
|
62
78
|
:<></>}
|
|
63
79
|
{competition_type?.type == 'pick' ?
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<Text style={{ marginTop:5 }} theme="description" textAlign="center">Entries: {competition.tickets_sold}/{competition.available_tickets}</Text>
|
|
69
|
-
</View>
|
|
70
|
-
<View transparent nativeID="pick_actions" style={{ flexDirection:'row', padding:10 }}>
|
|
71
|
-
<Button
|
|
72
|
-
style={{ flex:1, marginRight:3 }}
|
|
73
|
-
type='close'
|
|
74
|
-
title="Cancel"
|
|
75
|
-
onPress={() => onCancel()}
|
|
76
|
-
/>
|
|
77
|
-
{requires_verification ?
|
|
78
|
-
<Button
|
|
79
|
-
style={{ flex:2, marginLeft:2 }}
|
|
80
|
-
title={`Verify My Account`}
|
|
81
|
-
type='success'
|
|
82
|
-
onPress={() => onVerify()}
|
|
83
|
-
/>
|
|
80
|
+
<View type='row' style={{padding:5, paddingLeft:15, paddingRight:15}}>
|
|
81
|
+
<Text style={{ flex:1 }} theme="h2">Number of Picks</Text>
|
|
82
|
+
<Text theme="h1">{competition.max_pick_count}</Text>
|
|
83
|
+
</View>
|
|
84
84
|
:
|
|
85
|
-
|
|
86
|
-
style={{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
onPress={() => onEnter(use_promo_balance)}
|
|
90
|
-
/>
|
|
85
|
+
<View type='row' style={{padding:5, paddingLeft:15, paddingRight:15}}>
|
|
86
|
+
<Text style={{ flex:1 }} theme="h2">Starting Balance</Text>
|
|
87
|
+
<Text theme="h1">{competition.initial_balance}</Text>
|
|
88
|
+
</View>
|
|
91
89
|
}
|
|
90
|
+
<View type='row' style={{padding:5, paddingLeft:15, paddingRight:15}}>
|
|
91
|
+
<Text style={{ flex:1 }} theme="h2">Available Tickets</Text>
|
|
92
|
+
<Text theme="h1">{parseFloat(competition.available_tickets as string) - competition.tickets_sold}</Text>
|
|
93
|
+
</View>
|
|
94
|
+
<View style={{ backgroundColor:C.views.liquidMarket }}>
|
|
95
|
+
<View transparent type='row' style={{ padding:5, paddingLeft:15, paddingRight:15}}>
|
|
96
|
+
<Text style={{ flex:1 }} theme="h2">Total Payout*</Text>
|
|
97
|
+
<Text theme="h1">{cl}{potential_winnings.toFixed()}</Text>
|
|
98
|
+
</View>
|
|
99
|
+
<Text style={{ padding:5, paddingLeft:15, paddingRight:15 }} theme="description">* Payout is always number of entries * ticket price (We take NO FEES on competitions). We may guarantee a minimum payout which will increase as more entries come in.</Text>
|
|
100
|
+
</View>
|
|
92
101
|
</View>
|
|
93
|
-
{player_balance && player_balance.promo_balance
|
|
94
|
-
<Button style={{ backgroundColor:C.text.gold, padding:10, flexDirection:'row', alignItems:'center' }} onPress={() => {
|
|
102
|
+
{player_balance && player_balance.promo_balance >= parseFloat(competition.buy_in as string) ?
|
|
103
|
+
<Button style={{ margin:10, backgroundColor:C.text.gold, padding:10, flexDirection:'row', alignItems:'center' }} onPress={() => {
|
|
95
104
|
if(use_promo_balance){
|
|
96
105
|
//Remove promo balance and open_amt
|
|
97
106
|
setUsePromoBalance(false);
|
|
@@ -105,12 +114,42 @@ const EnterCompetitionPrompt = ({ player, player_balance, competition, competiti
|
|
|
105
114
|
:<></>}
|
|
106
115
|
</View>
|
|
107
116
|
<View transparent>
|
|
108
|
-
<Text size={14} theme="h1">${player_balance?.promo_balance} Promotion Available</Text>
|
|
109
|
-
<Text style={{ marginTop:2}} theme="description">Press / Click here to use promo balance</Text>
|
|
117
|
+
<Text size={14} theme="h1" color={C.text.white}>${player_balance?.promo_balance} Promotion Available</Text>
|
|
118
|
+
<Text style={{ marginTop:2}} color={C.text.white} theme="description">Press / Click here to use promo balance</Text>
|
|
110
119
|
</View>
|
|
111
120
|
|
|
112
121
|
</Button>
|
|
113
122
|
:<></>}
|
|
123
|
+
<View type='footer' style={{ borderBottomRightRadius:22, borderBottomLeftRadius:22 }}>
|
|
124
|
+
<View transparent style={{ flexDirection:'row', padding:10 }}>
|
|
125
|
+
<Button
|
|
126
|
+
style={{ flex:1, marginRight:3 }}
|
|
127
|
+
type='close'
|
|
128
|
+
title="Cancel"
|
|
129
|
+
onPress={() => onCancel()}
|
|
130
|
+
/>
|
|
131
|
+
{requires_verification ?
|
|
132
|
+
<Button
|
|
133
|
+
style={{ flex:2, marginLeft:2 }}
|
|
134
|
+
title={`Verify My Account`}
|
|
135
|
+
type='success'
|
|
136
|
+
onPress={() => onVerify()}
|
|
137
|
+
/>
|
|
138
|
+
:
|
|
139
|
+
<Button
|
|
140
|
+
style={{ flexGrow:2, marginLeft:2, opacity:balance_enough?1:0.5 }}
|
|
141
|
+
disabled={!balance_enough}
|
|
142
|
+
title={`Enter Competition${competition.buy_in == 0 ? ``:` ${cl}${competition.buy_in}`}`}
|
|
143
|
+
type='success'
|
|
144
|
+
onPress={() => onEnter(use_promo_balance)}
|
|
145
|
+
/>
|
|
146
|
+
}
|
|
147
|
+
</View>
|
|
148
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
149
|
+
<Text style={{ flex:1 }}>Join Until</Text>
|
|
150
|
+
<Text theme="h1">{moment(competition.scheduled_datetime).format('MMM DD - hh:mm a')}</Text>
|
|
151
|
+
</View>
|
|
152
|
+
</View>
|
|
114
153
|
</View>
|
|
115
154
|
)
|
|
116
155
|
}
|
|
@@ -12,13 +12,15 @@ type WagerPickFormProps = {
|
|
|
12
12
|
event_start:string,
|
|
13
13
|
player_pick: PlayerPickProps,
|
|
14
14
|
loading?:string,
|
|
15
|
+
mode:'desktop'|'mobile',
|
|
16
|
+
padding_bottom?:number,
|
|
15
17
|
onFocusPosition?:(pos:FocusPositionProps) => void,
|
|
16
18
|
width:number,
|
|
17
19
|
onCancel: () => void,
|
|
18
20
|
onSubmit: (pp:PlayerPickProps) => void
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
const WagerPickForm = ({ player_pick, event_title, balance, event_start, loading, onCancel, onFocusPosition, onSubmit }:WagerPickFormProps) => {
|
|
23
|
+
const WagerPickForm = ({ player_pick, mode, event_title, balance, event_start, padding_bottom, loading, onCancel, onFocusPosition, onSubmit }:WagerPickFormProps) => {
|
|
22
24
|
const C = useColors();
|
|
23
25
|
const [ reviewed, setReviewed ] = useState(false);
|
|
24
26
|
const [ wager, setWager ] = useState({ stake:0, stake_label: '0', potential_winnings: 0 });
|
|
@@ -40,7 +42,7 @@ const WagerPickForm = ({ player_pick, event_title, balance, event_start, loading
|
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
return (
|
|
43
|
-
<View float style={{ borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
45
|
+
<View float style={mode=='desktop' ?{borderRadius:22, width:500}:{ borderTopRightRadius:22, borderTopLeftRadius:22, paddingBottom:padding_bottom }}>
|
|
44
46
|
<View transparent nativeID="event_info" style={{ padding:20 }}>
|
|
45
47
|
<Text size={14} theme="h2" weight='bold' textAlign="center">{moment(event_start).format('MM/DD @ hh:mm a')}</Text>
|
|
46
48
|
<Text style={{ marginTop:5 }} size={14} theme="h2" weight='bold' textAlign="center">{event_title}</Text>
|
|
@@ -18,6 +18,7 @@ import { useColors } from '../constants/useColors';
|
|
|
18
18
|
type CompetitionModuleProps = {
|
|
19
19
|
player_id?:string,
|
|
20
20
|
competition_id:string,
|
|
21
|
+
view_mode:'desktop'|'mobile',
|
|
21
22
|
insets?:{ top:number, bottom:number, left:number, right:number }
|
|
22
23
|
confirm_padding?:number,
|
|
23
24
|
onFocusPosition?:(position:FocusPositionProps) => void,
|
|
@@ -32,7 +33,7 @@ type CompetitionModuleProps = {
|
|
|
32
33
|
|
|
33
34
|
const competition_sections = ['header','join','test','details','leaderboard','play']
|
|
34
35
|
|
|
35
|
-
const CompetitionModule = ({ competition_id, insets, player_id, confirm_padding, onManageCompetition, onFocusPosition, onRequestAuthentication, onShareCompetition, onClose, onViewCompetitionSeason }:CompetitionModuleProps) => {
|
|
36
|
+
const CompetitionModule = ({ competition_id, view_mode, insets, player_id, confirm_padding, onManageCompetition, onFocusPosition, onRequestAuthentication, onShareCompetition, onClose, onViewCompetitionSeason }:CompetitionModuleProps) => {
|
|
36
37
|
const C = useColors();
|
|
37
38
|
const [ active_tab, setActiveTab ] = useState('play');
|
|
38
39
|
const [ viewing_leader, setViewingLeader ] = useState<PublicPlayerProps|undefined>();
|
|
@@ -533,7 +534,8 @@ const CompetitionModule = ({ competition_id, insets, player_id, confirm_padding,
|
|
|
533
534
|
</View>
|
|
534
535
|
:<></>}
|
|
535
536
|
{show_full_leaderboard ?
|
|
536
|
-
<View type='blur' style={{ position:'absolute', bottom:0, left:0, right:0, top:0 }}>
|
|
537
|
+
<View type='blur' style={view_mode=='desktop'?{position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center'}:{ position:'absolute', bottom:0, left:0, right:0, top:0 }}>
|
|
538
|
+
<View style={view_mode=='desktop'?{ width:500, height:676, borderRadius:22 }:{flex:1}}>
|
|
537
539
|
<CompetitionLeaderboard
|
|
538
540
|
competition={competition}
|
|
539
541
|
competition_type={competition_type}
|
|
@@ -544,13 +546,15 @@ const CompetitionModule = ({ competition_id, insets, player_id, confirm_padding,
|
|
|
544
546
|
onClose={() => setShowFullLeaderboard(false)}
|
|
545
547
|
onSeeFull={() => setShowFullLeaderboard(!show_full_leaderboard)}
|
|
546
548
|
viewer_id={player_id}
|
|
547
|
-
/>
|
|
549
|
+
/>
|
|
550
|
+
</View>
|
|
548
551
|
</View>
|
|
549
552
|
:<></>}
|
|
550
553
|
<View style={{ position:'absolute' }}>
|
|
551
554
|
<ConfirmationModal
|
|
552
555
|
visible={nav_out.visible}
|
|
553
556
|
title={nav_out.title}
|
|
557
|
+
mode={view_mode}
|
|
554
558
|
padding_bottom={confirm_padding}
|
|
555
559
|
confirm_title={'Edit My Picks'}
|
|
556
560
|
cancel_title='Close'
|
|
@@ -565,16 +569,17 @@ const CompetitionModule = ({ competition_id, insets, player_id, confirm_padding,
|
|
|
565
569
|
transparent
|
|
566
570
|
visible={draft_player_pick.draft_pick ? true : false}
|
|
567
571
|
onRequestClose={() => setShowEnterPrompt(false)}
|
|
568
|
-
animationType='slide'
|
|
572
|
+
animationType={view_mode=='desktop' ? 'fade' : 'slide'}
|
|
569
573
|
>
|
|
570
574
|
<View
|
|
571
575
|
style={{ flex:1 }}
|
|
572
576
|
>
|
|
573
|
-
<View type='blur' style={{ flex:1, justifyContent:'flex-end', paddingTop:insets?.top, paddingBottom:insets?.bottom }}>
|
|
577
|
+
<View type='blur' style={view_mode=='desktop'?{ flex:1, justifyContent:'center', alignItems:'center' }:{ flex:1, justifyContent:'flex-end', paddingTop:insets?.top, paddingBottom:insets?.bottom }}>
|
|
574
578
|
<WagerPickForm
|
|
575
579
|
event_start={draft_player_pick.event_start ?? ''}
|
|
576
580
|
event_title={draft_player_pick.event_title ?? ''}
|
|
577
581
|
width={module_size.width}
|
|
582
|
+
mode={view_mode}
|
|
578
583
|
onFocusPosition={onFocusPosition}
|
|
579
584
|
balance={authenticated_competition_player?.wager_based_balance ?? 0}
|
|
580
585
|
loading={pick_loading}
|
|
@@ -590,15 +595,16 @@ const CompetitionModule = ({ competition_id, insets, player_id, confirm_padding,
|
|
|
590
595
|
transparent
|
|
591
596
|
visible={show_enter_prompt}
|
|
592
597
|
onRequestClose={() => setShowEnterPrompt(false)}
|
|
593
|
-
animationType='slide'
|
|
594
|
-
|
|
595
|
-
|
|
598
|
+
animationType={view_mode=='desktop' ? 'fade' : 'slide'}
|
|
599
|
+
>
|
|
600
|
+
<View type='blur' style={view_mode=='desktop'?{ flex:1, justifyContent:'center', alignItems:'center' }:{ flex:1, justifyContent:'flex-end', paddingTop:insets?.top, paddingBottom:insets?.bottom }}>
|
|
596
601
|
<EnterCompetitionPrompt
|
|
597
602
|
competition={competition}
|
|
598
603
|
competition_result_type={competition_result_type}
|
|
599
604
|
competition_type={competition_type}
|
|
600
605
|
player_balance={player_balance}
|
|
601
606
|
player={player}
|
|
607
|
+
mode={view_mode}
|
|
602
608
|
width={module_size.width}
|
|
603
609
|
onCancel={() => setShowEnterPrompt(false)}
|
|
604
610
|
onEnter={(promo_balance) => handleEnterCompetition(promo_balance)}
|
|
@@ -612,24 +618,26 @@ const CompetitionModule = ({ competition_id, insets, player_id, confirm_padding,
|
|
|
612
618
|
transparent
|
|
613
619
|
visible={viewing_leader ? true : false}
|
|
614
620
|
onRequestClose={() => setShowEnterPrompt(false)}
|
|
615
|
-
animationType='slide'
|
|
621
|
+
animationType={view_mode=='desktop' ? 'fade' : 'slide'}
|
|
616
622
|
>
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
623
|
+
<View type='blur' style={view_mode=='desktop'?{ flex:1, justifyContent:'center', alignItems:'center' }:{ flex:1, justifyContent:'flex-end', paddingTop:insets?.top, paddingBottom:insets?.bottom }}>
|
|
624
|
+
<View style={view_mode == 'desktop' ? { width:500, height:676 } : { flex:1 }}>
|
|
625
|
+
<LeaderPicks
|
|
626
|
+
competition={competition}
|
|
627
|
+
leader={viewing_leader}
|
|
628
|
+
competition_matches={competition_matches}
|
|
629
|
+
competition_match_markets={competition_match_markets}
|
|
630
|
+
markets={markets}
|
|
631
|
+
events={events}
|
|
632
|
+
tournaments={tournaments}
|
|
633
|
+
matches={matches}
|
|
634
|
+
athletes={athletes}
|
|
635
|
+
teams={teams}
|
|
636
|
+
competition_type={competition_type}
|
|
637
|
+
onClose={() => setViewingLeader(undefined)}
|
|
638
|
+
/>
|
|
639
|
+
</View>
|
|
640
|
+
</View>
|
|
633
641
|
</Modal>
|
|
634
642
|
{competition.status == 'inactive' ?
|
|
635
643
|
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
|
|
@@ -6,6 +6,7 @@ import { Button, Text, View } from './Themed';
|
|
|
6
6
|
type ConfirmationModalProps = {
|
|
7
7
|
visible:boolean,
|
|
8
8
|
title?:string,
|
|
9
|
+
mode: 'desktop'|'mobile',
|
|
9
10
|
description?:string,
|
|
10
11
|
confirm_title?:string,
|
|
11
12
|
padding_bottom?:number,
|
|
@@ -14,16 +15,16 @@ type ConfirmationModalProps = {
|
|
|
14
15
|
onCancel?: () => void,
|
|
15
16
|
onConfirm: () => void
|
|
16
17
|
}
|
|
17
|
-
const ConfirmationModal = ({ visible, title, padding_bottom, image, description, confirm_title, cancel_title, onCancel, onConfirm }:ConfirmationModalProps) => {
|
|
18
|
+
const ConfirmationModal = ({ visible, mode, title, padding_bottom, image, description, confirm_title, cancel_title, onCancel, onConfirm }:ConfirmationModalProps) => {
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<Modal
|
|
21
22
|
visible={visible}
|
|
22
|
-
animationType='slide'
|
|
23
|
+
animationType={mode=='desktop' ? 'fade' : 'slide'}
|
|
23
24
|
transparent
|
|
24
25
|
style={{ flex:1 }}>
|
|
25
|
-
<View type='blur' style={{ flex:1, justifyContent:'flex-end', paddingBottom:padding_bottom }}>
|
|
26
|
-
<View float style={{ borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
26
|
+
<View type='blur' style={mode=='desktop' ?{ flex:1, justifyContent:'center', alignItems:'center' }:{ flex:1, justifyContent:'flex-end', paddingBottom:padding_bottom }}>
|
|
27
|
+
<View float style={mode=='desktop'?{width:500, borderRadius:22}:{ borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
27
28
|
<View type='header' style={{ padding:20, borderTopRightRadius:22, borderTopLeftRadius:22 }}>
|
|
28
29
|
<Text theme='h1'>{title ?? 'Are you sure?'}</Text>
|
|
29
30
|
</View>
|
|
@@ -8,10 +8,11 @@ type SearchBoxProps = {
|
|
|
8
8
|
onChange? : (text:string) => void,
|
|
9
9
|
hide_search_button?:boolean,
|
|
10
10
|
placeholder?: string,
|
|
11
|
-
style?:any
|
|
11
|
+
style?:any,
|
|
12
|
+
button_style?:any
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const SearchBox = ({ placeholder, onSearch, onChange, hide_search_button, style }:SearchBoxProps) => {
|
|
15
|
+
const SearchBox = ({ placeholder, onSearch, onChange, hide_search_button, style, button_style }:SearchBoxProps) => {
|
|
15
16
|
const [ search_value, setSearchValue ] = useState('');
|
|
16
17
|
const Colors = useColors();
|
|
17
18
|
const handleSearch = () => {
|
|
@@ -42,6 +43,7 @@ const SearchBox = ({ placeholder, onSearch, onChange, hide_search_button, style
|
|
|
42
43
|
{!hide_search_button ?
|
|
43
44
|
<Button
|
|
44
45
|
title="Search"
|
|
46
|
+
style={button_style}
|
|
45
47
|
type='info'
|
|
46
48
|
onPress={() => handleSearch()}
|
|
47
49
|
/>
|
|
@@ -12,13 +12,14 @@ type ContestOrderStatsCardProps = {
|
|
|
12
12
|
contest_title:string,
|
|
13
13
|
league?:LeagueProps,
|
|
14
14
|
hedges:HedgeProps[],
|
|
15
|
+
view_mode?:'desktop'|'mobile',
|
|
15
16
|
market_type:'FOR_MONEY'|'FREE',
|
|
16
17
|
contest_time_detail:string,
|
|
17
18
|
onPress: (player_order_stat:OrderStatsProps) => void,
|
|
18
19
|
onOrdersUpdate: (orders:OrderProps[]) => void
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const ContestOrderStatsCard = ({ player_order_stat, league, market_type, contest_time_detail, hedges, contest_title, onPress, onOrdersUpdate }:ContestOrderStatsCardProps) => {
|
|
22
|
+
const ContestOrderStatsCard = ({ player_order_stat, view_mode, league, market_type, contest_time_detail, hedges, contest_title, onPress, onOrdersUpdate }:ContestOrderStatsCardProps) => {
|
|
22
23
|
const [ confirm_data, setConfirmData ] = useState<{
|
|
23
24
|
visible:boolean,
|
|
24
25
|
title?:string,
|
|
@@ -134,6 +135,7 @@ const ContestOrderStatsCard = ({ player_order_stat, league, market_type, contest
|
|
|
134
135
|
<ConfirmationModal
|
|
135
136
|
visible={confirm_data.visible}
|
|
136
137
|
title={confirm_data.title}
|
|
138
|
+
mode={view_mode ?? 'mobile'}
|
|
137
139
|
description={confirm_data.description}
|
|
138
140
|
confirm_title={confirm_data.confirm_title}
|
|
139
141
|
cancel_title={confirm_data.cancel_title}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image, FlatList } from 'react-native';
|
|
3
3
|
import type { AthleteProps, BestAvailableOrderProps, EventProps, ExternalPriceProps, FundOrderProps, FundProps, LeagueProps, MarketProps, MatchProps, OrderProps, TournamentProps, TradeProps } from '../../types';
|
|
4
|
-
import { view_styles } from '../../constants/styles';
|
|
5
|
-
import { Text } from '../../Components';
|
|
6
4
|
import ContestMarket from './ContestMarkets';
|
|
7
5
|
import { MarketMaketHelpers } from '../api';
|
|
8
|
-
import
|
|
6
|
+
//import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
9
8
|
|
|
10
9
|
type ContestProps = {
|
|
11
10
|
fund:FundProps,
|
|
@@ -32,6 +31,7 @@ type ContestProps = {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
const Contest = ({ fund, init_show_detail, contest_id, time_detail, event, external_prices, backup_prices, tournament, match, contest_type, league, contest_title, best_available_orders, latest_trades, orders, fund_orders, markets, onSetMarket, onClearMarket, onOrder }:ContestProps) => {
|
|
34
|
+
//const Colors = useColors();
|
|
35
35
|
const [ show_detail, setShowDetail ] = useState(init_show_detail ? true : false);
|
|
36
36
|
const [ viewing_markets, setViewingMarkets ] = useState<MarketProps[]>([])
|
|
37
37
|
|
|
@@ -57,7 +57,7 @@ const Contest = ({ fund, init_show_detail, contest_id, time_detail, event, exter
|
|
|
57
57
|
let backup_market_prices = backup_prices ? backup_prices.filter(p => p.market_id == data.item.market_id) : []
|
|
58
58
|
const { unique_var_1, default_var_1 } = MarketMaketHelpers.getAvailableVar1s(market_orders, market_available_orders, market_prices, data.item, backup_market_prices);
|
|
59
59
|
return (
|
|
60
|
-
<View style={{ borderBottomWidth:1
|
|
60
|
+
<View style={{ borderBottomWidth:1 }}>
|
|
61
61
|
<ContestMarket
|
|
62
62
|
fund={fund}
|
|
63
63
|
contest_id={contest_id}
|
|
@@ -95,8 +95,8 @@ const Contest = ({ fund, init_show_detail, contest_id, time_detail, event, exter
|
|
|
95
95
|
*/
|
|
96
96
|
|
|
97
97
|
return (
|
|
98
|
-
<View style={{
|
|
99
|
-
<
|
|
98
|
+
<View style={{ margin:5, borderWidth:1, padding:0 }}>
|
|
99
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:4 }} onPress={() => setShowDetail(!show_detail)}>
|
|
100
100
|
<View style={{}}>
|
|
101
101
|
{league ?
|
|
102
102
|
<Image
|
|
@@ -107,23 +107,23 @@ const Contest = ({ fund, init_show_detail, contest_id, time_detail, event, exter
|
|
|
107
107
|
:<></>}
|
|
108
108
|
</View>
|
|
109
109
|
<View style={{ flex:1, padding:8, justifyContent:'center' }}>
|
|
110
|
-
<Text size={14}
|
|
111
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
110
|
+
<Text size={14} theme='h1'>{contest_title}</Text>
|
|
111
|
+
<Text style={{ marginTop:3 }} size={12} theme='h2'>{time_detail}</Text>
|
|
112
112
|
</View>
|
|
113
113
|
|
|
114
|
-
<View style={{ marginLeft:10, padding:5,
|
|
115
|
-
<Text size={12}
|
|
116
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
114
|
+
<View style={{ marginLeft:10, padding:5, borderRadius:4 }}>
|
|
115
|
+
<Text size={12} theme='h1' textAlign='center' weight='bold'>{[].length}</Text>
|
|
116
|
+
<Text style={{ marginTop:3 }} size={12} theme='description' textAlign='center' weight='bold'>Markets</Text>
|
|
117
117
|
</View>
|
|
118
|
-
<View style={{ marginLeft:10, padding:5,
|
|
119
|
-
<Text size={12}
|
|
120
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
118
|
+
<View style={{ marginLeft:10, padding:5, borderRadius:4 }}>
|
|
119
|
+
<Text size={12} theme='h1' textAlign='center' weight='bold'>${stake_amt.toFixed(2)}</Text>
|
|
120
|
+
<Text style={{ marginTop:3 }} size={12} theme='h1' textAlign='center' weight='bold'>Position</Text>
|
|
121
121
|
</View>
|
|
122
122
|
<View style={{ marginLeft:10, padding:5}}>
|
|
123
|
-
<Text size={12}
|
|
124
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
123
|
+
<Text size={12} theme='h1' textAlign='center' weight='bold'>${net_hedge.toFixed(2)}</Text>
|
|
124
|
+
<Text style={{ marginTop:3 }} size={12} theme='description' textAlign='center' weight='bold'>Hedge</Text>
|
|
125
125
|
</View>
|
|
126
|
-
</
|
|
126
|
+
</Button>
|
|
127
127
|
{show_detail ?
|
|
128
128
|
<View>
|
|
129
129
|
<FlatList
|
|
@@ -137,12 +137,12 @@ const Contest = ({ fund, init_show_detail, contest_id, time_detail, event, exter
|
|
|
137
137
|
keyExtractor={(item) => item.toString()}
|
|
138
138
|
/>
|
|
139
139
|
{other_markets.length > 0 ?
|
|
140
|
-
<View style={{
|
|
140
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center' }}>
|
|
141
141
|
{other_markets.map(m => {
|
|
142
142
|
return (
|
|
143
|
-
<
|
|
143
|
+
<Button onPress={() => setViewingMarkets(viewing_markets.filter(vm => vm.market_id != m.market_id).concat(m))}>
|
|
144
144
|
<Text>{m.type == 'Stat' ? m.stat_label : m.type}</Text>
|
|
145
|
-
</
|
|
145
|
+
</Button>
|
|
146
146
|
)
|
|
147
147
|
})}
|
|
148
148
|
</View>
|