be-components 1.4.9 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Competition/api/index.js +15 -0
- package/lib/commonjs/Competition/api/index.js.map +1 -1
- package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +1 -1
- package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -1
- package/lib/commonjs/Competition/components/SeasonCard.js +61 -0
- package/lib/commonjs/Competition/components/SeasonCard.js.map +1 -0
- package/lib/commonjs/Competition/index.js +23 -3
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/CompetitionManager/api/index.js +3 -5
- package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +1 -61
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +6 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +4 -0
- package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CreateCompetitionForm.js +37 -3
- package/lib/commonjs/CompetitionManager/components/CreateCompetitionForm.js.map +1 -1
- package/lib/commonjs/CompetitionSeason/api/index.js +134 -0
- package/lib/commonjs/CompetitionSeason/api/index.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/CompetitionsSection.js +127 -0
- package/lib/commonjs/CompetitionSeason/components/CompetitionsSection.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/EnterSeasonPrompt.js +253 -0
- package/lib/commonjs/CompetitionSeason/components/EnterSeasonPrompt.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonHeader.js +126 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonHeader.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonLeaderboard.js +324 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonLeaderboard.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonSettingsSection.js +175 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonSettingsSection.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/index.js +278 -0
- package/lib/commonjs/CompetitionSeason/index.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/api/index.js +182 -0
- package/lib/commonjs/CompetitionSeasonManager/api/index.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionSelector.js +2 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionSelector.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionsForm.js +153 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionsForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CreateSeasonForm.js +388 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CreateSeasonForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonHeader.js +108 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonHeader.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonInfoForm.js +242 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonInfoForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonSettingsForm.js +352 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonSettingsForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/index.js +190 -0
- package/lib/commonjs/CompetitionSeasonManager/index.js.map +1 -0
- package/lib/commonjs/Components/Switch.js +3 -0
- package/lib/commonjs/Components/Switch.js.map +1 -1
- package/lib/commonjs/Engage/api/index.js +25 -0
- package/lib/commonjs/Engage/api/index.js.map +1 -1
- package/lib/commonjs/Engage/components/SeasonCard.js +78 -0
- package/lib/commonjs/Engage/components/SeasonCard.js.map +1 -0
- package/lib/commonjs/Engage/index.js +52 -1
- package/lib/commonjs/Engage/index.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Competition/api/index.js +15 -0
- package/lib/module/Competition/api/index.js.map +1 -1
- package/lib/module/Competition/components/CompetitionSeasonCard.js +1 -1
- package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -1
- package/lib/module/Competition/components/SeasonCard.js +54 -0
- package/lib/module/Competition/components/SeasonCard.js.map +1 -0
- package/lib/module/Competition/index.js +23 -3
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/CompetitionManager/api/index.js +3 -5
- package/lib/module/CompetitionManager/api/index.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +1 -63
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +6 -1
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/ContestSettingsForm.js +4 -0
- package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/CreateCompetitionForm.js +37 -3
- package/lib/module/CompetitionManager/components/CreateCompetitionForm.js.map +1 -1
- package/lib/module/CompetitionSeason/api/index.js +128 -0
- package/lib/module/CompetitionSeason/api/index.js.map +1 -0
- package/lib/module/CompetitionSeason/components/CompetitionsSection.js +118 -0
- package/lib/module/CompetitionSeason/components/CompetitionsSection.js.map +1 -0
- package/lib/module/CompetitionSeason/components/EnterSeasonPrompt.js +244 -0
- package/lib/module/CompetitionSeason/components/EnterSeasonPrompt.js.map +1 -0
- package/lib/module/CompetitionSeason/components/SeasonHeader.js +119 -0
- package/lib/module/CompetitionSeason/components/SeasonHeader.js.map +1 -0
- package/lib/module/CompetitionSeason/components/SeasonLeaderboard.js +315 -0
- package/lib/module/CompetitionSeason/components/SeasonLeaderboard.js.map +1 -0
- package/lib/module/CompetitionSeason/components/SeasonSettingsSection.js +166 -0
- package/lib/module/CompetitionSeason/components/SeasonSettingsSection.js.map +1 -0
- package/lib/module/CompetitionSeason/index.js +269 -0
- package/lib/module/CompetitionSeason/index.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/api/index.js +176 -0
- package/lib/module/CompetitionSeasonManager/api/index.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionSelector.js +2 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionSelector.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionsForm.js +144 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionsForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/CreateSeasonForm.js +379 -0
- package/lib/module/CompetitionSeasonManager/components/CreateSeasonForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonHeader.js +101 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonHeader.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonInfoForm.js +233 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonInfoForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonSettingsForm.js +343 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonSettingsForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/index.js +181 -0
- package/lib/module/CompetitionSeasonManager/index.js.map +1 -0
- package/lib/module/Components/Switch.js +3 -0
- package/lib/module/Components/Switch.js.map +1 -1
- package/lib/module/Engage/api/index.js +25 -0
- package/lib/module/Engage/api/index.js.map +1 -1
- package/lib/module/Engage/components/SeasonCard.js +71 -0
- package/lib/module/Engage/components/SeasonCard.js.map +1 -0
- package/lib/module/Engage/index.js +52 -1
- package/lib/module/Engage/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/Competition/api/index.d.ts +1 -0
- package/lib/typescript/src/Competition/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/SeasonCard.d.ts +10 -0
- package/lib/typescript/src/Competition/components/SeasonCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/index.d.ts +3 -2
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/api/index.d.ts +1 -1
- package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CreateCompetitionForm.d.ts +3 -2
- package/lib/typescript/src/CompetitionManager/components/CreateCompetitionForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionSeason/api/index.d.ts +41 -0
- package/lib/typescript/src/CompetitionSeason/api/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/CompetitionsSection.d.ts +14 -0
- package/lib/typescript/src/CompetitionSeason/components/CompetitionsSection.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/EnterSeasonPrompt.d.ts +16 -0
- package/lib/typescript/src/CompetitionSeason/components/EnterSeasonPrompt.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonHeader.d.ts +15 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonHeader.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonLeaderboard.d.ts +18 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonLeaderboard.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonSettingsSection.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonSettingsSection.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/index.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeason/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/api/index.d.ts +31 -0
- package/lib/typescript/src/CompetitionSeasonManager/api/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionSelector.d.ts +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionSelector.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionsForm.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionsForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CreateSeasonForm.d.ts +11 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CreateSeasonForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonHeader.d.ts +13 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonHeader.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonInfoForm.d.ts +11 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonInfoForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonSettingsForm.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonSettingsForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/index.d.ts +8 -0
- package/lib/typescript/src/CompetitionSeasonManager/index.d.ts.map +1 -0
- package/lib/typescript/src/Components/Switch.d.ts +2 -1
- package/lib/typescript/src/Components/Switch.d.ts.map +1 -1
- package/lib/typescript/src/Engage/api/index.d.ts +6 -1
- package/lib/typescript/src/Engage/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/SeasonCard.d.ts +10 -0
- package/lib/typescript/src/Engage/components/SeasonCard.d.ts.map +1 -0
- package/lib/typescript/src/Engage/index.d.ts +3 -2
- package/lib/typescript/src/Engage/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/Competition/api/index.ts +15 -0
- package/src/Competition/components/CompetitionSeasonCard.tsx +1 -1
- package/src/Competition/components/SeasonCard.tsx +46 -0
- package/src/Competition/index.tsx +45 -27
- package/src/CompetitionManager/api/index.ts +2 -5
- package/src/CompetitionManager/components/CompetitionInfoForm.tsx +2 -64
- package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +10 -3
- package/src/CompetitionManager/components/ContestSettingsForm.tsx +8 -2
- package/src/CompetitionManager/components/CreateCompetitionForm.tsx +20 -4
- package/src/CompetitionSeason/api/index.ts +111 -0
- package/src/CompetitionSeason/components/CompetitionsSection.tsx +99 -0
- package/src/CompetitionSeason/components/EnterSeasonPrompt.tsx +135 -0
- package/src/CompetitionSeason/components/SeasonHeader.tsx +81 -0
- package/src/CompetitionSeason/components/SeasonLeaderboard.tsx +205 -0
- package/src/CompetitionSeason/components/SeasonSettingsSection.tsx +92 -0
- package/src/CompetitionSeason/index.tsx +244 -0
- package/src/CompetitionSeasonManager/api/index.ts +127 -0
- package/src/CompetitionSeasonManager/components/CompetitionSelector.tsx +2 -0
- package/src/CompetitionSeasonManager/components/CompetitionsForm.tsx +113 -0
- package/src/CompetitionSeasonManager/components/CreateSeasonForm.tsx +238 -0
- package/src/CompetitionSeasonManager/components/SeasonHeader.tsx +75 -0
- package/src/CompetitionSeasonManager/components/SeasonInfoForm.tsx +124 -0
- package/src/CompetitionSeasonManager/components/SeasonSettingsForm.tsx +185 -0
- package/src/CompetitionSeasonManager/index.tsx +151 -0
- package/src/Components/Switch.tsx +8 -3
- package/src/Engage/api/index.ts +21 -2
- package/src/Engage/components/SeasonCard.tsx +42 -0
- package/src/Engage/index.tsx +44 -7
- package/src/index.tsx +4 -1
- package/src/types.d.ts +48 -5
- package/lib/commonjs/Competition/components/ManageSeasonForm.js +0 -605
- package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +0 -1
- package/lib/commonjs/Competition/components/SeasonInfoModal.js +0 -400
- package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +0 -1
- package/lib/module/Competition/components/ManageSeasonForm.js +0 -596
- package/lib/module/Competition/components/ManageSeasonForm.js.map +0 -1
- package/lib/module/Competition/components/SeasonInfoModal.js +0 -391
- package/lib/module/Competition/components/SeasonInfoModal.js.map +0 -1
- package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +0 -10
- package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +0 -1
- package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +0 -14
- package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +0 -1
- package/src/Competition/components/ManageSeasonForm.tsx +0 -271
- package/src/Competition/components/SeasonInfoModal.tsx +0 -212
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { TouchableOpacity, View } from "react-native"
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useState } from "react"
|
|
4
|
+
import type { CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, MyPlayerProps, PlayerBalanceProps } from "../../types"
|
|
5
|
+
import Colors from "../../constants/colors"
|
|
6
|
+
import { Button, Icons, Text } from "../../Components"
|
|
7
|
+
import { view_styles } from "../../constants/styles"
|
|
8
|
+
import moment from "moment-mini"
|
|
9
|
+
import { SeasonHelpers } from "../api"
|
|
10
|
+
|
|
11
|
+
type EnterSeasonPromptProps = {
|
|
12
|
+
player?:MyPlayerProps,
|
|
13
|
+
player_balance?:PlayerBalanceProps,
|
|
14
|
+
competition_season:CompetitionSeasonProps,
|
|
15
|
+
competition_type:CompetitionTypeProps,
|
|
16
|
+
competition_result_type:CompetitionResultTypeProps,
|
|
17
|
+
width:number,
|
|
18
|
+
onVerify: () => void
|
|
19
|
+
onCancel:() => void,
|
|
20
|
+
onEnter: (promo_balance?:boolean) => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const EnterSeasonPrompt = ({ player, player_balance, competition_season, competition_type, competition_result_type, width, onCancel, onEnter, onVerify }:EnterSeasonPromptProps) => {
|
|
24
|
+
const [ use_promo_balance, setUsePromoBalance ] = useState(false)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if(!player){ return }
|
|
29
|
+
},[])
|
|
30
|
+
|
|
31
|
+
const requires_verification = player && parseInt(competition_season?.ticket_price as string ?? 0) > 0 && competition_season?.market_type == 'FOR_MONEY' && player?.vouched_status != 'verified' ? true : false
|
|
32
|
+
const cl = competition_season.market_type == 'FOR_MONEY'?'$':'E'
|
|
33
|
+
|
|
34
|
+
const { season_payout, competition_payout } = SeasonHelpers.getPayoutAmounts(competition_season)
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<View style={{ width, backgroundColor:Colors.shades.white, borderTopRightRadius:22, borderTopLeftRadius:22, paddingTop:22 }}>
|
|
38
|
+
<View nativeID="competition_info">
|
|
39
|
+
<Text size={16} color={Colors.brand.midnight} weight='bold' textAlign="center">Season Details</Text>
|
|
40
|
+
{competition_type ?
|
|
41
|
+
<View style={{ flexDirection:'row', justifyContent:'center', margin:10 }}>
|
|
42
|
+
<View style={{ padding:10, marginRight:4, backgroundColor: Colors.brand.midnight }}>
|
|
43
|
+
<Text size={12} color={Colors.shades.white} weight='semibold'>{competition_type.type_label}</Text>
|
|
44
|
+
</View>
|
|
45
|
+
<View style={{ flexDirection:'row', alignItems:'center', padding:10, marginLeft:4, backgroundColor: Colors.shades.white, borderRadius:4, ...view_styles.float }}>
|
|
46
|
+
<Text style={{ marginRight:5 }} size={12} color={Colors.brand.midnight} weight='semibold'>{competition_season.invite_only?'Private':'Public'}</Text>
|
|
47
|
+
{competition_season.invite_only ?
|
|
48
|
+
<Icons.EyeOffIcon color={Colors.brand.midnight} size={14}/>
|
|
49
|
+
:
|
|
50
|
+
<Icons.EyeOnIcon color={Colors.brand.midnight} size={14}/>
|
|
51
|
+
}
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
:<></>}
|
|
55
|
+
<Text size={14} color={Colors.brand.midnight} weight='bold' textAlign="center">{competition_season.season_name}</Text>
|
|
56
|
+
</View>
|
|
57
|
+
<View>
|
|
58
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">{moment(competition_season.scheduled_datetime).format('MMM DD - hh:mm a')}</Text>
|
|
59
|
+
{competition_season.season_description ?
|
|
60
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">{competition_season.season_description}</Text>
|
|
61
|
+
:<></>}
|
|
62
|
+
{competition_result_type ?
|
|
63
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">{competition_result_type.label}</Text>
|
|
64
|
+
:<></>}
|
|
65
|
+
{competition_type?.type == 'pick' ?
|
|
66
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">Picks: {competition_season.max_picks}</Text>
|
|
67
|
+
:<></>}
|
|
68
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">Potential Season Winnings: {cl}{season_payout.toFixed(2)}</Text>
|
|
69
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">Potential Competition Winnings: {cl}{competition_payout.toFixed(2)}</Text>
|
|
70
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">Ticket Price: {cl}{(competition_season.ticket_price as number).toFixed(2)}</Text>
|
|
71
|
+
<Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular' textAlign="center">Entries: {competition_season.tickets_sold}/{competition_season.tickets_available}</Text>
|
|
72
|
+
</View>
|
|
73
|
+
<View nativeID="pick_actions" style={{ flexDirection:'row', padding:10 }}>
|
|
74
|
+
<Button
|
|
75
|
+
style={{ flex:1, marginRight:3 }}
|
|
76
|
+
borderRadius={4}
|
|
77
|
+
borderWidth={1}
|
|
78
|
+
borderColor={Colors.brand.electric}
|
|
79
|
+
padding={10}
|
|
80
|
+
title="Cancel"
|
|
81
|
+
title_color={Colors.brand.electric}
|
|
82
|
+
onPress={() => onCancel()}
|
|
83
|
+
/>
|
|
84
|
+
{requires_verification ?
|
|
85
|
+
<Button
|
|
86
|
+
borderRadius={4}
|
|
87
|
+
style={{ flex:2, marginLeft:2 }}
|
|
88
|
+
backgroundColor={Colors.utility.warning}
|
|
89
|
+
padding={10}
|
|
90
|
+
title={`Verify My Account`}
|
|
91
|
+
title_color={Colors.shades.white}
|
|
92
|
+
onPress={() => onVerify()}
|
|
93
|
+
/>
|
|
94
|
+
:
|
|
95
|
+
<Button
|
|
96
|
+
borderRadius={4}
|
|
97
|
+
style={{ flex:2, marginLeft:2 }}
|
|
98
|
+
backgroundColor={Colors.utility.success}
|
|
99
|
+
padding={10}
|
|
100
|
+
title={`Enter Season${competition_season.ticket_price == 0 ? ``:` ${cl}${competition_season.ticket_price}`}`}
|
|
101
|
+
title_color={Colors.shades.white}
|
|
102
|
+
onPress={() => {
|
|
103
|
+
if(player_balance && competition_season.market_type == 'FOR_MONEY' && player_balance.balance < parseFloat(competition_season.ticket_price as string)){ return alert('Not enough balance to enter. Please make a deposit before continuing') }
|
|
104
|
+
|
|
105
|
+
onEnter(use_promo_balance)
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
}
|
|
109
|
+
</View>
|
|
110
|
+
{player_balance && player_balance.promo_balance > 0 ?
|
|
111
|
+
<TouchableOpacity style={{ backgroundColor:Colors.incentive.gold, padding:10, flexDirection:'row', alignItems:'center' }} onPress={() => {
|
|
112
|
+
if(use_promo_balance){
|
|
113
|
+
//Remove promo balance and open_amt
|
|
114
|
+
setUsePromoBalance(false);
|
|
115
|
+
} else {
|
|
116
|
+
setUsePromoBalance(true);
|
|
117
|
+
}
|
|
118
|
+
}}>
|
|
119
|
+
<View style={{ marginRight:10, height:30, width:30, borderWidth:1, borderColor:Colors.brand.midnight, justifyContent:'center', alignItems:'center' }}>
|
|
120
|
+
{use_promo_balance ?
|
|
121
|
+
<View style={{ height:20, width:20, backgroundColor:Colors.brand.midnight }} />
|
|
122
|
+
:<></>}
|
|
123
|
+
</View>
|
|
124
|
+
<View>
|
|
125
|
+
<Text size={14} weight='bold' color={Colors.shades.white}>${player_balance?.promo_balance} Promotion Available</Text>
|
|
126
|
+
<Text style={{ marginTop:2}} size={12} color={Colors.shades.white} weight='regular'>Press / Click here to use promo balance</Text>
|
|
127
|
+
</View>
|
|
128
|
+
|
|
129
|
+
</TouchableOpacity>
|
|
130
|
+
:<></>}
|
|
131
|
+
</View>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export default EnterSeasonPrompt
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, TouchableOpacity ,Image } from 'react-native'
|
|
3
|
+
import Colors from '../../constants/colors';
|
|
4
|
+
import type { CompetitionProps, CompetitionSeasonPlayerProps, CompetitionSeasonProps, MyPlayerProps } from '../../types';
|
|
5
|
+
import { Button, Icons, Text } from '../../Components';
|
|
6
|
+
import { SeasonHelpers } from '../api';
|
|
7
|
+
import moment from 'moment-mini';
|
|
8
|
+
|
|
9
|
+
type SeasonHeaderProps = {
|
|
10
|
+
competition_season:CompetitionSeasonProps,
|
|
11
|
+
competitions:CompetitionProps[],
|
|
12
|
+
player?:MyPlayerProps,
|
|
13
|
+
action_loading:boolean,
|
|
14
|
+
authenticated_season_player?:CompetitionSeasonPlayerProps,
|
|
15
|
+
onShareSeason:(cs:CompetitionSeasonProps) => void,
|
|
16
|
+
onJoin:(competition_season:CompetitionSeasonProps) => void,
|
|
17
|
+
onLeave:(competition_season_player_id:string) => void
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
const SeasonHeader = ({ action_loading, authenticated_season_player, competition_season, competitions, onShareSeason, onJoin, onLeave }:SeasonHeaderProps) => {
|
|
21
|
+
|
|
22
|
+
const can_join = SeasonHelpers.canJoin(competition_season, competitions);
|
|
23
|
+
const can_leave = true;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<View style={{ backgroundColor:Colors.shades.white }}>
|
|
27
|
+
<View nativeID="competition_header" style={{ flexDirection:'row', alignItems:'center', padding:20, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
28
|
+
<View>
|
|
29
|
+
<Image
|
|
30
|
+
source={{ uri: competition_season.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1649737862/be_logo_jte2ux.webp' }}
|
|
31
|
+
style={{ height:50, width:50, borderRadius:4 }}
|
|
32
|
+
resizeMode="cover"
|
|
33
|
+
/>
|
|
34
|
+
</View>
|
|
35
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
36
|
+
<Text theme='header'>{competition_season.season_name}</Text>
|
|
37
|
+
<Text style={{ marginTop:4 }} theme='header_2>'>{competition_season.season_description}</Text>
|
|
38
|
+
</View>
|
|
39
|
+
<TouchableOpacity style={{ paddingLeft:10 }} onPress={() => onShareSeason(competition_season)}>
|
|
40
|
+
<Icons.ShareIcon color={Colors.brand.midnight} size={14} />
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
</View>
|
|
43
|
+
|
|
44
|
+
<View style={{ flexDirection:'row', padding:10, backgroundColor:Colors.shades.shade100 }}>
|
|
45
|
+
<View style={{ flex:1 }}>
|
|
46
|
+
<Text size={12} color={Colors.brand.midnight} weight='regular'>{competition_season.status == 'closed' ? 'COMPLETED' : competition_season.status == 'pending' ? 'UNDER CONSTRUCTION': can_join ? 'JOIN' : 'IN PROGRESS'}</Text>
|
|
47
|
+
{competition_season.status == 'pending' ?
|
|
48
|
+
<Text style={{ marginTop:5 }} size={12} color={Colors.brand.midnight} weight='bold'>The admin is still working on this season</Text>
|
|
49
|
+
: can_join ?
|
|
50
|
+
<Text style={{ marginTop:5 }} size={12} color={Colors.brand.midnight} weight='bold'>{competition_season.allow_late_buy_in ? 'anytime during the season' : `until ${moment(competition_season.scheduled_datetime).format('MMM DD hh:mm a')}`}</Text>
|
|
51
|
+
:
|
|
52
|
+
<Text style={{ marginTop:5 }} size={12} color={Colors.brand.midnight} weight='bold'>{moment(competition_season.scheduled_datetime).format('MMM DD hh:mm a')}</Text>
|
|
53
|
+
}
|
|
54
|
+
</View>
|
|
55
|
+
{!authenticated_season_player ?
|
|
56
|
+
<Button
|
|
57
|
+
title='JOIN'
|
|
58
|
+
disabled={action_loading}
|
|
59
|
+
style={{ opacity: action_loading ? 0.5 : 1 }}
|
|
60
|
+
loading={action_loading}
|
|
61
|
+
title_color={Colors.shades.white}
|
|
62
|
+
backgroundColor={Colors.utility.success}
|
|
63
|
+
onPress={() => onJoin(competition_season)}
|
|
64
|
+
/>
|
|
65
|
+
:
|
|
66
|
+
<Button
|
|
67
|
+
title='LEAVE'
|
|
68
|
+
backgroundColor={Colors.utility.error}
|
|
69
|
+
loading={action_loading}
|
|
70
|
+
title_color={Colors.shades.white}
|
|
71
|
+
style={{ opacity: can_leave && !action_loading ? 1: 0.5 }}
|
|
72
|
+
disabled={!can_leave || action_loading}
|
|
73
|
+
onPress={() => onLeave(authenticated_season_player.competition_season_player_id)}
|
|
74
|
+
/>
|
|
75
|
+
}
|
|
76
|
+
</View>
|
|
77
|
+
</View>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default SeasonHeader
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react"
|
|
2
|
+
import { FlatList, Image, ScrollView, TouchableOpacity, View, ActivityIndicator } from "react-native"
|
|
3
|
+
import type { CompetitionSeasonPlayerProps, CompetitionSeasonProps, CompetitionSeasonResultProps, CompetitionTypeProps, MyPlayerProps, PublicPlayerProps } from "../../types"
|
|
4
|
+
import { Button, Icons, Text } from "../../Components"
|
|
5
|
+
import Colors from "../../constants/colors"
|
|
6
|
+
import { view_styles } from "../../constants/styles"
|
|
7
|
+
import { SeasonApi, SeasonHelpers } from "../api"
|
|
8
|
+
|
|
9
|
+
type SeasonLeaderboardProps = {
|
|
10
|
+
competition_season:CompetitionSeasonProps,
|
|
11
|
+
competition_type:CompetitionTypeProps,
|
|
12
|
+
height: number,
|
|
13
|
+
authenticated_player?:MyPlayerProps,
|
|
14
|
+
authenticated_season_player?:CompetitionSeasonPlayerProps,
|
|
15
|
+
authenticated_season_result?:CompetitionSeasonResultProps,
|
|
16
|
+
width:number,
|
|
17
|
+
view_mode: 'short'|'full',
|
|
18
|
+
onClose?:() => void,
|
|
19
|
+
onSeeFull: () => void,
|
|
20
|
+
onLeaderSelect:(player:PublicPlayerProps) => void
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const SeasonLeaderboard = ({ competition_season, authenticated_player, authenticated_season_player, authenticated_season_result, competition_type, width, height, view_mode, onSeeFull, onClose, onLeaderSelect }:SeasonLeaderboardProps) => {
|
|
24
|
+
const [ expanded, setExpanded ] = useState(false);
|
|
25
|
+
const [ data, setData ] = useState<{
|
|
26
|
+
loading:boolean,
|
|
27
|
+
competition_season_results:CompetitionSeasonResultProps[],
|
|
28
|
+
competition_season_players:CompetitionSeasonPlayerProps[],
|
|
29
|
+
players:PublicPlayerProps[],
|
|
30
|
+
offset:number
|
|
31
|
+
}>({
|
|
32
|
+
loading:false,
|
|
33
|
+
competition_season_results:[],
|
|
34
|
+
competition_season_players:[],
|
|
35
|
+
players:[],
|
|
36
|
+
offset:0
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const { loading, competition_season_results, competition_season_players, players, offset } = data
|
|
40
|
+
let results = [ ...competition_season_results ];
|
|
41
|
+
|
|
42
|
+
if(view_mode == 'short'){ results = results.filter((r,i) => r ? i < 3 : i < 3) }
|
|
43
|
+
const cl = competition_season?.market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if(!competition_season){ return }
|
|
47
|
+
getLeaderboardFromServer(competition_season.competition_season_id, 0);
|
|
48
|
+
},[competition_season])
|
|
49
|
+
|
|
50
|
+
const getLeaderboardFromServer = async(season_id:string, offset:number) => {
|
|
51
|
+
setData({ ...data, loading:true })
|
|
52
|
+
const result_response = await SeasonApi.getSeasonPlayersBySeasonId(season_id, offset);
|
|
53
|
+
let player_ids = result_response.competition_season_players.map(cr => cr.player_id)
|
|
54
|
+
let players:PublicPlayerProps[] = []
|
|
55
|
+
if(player_ids.length > 0){ players = await SeasonApi.getPlayersByPlayerIds(player_ids) }
|
|
56
|
+
setData({
|
|
57
|
+
...data,
|
|
58
|
+
players,
|
|
59
|
+
competition_season_players: result_response.competition_season_players,
|
|
60
|
+
competition_season_results: result_response.competition_season_results,
|
|
61
|
+
offset,
|
|
62
|
+
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const renderResults = (data: {item:CompetitionSeasonResultProps, index:number}) => {
|
|
67
|
+
let player:PublicPlayerProps | undefined = players.find(p => p.player_id == data.item.player_id)
|
|
68
|
+
let record = competition_season_players.find(r => r.player_id == data.item.player_id)
|
|
69
|
+
if(!player || !record){ return <></> }
|
|
70
|
+
|
|
71
|
+
const is_pacer = competition_season.pacer_id == data.item.player_id ? true : false
|
|
72
|
+
return (
|
|
73
|
+
<TouchableOpacity
|
|
74
|
+
onPress={() => onLeaderSelect(player)}
|
|
75
|
+
style={{ flexDirection:'row', margin:5, alignItems:'center', borderRadius:22, backgroundColor:is_pacer?Colors.highlights.highlight400Faded:Colors.shades.white, padding:8, paddingLeft:15, paddingRight:15}}>
|
|
76
|
+
{is_pacer ?
|
|
77
|
+
<View nativeID="pacer" style={{}}>
|
|
78
|
+
<Icons.PacerCarIcon size={28}/>
|
|
79
|
+
</View>
|
|
80
|
+
:
|
|
81
|
+
<View nativeID="place" style={{ padding:5 }}>
|
|
82
|
+
<Text size={12} color={Colors.brand.midnight} weight="bold">{SeasonHelpers.formatPlace(data.item.place)}</Text>
|
|
83
|
+
</View>
|
|
84
|
+
}
|
|
85
|
+
<View nativeID="image" style={{ paddingLeft:10, paddingRight:10 }}>
|
|
86
|
+
<Image
|
|
87
|
+
source={{ uri: player.profile_pic }}
|
|
88
|
+
style={{ height:30, width:30, borderRadius:100 }}
|
|
89
|
+
resizeMode="cover"
|
|
90
|
+
/>
|
|
91
|
+
</View>
|
|
92
|
+
<View nativeID="details" style={{ flex:1 }}>
|
|
93
|
+
<Text size={12} color={Colors.brand.midnight} weight='semibold'>{player.username}</Text>
|
|
94
|
+
{competition_type?.type == 'wager' ?
|
|
95
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular'>{record.earnings.toFixed(2)} Earned</Text>
|
|
96
|
+
:
|
|
97
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular'>{record.wins} - {record.losses} - {record.draws}</Text>
|
|
98
|
+
}
|
|
99
|
+
</View>
|
|
100
|
+
<View nativeID="winnings">
|
|
101
|
+
<Text size={12} color={Colors.brand.slate} weight='regular'>{cl}{data.item.winnings.toFixed(2)}</Text>
|
|
102
|
+
</View>
|
|
103
|
+
</TouchableOpacity>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<View style={{ ...view_styles.section, margin:view_mode == 'full'?0:10, minWidth:350, height:view_mode == 'full'?height:undefined, width: view_mode == 'full' ? width: undefined }}>
|
|
109
|
+
{view_mode == 'short' ?
|
|
110
|
+
<TouchableOpacity style={view_styles.section_header} onPress={() => setExpanded(!expanded)}>
|
|
111
|
+
<Icons.PodiumIcon size={18} color={Colors.brand.midnight} />
|
|
112
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
113
|
+
<Text theme="header">Season Leaderboard</Text>
|
|
114
|
+
<Text style={{ marginTop: 4 }} theme="body_2">Leaderboard showing current standings of this season.</Text>
|
|
115
|
+
</View>
|
|
116
|
+
<Icons.ChevronIcon direction={expanded?'up':'down'} color={Colors.brand.midnight} size={8} />
|
|
117
|
+
</TouchableOpacity>
|
|
118
|
+
:<></>}
|
|
119
|
+
{expanded || view_mode == 'full' ?
|
|
120
|
+
<View style={{ ...view_styles.section_body }}>
|
|
121
|
+
{authenticated_player && authenticated_season_player && authenticated_season_result ?
|
|
122
|
+
<View>
|
|
123
|
+
<View style={{ backgroundColor:Colors.brand.midnight, padding:10, marginBottom:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
124
|
+
<Text size={14} color={Colors.shades.white} weight='regular'>MY RESULTS</Text>
|
|
125
|
+
<TouchableOpacity style={{ flexDirection:'row', marginTop:10, marginBottom:10, alignItems:'center', borderRadius:22, backgroundColor:Colors.shades.white, padding:8, paddingLeft:15, paddingRight:15}}>
|
|
126
|
+
<View nativeID="place" style={{ padding:5 }}>
|
|
127
|
+
<Text size={12} color={Colors.brand.midnight} weight="bold">{SeasonHelpers.formatPlace(authenticated_season_result.place)}</Text>
|
|
128
|
+
</View>
|
|
129
|
+
<View nativeID="image" style={{ paddingLeft:10, paddingRight:10 }}>
|
|
130
|
+
<Image
|
|
131
|
+
source={{ uri: authenticated_player.profile_pic }}
|
|
132
|
+
style={{ height:30, width:30, borderRadius:100 }}
|
|
133
|
+
resizeMode="cover"
|
|
134
|
+
/>
|
|
135
|
+
</View>
|
|
136
|
+
<View nativeID="details" style={{ flex:1 }}>
|
|
137
|
+
<Text size={12} color={Colors.brand.midnight} weight='semibold'>{authenticated_player.username}</Text>
|
|
138
|
+
{competition_type?.type == 'wager' ?
|
|
139
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular'>{authenticated_season_player.earnings.toFixed(2)}</Text>
|
|
140
|
+
:
|
|
141
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular'>{authenticated_season_player.wins} - {authenticated_season_player.losses} - {authenticated_season_player.draws}</Text>
|
|
142
|
+
}
|
|
143
|
+
</View>
|
|
144
|
+
<View nativeID="winnings">
|
|
145
|
+
<Text size={12} color={Colors.brand.slate} weight='regular'>{cl}{authenticated_season_result.winnings.toFixed(2)}</Text>
|
|
146
|
+
</View>
|
|
147
|
+
</TouchableOpacity>
|
|
148
|
+
</View>
|
|
149
|
+
</View>
|
|
150
|
+
:<></>}
|
|
151
|
+
<ScrollView style={{ backgroundColor:Colors.shades.shade100, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
152
|
+
{loading ?
|
|
153
|
+
<ActivityIndicator style={{ alignSelf:'center', padding:10 }} size='large' color={Colors.brand.midnight} />
|
|
154
|
+
:<></>}
|
|
155
|
+
<FlatList
|
|
156
|
+
data={results}
|
|
157
|
+
renderItem={renderResults}
|
|
158
|
+
keyExtractor={(item) => item.competition_season_result_id.toString()}
|
|
159
|
+
/>
|
|
160
|
+
|
|
161
|
+
</ScrollView>
|
|
162
|
+
{view_mode == 'short' ?
|
|
163
|
+
<Button
|
|
164
|
+
style={{ backgroundColor:undefined }}
|
|
165
|
+
title='View Full Leaderboard'
|
|
166
|
+
title_color={Colors.brand.electric}
|
|
167
|
+
title_size={14}
|
|
168
|
+
onPress={() => onSeeFull()}
|
|
169
|
+
/>
|
|
170
|
+
:<></>}
|
|
171
|
+
{onClose ?
|
|
172
|
+
<View style={{ padding:10, ...view_styles.float }}>
|
|
173
|
+
<View style={{ padding:10, flexDirection:'row', alignItems:'center', justifyContent:'space-between' }}>
|
|
174
|
+
{offset > 0 ?
|
|
175
|
+
<Button
|
|
176
|
+
title='PREV'
|
|
177
|
+
title_color={Colors.brand.electric}
|
|
178
|
+
backgroundColor='transparent'
|
|
179
|
+
onPress={() => getLeaderboardFromServer(competition_season.competition_season_id, offset - 1)}
|
|
180
|
+
/>
|
|
181
|
+
:<View/>}
|
|
182
|
+
<Button
|
|
183
|
+
title='NEXT'
|
|
184
|
+
title_color={Colors.brand.electric}
|
|
185
|
+
backgroundColor='transparent'
|
|
186
|
+
onPress={() => getLeaderboardFromServer(competition_season.competition_season_id, offset + 1)}
|
|
187
|
+
/>
|
|
188
|
+
</View>
|
|
189
|
+
<Button
|
|
190
|
+
title='Close'
|
|
191
|
+
style={{ padding:15 }}
|
|
192
|
+
title_color={Colors.shades.white}
|
|
193
|
+
backgroundColor={Colors.utility.error}
|
|
194
|
+
onPress={() => onClose()}
|
|
195
|
+
/>
|
|
196
|
+
</View>
|
|
197
|
+
:<></>}
|
|
198
|
+
</View>
|
|
199
|
+
:<></>}
|
|
200
|
+
|
|
201
|
+
</View>
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export default SeasonLeaderboard
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, FlatList } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { CompetitionPayoutTypeProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps } from "../../types"
|
|
5
|
+
import { view_styles } from '../../constants/styles';
|
|
6
|
+
import { Icons, Text } from '../../Components';
|
|
7
|
+
import { SeasonHelpers } from '../api';
|
|
8
|
+
import Colors from '../../constants/colors';
|
|
9
|
+
|
|
10
|
+
type SeasonSettingsSectionProps = {
|
|
11
|
+
width:number,
|
|
12
|
+
competition_season:CompetitionSeasonProps,
|
|
13
|
+
competition_type:CompetitionTypeProps,
|
|
14
|
+
competition_result_type:CompetitionResultTypeProps,
|
|
15
|
+
competition_payouts:CompetitionPayoutTypeProps[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const SeasonSettingsSection = ({ width, competition_season, competition_type, competition_result_type, competition_payouts }:SeasonSettingsSectionProps) => {
|
|
19
|
+
const [ expanded, setExpanded ] = useState(true);
|
|
20
|
+
|
|
21
|
+
const { season_payout, competition_payout } = SeasonHelpers.getPayoutAmounts(competition_season)
|
|
22
|
+
const cl = competition_season.market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
23
|
+
|
|
24
|
+
const renderPayouts = (data: { item:CompetitionPayoutTypeProps, index:number }) => {
|
|
25
|
+
return (
|
|
26
|
+
<View style={{ ...view_styles.body_row, padding:8, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
27
|
+
<Text style={{ flex:1 }} theme='header_2'>{SeasonHelpers.formatPlace(data.item.tier)}{data.item.tier!= 1 ? ' Or Better': ''}</Text>
|
|
28
|
+
<Text theme='header_2'>Split {data.item.payout}%</Text>
|
|
29
|
+
</View>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<View style={{ ...view_styles.section, maxWidth: width }}>
|
|
35
|
+
<TouchableOpacity style={{ ...view_styles.section_header }} onPress={() => setExpanded(!expanded)}>
|
|
36
|
+
<Icons.SettingsIcon size={18} color={Colors.brand.midnight} />
|
|
37
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
38
|
+
<Text theme='header'>Season Details</Text>
|
|
39
|
+
<Text style={{ marginTop:3 }} theme='body'>View important details about this season.</Text>
|
|
40
|
+
</View>
|
|
41
|
+
<Icons.ChevronIcon direction={expanded ? 'up' : 'down'} size={8} color={Colors.brand.midnight} />
|
|
42
|
+
</TouchableOpacity>
|
|
43
|
+
{expanded ?
|
|
44
|
+
<View style={{ ...view_styles.section_body }}>
|
|
45
|
+
<View style={view_styles.body_row}>
|
|
46
|
+
<View style={{ flex:1 }}>
|
|
47
|
+
<Text theme='header_2'>Competition Type</Text>
|
|
48
|
+
<Text style={{ marginTop:3 }} theme='body_2'>Each competition within this season will use this type</Text>
|
|
49
|
+
</View>
|
|
50
|
+
<Text theme='header'>{competition_type.type_label.toUpperCase()}</Text>
|
|
51
|
+
</View>
|
|
52
|
+
<View style={view_styles.body_row}>
|
|
53
|
+
<View style={{ flex:1 }}>
|
|
54
|
+
<Text theme='header_2'>Season Winner Allocation</Text>
|
|
55
|
+
<Text style={{ marginTop:3 }} theme='body_2'>How much of the total pot is dedicated to the season winner?</Text>
|
|
56
|
+
</View>
|
|
57
|
+
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
58
|
+
<Text theme='header_2'>{cl}{season_payout.toFixed(2)}</Text>
|
|
59
|
+
<Text style={{ marginTop:3 }} theme='body'>{(parseFloat(competition_season.payout_allocation as string) * 100).toFixed(2)}%</Text>
|
|
60
|
+
</View>
|
|
61
|
+
</View>
|
|
62
|
+
<View style={view_styles.body_row}>
|
|
63
|
+
<View style={{ flex:1 }}>
|
|
64
|
+
<Text theme='header_2'>Each Competition Allocation</Text>
|
|
65
|
+
<Text style={{ marginTop:3 }} theme='body_2'>How much of the total pot is dedicated to each competition winner?</Text>
|
|
66
|
+
</View>
|
|
67
|
+
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
68
|
+
<Text theme='header_2'>{cl}{competition_payout.toFixed(2)}</Text>
|
|
69
|
+
<Text style={{ marginTop:3 }} theme='body'>{(( 1 - (parseFloat(competition_season.payout_allocation as string))) * 100).toFixed(2)}%</Text>
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
<View style={view_styles.body_row}>
|
|
73
|
+
<Text style={{flex:1}} theme="header_2">Payout Type</Text>
|
|
74
|
+
<Text theme="header_2">{competition_result_type.label.toUpperCase()}</Text>
|
|
75
|
+
</View>
|
|
76
|
+
<View style={{ padding:10, borderRadius:8, backgroundColor:Colors.shades.shade100 }}>
|
|
77
|
+
<Text style={{ padding:5 }} theme="header_2">{competition_result_type.description}</Text>
|
|
78
|
+
<View style={{ padding:10 }}>
|
|
79
|
+
<FlatList
|
|
80
|
+
data={competition_payouts.filter(cp => cp.competition_result_type_id == competition_season.competition_result_type_id).sort((a,b) => b.tier - a.tier)}
|
|
81
|
+
renderItem={renderPayouts}
|
|
82
|
+
keyExtractor={(item) => item.competition_payout_type_id.toString()}
|
|
83
|
+
/>
|
|
84
|
+
</View>
|
|
85
|
+
</View>
|
|
86
|
+
</View>
|
|
87
|
+
:<></>}
|
|
88
|
+
</View>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default SeasonSettingsSection
|