be-components 3.5.7 → 3.5.9
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/CompetitionManager/components/AthleteSelector.js +52 -75
- package/lib/commonjs/CompetitionManager/components/AthleteSelector.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +135 -119
- package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js +69 -62
- package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +86 -91
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +143 -150
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/ContestSelector.js +57 -61
- package/lib/commonjs/CompetitionManager/components/ContestSelector.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +120 -266
- package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/MarketSelector.js +35 -32
- package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/PlayerSelector.js +42 -39
- package/lib/commonjs/CompetitionManager/components/PlayerSelector.js.map +1 -1
- package/lib/commonjs/CompetitionManager/index.js +47 -50
- package/lib/commonjs/CompetitionManager/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/OrderBook.js +1 -0
- package/lib/commonjs/MarketComponents/components/OrderBook.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +56 -3
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/Vouchhtml.js +86 -0
- package/lib/commonjs/ProfileManager/Components/Vouchhtml.js.map +1 -0
- package/lib/module/CompetitionManager/components/AthleteSelector.js +42 -65
- package/lib/module/CompetitionManager/components/AthleteSelector.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +93 -77
- package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionHeader.js +47 -40
- package/lib/module/CompetitionManager/components/CompetitionHeader.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +59 -64
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +108 -115
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/ContestSelector.js +34 -38
- package/lib/module/CompetitionManager/components/ContestSelector.js.map +1 -1
- package/lib/module/CompetitionManager/components/ContestSettingsForm.js +90 -237
- package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/MarketSelector.js +26 -23
- package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -1
- package/lib/module/CompetitionManager/components/PlayerSelector.js +30 -27
- package/lib/module/CompetitionManager/components/PlayerSelector.js.map +1 -1
- package/lib/module/CompetitionManager/index.js +32 -35
- package/lib/module/CompetitionManager/index.js.map +1 -1
- package/lib/module/MarketComponents/components/OrderBook.js +1 -0
- package/lib/module/MarketComponents/components/OrderBook.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js +56 -3
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/Components/Vouchhtml.js +80 -0
- package/lib/module/ProfileManager/Components/Vouchhtml.js.map +1 -0
- package/lib/typescript/lib/commonjs/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts +1 -2
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts +1 -2
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
- package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
- package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/OrderBook.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/Vouchhtml.d.ts +9 -0
- package/lib/typescript/lib/commonjs/ProfileManager/Components/Vouchhtml.d.ts.map +1 -0
- package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts +1 -2
- package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts +2 -4
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts +1 -2
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts +2 -4
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts +2 -4
- package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/ContestSelector.d.ts +1 -2
- package/lib/typescript/lib/module/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts +2 -4
- package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/MarketSelector.d.ts +1 -2
- package/lib/typescript/lib/module/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/components/PlayerSelector.d.ts +1 -2
- package/lib/typescript/lib/module/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/index.d.ts +3 -3
- package/lib/typescript/lib/module/CompetitionManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/OrderBook.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/Vouchhtml.d.ts +8 -0
- package/lib/typescript/lib/module/ProfileManager/Components/Vouchhtml.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts +1 -1
- package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/index.d.ts +7 -1
- package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/OrderBook.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/Vouchhtml.d.ts +10 -0
- package/lib/typescript/src/ProfileManager/Components/Vouchhtml.d.ts.map +1 -0
- package/package.json +4 -1
- package/src/CompetitionManager/components/AthleteSelector.tsx +32 -52
- package/src/CompetitionManager/components/CompetitionContestsForm.tsx +82 -89
- package/src/CompetitionManager/components/CompetitionHeader.tsx +45 -37
- package/src/CompetitionManager/components/CompetitionInfoForm.tsx +36 -40
- package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +88 -96
- package/src/CompetitionManager/components/ContestSelector.tsx +33 -36
- package/src/CompetitionManager/components/ContestSettingsForm.tsx +58 -179
- package/src/CompetitionManager/components/MarketSelector.tsx +19 -21
- package/src/CompetitionManager/components/PlayerSelector.tsx +23 -26
- package/src/CompetitionManager/index.tsx +22 -25
- package/src/MarketComponents/components/OrderBook.tsx +1 -0
- package/src/ProfileManager/Components/VouchCard.tsx +46 -2
- package/src/ProfileManager/Components/Vouchhtml.ts +87 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Image } from "react-native"
|
|
2
2
|
import React, { useEffect, useState } from "react";
|
|
3
3
|
import type { CompetitionProps, CompetitionResultTypeProps, MyPlayerProps, PublicPlayerProps } from "../../types";
|
|
4
4
|
import { ManageCompetitionApi } from "../api";
|
|
5
|
-
import
|
|
6
|
-
import { Button, Icons, Text } from "../../Components";
|
|
7
|
-
import { view_styles } from "../../constants/styles";
|
|
5
|
+
import { Icons, Toggle } from "../../Components";
|
|
8
6
|
import DropDown from "../../Components/Dropdown";
|
|
9
7
|
import moment from "moment-mini";
|
|
8
|
+
import { Button, Text, TextInput, View } from "../../Components/Themed";
|
|
9
|
+
import { useColors } from "../../constants/useColors";
|
|
10
10
|
|
|
11
11
|
type CompetitionSettingsFormProps = {
|
|
12
12
|
player?: MyPlayerProps,
|
|
@@ -20,12 +20,12 @@ type CompetitionSettingsFormProps = {
|
|
|
20
20
|
|
|
21
21
|
const market_types = ['FOR_MONEY', 'FREE']
|
|
22
22
|
|
|
23
|
-
const CompetitionSettingsForm = ({ is_valid, player,
|
|
23
|
+
const CompetitionSettingsForm = ({ is_valid, player, competition, competition_result_types, onCompetitionUpdate, onShowPacers }: CompetitionSettingsFormProps) => {
|
|
24
24
|
const [ expanded, setExpanded ] = useState(false);
|
|
25
25
|
const [ draft_competition, setDraftCompetition ] = useState<CompetitionProps | undefined>(undefined);
|
|
26
26
|
//const [ player_selector_visible, setPlayerSelectorVisible ] = useState(false);
|
|
27
27
|
const [ pacer, setPacer ] = useState<PublicPlayerProps | MyPlayerProps>();
|
|
28
|
-
|
|
28
|
+
const Colors = useColors();
|
|
29
29
|
const competition_result_type = competition_result_types.find(crt => crt.competition_result_type_id == competition?.competition_result_type_id);
|
|
30
30
|
|
|
31
31
|
useEffect(() => {
|
|
@@ -51,71 +51,58 @@ const CompetitionSettingsForm = ({ is_valid, player, width, competition, competi
|
|
|
51
51
|
setPacer(ps[0])
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
const renderMarketTypes = (data:{ item:string, index:number }) => {
|
|
55
|
-
if(!draft_competition){ return <></> }
|
|
56
|
-
const selected = data.item == competition.market_type ? true : false
|
|
57
|
-
return (
|
|
58
|
-
<TouchableOpacity
|
|
59
|
-
disabled={competition.competition_season_id ? true : false}
|
|
60
|
-
style={{ minWidth:75, margin:1, borderRadius:8, padding:10, backgroundColor:selected?Colors.brand.midnight:undefined }} onPress={() => onCompetitionUpdate({ ...draft_competition, market_type: data.item })}>
|
|
61
|
-
<Text textAlign="center" color={selected?Colors.shades.white:Colors.brand.midnight} weight={selected?'bold':'regular'} size={14}>{data.item == 'FOR_MONEY'?'USD':'EDGE COINS'}</Text>
|
|
62
|
-
</TouchableOpacity>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
54
|
|
|
67
55
|
if(!competition || !draft_competition){ return <></> }
|
|
68
56
|
const is_changed = JSON.stringify(competition) != JSON.stringify(draft_competition) ? true : false
|
|
69
57
|
|
|
70
58
|
return (
|
|
71
|
-
<View style={{
|
|
72
|
-
<
|
|
59
|
+
<View float style={{ flexGrow:1, borderRadius:0 }}>
|
|
60
|
+
<Button float style={{ flexDirection:'row', alignItems:'center', borderRadius:0 }} onPress={() => setExpanded(!expanded)}>
|
|
73
61
|
{is_valid ?
|
|
74
|
-
<Icons.CheckCirlceIcon size={16} color={Colors.
|
|
62
|
+
<Icons.CheckCirlceIcon size={16} color={Colors.text.success} />
|
|
75
63
|
:
|
|
76
|
-
<Icons.AlertIcon size={16} color={Colors.
|
|
64
|
+
<Icons.AlertIcon size={16} color={Colors.text.warning} />
|
|
77
65
|
}
|
|
78
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
79
|
-
<Text theme='
|
|
80
|
-
<Text style={{ marginTop:3 }} theme='
|
|
66
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
67
|
+
<Text theme='h1'>Competition Settings</Text>
|
|
68
|
+
<Text style={{ marginTop:3 }} theme='description'>Manage the high level information of this competition</Text>
|
|
81
69
|
</View>
|
|
82
70
|
{is_changed ?
|
|
83
71
|
<Button
|
|
84
72
|
title='SAVE'
|
|
85
|
-
|
|
86
|
-
title_color={Colors.shades.white}
|
|
87
|
-
backgroundColor={Colors.utility.success}
|
|
73
|
+
type='success'
|
|
88
74
|
onPress={() => onCompetitionUpdate(draft_competition)}
|
|
89
75
|
/>
|
|
90
76
|
:
|
|
91
|
-
<Icons.ChevronIcon direction={expanded ? 'up' : 'down'} color={Colors.
|
|
77
|
+
<Icons.ChevronIcon direction={expanded ? 'up' : 'down'} color={Colors.text.h1} size={8} />
|
|
92
78
|
}
|
|
93
|
-
</
|
|
79
|
+
</Button>
|
|
94
80
|
{expanded ?
|
|
95
|
-
<View nativeID="competition_settings" style={{
|
|
81
|
+
<View type='body' nativeID="competition_settings" style={{ flexGrow:1 }}>
|
|
96
82
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<Text theme="
|
|
101
|
-
<Text style={{ marginTop:3 }} theme="body">Is the ticket price in real-money or edge coins?</Text>
|
|
83
|
+
<View nativeID="competition_currency" style={{ padding:10, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
|
|
84
|
+
<View style={{ margin:5, minWidth:200 }}>
|
|
85
|
+
<Text theme="h1">Competition Currency</Text>
|
|
86
|
+
<Text style={{ marginTop:3 }} theme="description">Is the ticket price in real-money or edge coins?</Text>
|
|
102
87
|
</View>
|
|
103
|
-
<View style={{ justifyContent:'flex-end', margin: 5, borderRadius:8
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
88
|
+
<View style={{ justifyContent:'flex-end', margin: 5, borderRadius:8 }}>
|
|
89
|
+
<Toggle
|
|
90
|
+
options={market_types.map(t => {
|
|
91
|
+
return { key: t, label: t }
|
|
92
|
+
})}
|
|
93
|
+
onSelectOption={(key) => onCompetitionUpdate({ ...draft_competition, market_type: key})}
|
|
94
|
+
selected_option={competition.market_type}
|
|
109
95
|
/>
|
|
96
|
+
|
|
110
97
|
</View>
|
|
111
98
|
</View>
|
|
112
|
-
|
|
113
|
-
<View nativeID="competition_payout" style={{
|
|
114
|
-
<View style={{ flex:1,
|
|
115
|
-
<Text theme="
|
|
116
|
-
<Text style={{ marginTop:3 }} theme="
|
|
99
|
+
<View style={{borderBottomWidth:1, borderBottomColor:Colors.borders.light, padding:10}}>
|
|
100
|
+
<View type='row' nativeID="competition_payout" style={{ flexWrap:'wrap' }}>
|
|
101
|
+
<View transparent style={{ flex:1, minWidth:200 }}>
|
|
102
|
+
<Text theme="h1">Competition Payout Type</Text>
|
|
103
|
+
<Text style={{ marginTop:3 }} theme="description">{competition_result_type?competition_result_type.description:'Choose the type of payout for this competition'}</Text>
|
|
117
104
|
</View>
|
|
118
|
-
<View style={{ justifyContent:'flex-end', margin:5, borderRadius:8
|
|
105
|
+
<View transparent style={{ flex:1, justifyContent:'flex-end', margin:5, borderRadius:8 }}>
|
|
119
106
|
<DropDown
|
|
120
107
|
read_only={competition.competition_season_id ? true : false}
|
|
121
108
|
dropdown_options={[
|
|
@@ -131,82 +118,87 @@ const CompetitionSettingsForm = ({ is_valid, player, width, competition, competi
|
|
|
131
118
|
</View>
|
|
132
119
|
</View>
|
|
133
120
|
{competition_result_type?.type == 'outpace' ?
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
121
|
+
<View transparent style={{ marginTop:10 }}>
|
|
122
|
+
<Text style={{ marginBottom:10 }} theme="h1">Select a Pacer</Text>
|
|
123
|
+
<Button
|
|
124
|
+
float
|
|
125
|
+
disabled={competition.competition_season_id ? true : false}
|
|
126
|
+
style={{ borderRadius:8, padding:10 }} onPress={() => onShowPacers()}>
|
|
127
|
+
{pacer ?
|
|
128
|
+
<View transparent type='row'>
|
|
129
|
+
<Icons.PacerCarIcon size={24} color={Colors.text.h1} />
|
|
130
|
+
<Image
|
|
131
|
+
source={{ uri: pacer.profile_pic && pacer.profile_pic != '' ? pacer.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
132
|
+
style={{ height:40, width:40, borderRadius:4, marginLeft:10 }}
|
|
133
|
+
resizeMode="cover"
|
|
134
|
+
/>
|
|
135
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
136
|
+
<Text theme="h2">@{pacer.username}</Text>
|
|
137
|
+
<Text style={{ marginTop:3 }} theme="description">Joined {moment(pacer.create_datetime).format('MMM YYYY')}</Text>
|
|
138
|
+
</View>
|
|
139
|
+
<Icons.ChevronIcon direction="right" color={Colors.text.h1} size={8} />
|
|
148
140
|
</View>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<
|
|
141
|
+
:
|
|
142
|
+
<View type='row'>
|
|
143
|
+
<Icons.AlertIcon size={20} color={Colors.text.warning} />
|
|
144
|
+
<Image
|
|
145
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
146
|
+
style={{ height:40, width:40, borderRadius:4, marginLeft:10 }}
|
|
147
|
+
resizeMode="cover"
|
|
148
|
+
/>
|
|
149
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
150
|
+
<Text theme="h2">Select A Pacer!</Text>
|
|
151
|
+
</View>
|
|
152
|
+
<Icons.ChevronIcon direction="right" color={Colors.text.h1} size={8} />
|
|
161
153
|
</View>
|
|
162
|
-
|
|
163
|
-
</
|
|
164
|
-
|
|
165
|
-
</TouchableOpacity>
|
|
154
|
+
}
|
|
155
|
+
</Button>
|
|
156
|
+
</View>
|
|
166
157
|
:<></>}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<Text
|
|
158
|
+
</View>
|
|
159
|
+
<View type='row' nativeID="buy_in" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
|
|
160
|
+
<View style={{ flex:1, minWidth:200 }}>
|
|
161
|
+
<Text theme="h1">Ticket Price</Text>
|
|
162
|
+
<Text style={{ marginTop:3 }} theme="description">Set the amount required to purchase a ticket to participate</Text>
|
|
171
163
|
</View>
|
|
172
164
|
<TextInput
|
|
173
|
-
style={{
|
|
165
|
+
style={{ flex:1, textAlign:'center', width:100 }}
|
|
174
166
|
onChangeText={(text) => setDraftCompetition({ ...draft_competition, buy_in: text })}
|
|
175
167
|
placeholder="0"
|
|
168
|
+
keyboardType="decimal-pad"
|
|
176
169
|
editable={competition.competition_season_id ? false : true}
|
|
177
170
|
value={draft_competition.buy_in as string}
|
|
178
|
-
placeholderTextColor={Colors.brand.slate}
|
|
179
171
|
/>
|
|
180
172
|
</View>
|
|
181
173
|
{player?.role == 'admin' ?
|
|
182
|
-
<View nativeID="buy_in" style={{
|
|
183
|
-
<View style={{ flex:1,
|
|
184
|
-
<Text theme="
|
|
185
|
-
<Text style={{ marginTop:3 }} theme="
|
|
174
|
+
<View type='row' nativeID="buy_in" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
|
|
175
|
+
<View style={{ flex:1, minWidth:200 }}>
|
|
176
|
+
<Text theme="h1">Guaranteed Payout</Text>
|
|
177
|
+
<Text style={{ marginTop:3 }} theme="description">ADMIN ONLY - How much is guaranteed to be paid out?</Text>
|
|
186
178
|
</View>
|
|
187
179
|
<TextInput
|
|
188
|
-
style={{
|
|
180
|
+
style={{ flex:1, textAlign:'center', width:100 }}
|
|
189
181
|
onChangeText={(text) => setDraftCompetition({ ...draft_competition, guaranteed_payout: text })}
|
|
190
182
|
placeholder="0"
|
|
183
|
+
keyboardType="decimal-pad"
|
|
191
184
|
editable={competition.competition_season_id ? false : true}
|
|
192
185
|
value={draft_competition.guaranteed_payout as string}
|
|
193
|
-
placeholderTextColor={Colors.brand.slate}
|
|
194
186
|
/>
|
|
195
187
|
</View>
|
|
196
188
|
:<></>}
|
|
197
189
|
|
|
198
|
-
<View nativeID="Max Tickets" style={{
|
|
199
|
-
<View style={{ flex:1, marginRight:5 }}>
|
|
200
|
-
<Text theme="
|
|
201
|
-
<Text style={{ marginTop:3 }} theme="
|
|
190
|
+
<View type='row' nativeID="Max Tickets" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
|
|
191
|
+
<View style={{ flex:1, marginRight:5, minWidth:200 }}>
|
|
192
|
+
<Text theme="h1">Max Tickets</Text>
|
|
193
|
+
<Text style={{ marginTop:3 }} theme="description">Maximum number of tickets that can be sold</Text>
|
|
202
194
|
</View>
|
|
203
195
|
<TextInput
|
|
204
|
-
style={{
|
|
196
|
+
style={{ flex:1, textAlign:'center', width:100 }}
|
|
205
197
|
onChangeText={(text) => setDraftCompetition({ ...draft_competition, available_tickets: text })}
|
|
206
198
|
placeholder="100"
|
|
199
|
+
keyboardType="decimal-pad"
|
|
207
200
|
editable={competition.competition_season_id ? false : true}
|
|
208
201
|
value={draft_competition.available_tickets as string}
|
|
209
|
-
placeholderTextColor={Colors.brand.slate}
|
|
210
202
|
/>
|
|
211
203
|
</View>
|
|
212
204
|
</View>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { view_styles } from '../../constants/styles';
|
|
5
|
-
import { Button, Switch, Text } from '../../Components';
|
|
2
|
+
import { FlatList, ScrollView, Image, ActivityIndicator } from "react-native"
|
|
3
|
+
import { Switch } from '../../Components';
|
|
6
4
|
import DropDown from '../../Components/Dropdown';
|
|
7
5
|
import type { EventProps, LeagueProps } from '../../types';
|
|
8
6
|
import { ManageCompetitionMatchApi } from '../api';
|
|
9
7
|
import moment from 'moment-mini';
|
|
10
8
|
import SearchBox from '../../Components/SearchBox';
|
|
9
|
+
import { useColors } from '../../constants/useColors';
|
|
10
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
11
11
|
|
|
12
12
|
type ContestSelectorProps = {
|
|
13
13
|
width: number,
|
|
@@ -22,6 +22,7 @@ type ContestSelectorProps = {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const ContestSelector = ({ action_loading, width, height, leagues, selected_team_events, onClose, onSelectTeamEvent, onDeselectTeamEvent, onSelectTeamEvents }:ContestSelectorProps) => {
|
|
25
|
+
const Colors = useColors();
|
|
25
26
|
const [ search_value, setSearchValue ] = useState('');
|
|
26
27
|
const [ filters, setFilters ] = useState<{
|
|
27
28
|
ranked?:boolean,
|
|
@@ -96,17 +97,17 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
96
97
|
const renderDivisions = (data: { item:string, index:number }) => {
|
|
97
98
|
const selected = filters.division == data.item ? true : false
|
|
98
99
|
return (
|
|
99
|
-
<
|
|
100
|
-
<Text
|
|
101
|
-
</
|
|
100
|
+
<Button style={{ padding:10 }} onPress={() => selected ? setFilters({ ...filters, division: undefined }) : setFilters({ ...filters, division:data.item })}>
|
|
101
|
+
<Text theme={selected?'h1':'description'}>{data.item}</Text>
|
|
102
|
+
</Button>
|
|
102
103
|
)
|
|
103
104
|
}
|
|
104
105
|
const renderSubDivisions = (data: { item:string, index:number }) => {
|
|
105
106
|
const selected = filters.sub_division == data.item ? true : false
|
|
106
107
|
return (
|
|
107
|
-
<
|
|
108
|
-
<Text
|
|
109
|
-
</
|
|
108
|
+
<Button style={{ padding:10 }} onPress={() => selected ? setFilters({ ...filters, sub_division: undefined }) : setFilters({ ...filters, sub_division:data.item })}>
|
|
109
|
+
<Text theme={selected?'h1':'description'}>{data.item}</Text>
|
|
110
|
+
</Button>
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
113
|
|
|
@@ -114,10 +115,10 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
114
115
|
const formatted_date = moment(data.item, 'YYYY/MM/DD')
|
|
115
116
|
const active = active_date == data.item ? true : false
|
|
116
117
|
return (
|
|
117
|
-
<
|
|
118
|
-
<Text size={12}
|
|
119
|
-
<Text style={{ marginTop:3 }} size={12} color={Colors.
|
|
120
|
-
</
|
|
118
|
+
<Button style={{ padding:10, justifyContent:'center', alignItems:'center' }} onPress={() => setData({ ...selector_data, active_date: data.item })}>
|
|
119
|
+
<Text size={12} theme={active?'h1':'description'} textAlign='center' >{formatted_date.format('ddd')}</Text>
|
|
120
|
+
<Text style={{ marginTop:3 }} size={12} color={Colors.text.h1} textAlign='center' theme={active?'h1':'description'}>{formatted_date.format('MMM DD')}</Text>
|
|
121
|
+
</Button>
|
|
121
122
|
)
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -125,14 +126,14 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
125
126
|
const selected = selected_team_events.map(e => e.event_id.toString()).includes(data.item.event_id.toString()) ? true : false
|
|
126
127
|
const is_live = moment(data.item.scheduled_datetime).isBefore(moment()) ? true : false
|
|
127
128
|
return (
|
|
128
|
-
<View style={{
|
|
129
|
-
<View style={{ flexDirection:'row', alignItems:'center', paddingRight:10, borderRightWidth:1, borderColor:Colors.
|
|
129
|
+
<View type='row' style={{ padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
|
|
130
|
+
<View style={{ flexDirection:'row', alignItems:'center', paddingRight:10, borderRightWidth:1, borderColor:Colors.borders.light }}>
|
|
130
131
|
<Image
|
|
131
132
|
source={{ uri: data.item.away?.image?.url }}
|
|
132
133
|
style={{ height:34, width:34, borderRadius:4 }}
|
|
133
134
|
resizeMode='cover'
|
|
134
135
|
/>
|
|
135
|
-
<Text style={{ padding:5 }} theme='
|
|
136
|
+
<Text style={{ padding:5 }} theme='description'>VS</Text>
|
|
136
137
|
<Image
|
|
137
138
|
source={{ uri: data.item.home?.image?.url }}
|
|
138
139
|
style={{ height:34, width:34, borderRadius:4 }}
|
|
@@ -140,8 +141,8 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
140
141
|
/>
|
|
141
142
|
</View>
|
|
142
143
|
<View style={{ flex:1, marginLeft: 10 }}>
|
|
143
|
-
<Text theme='
|
|
144
|
-
<Text style={{ marginTop:3 }} theme='
|
|
144
|
+
<Text theme='h2'>{data.item.event_title}</Text>
|
|
145
|
+
<Text style={{ marginTop:3 }} theme='description'>{data.item.time_detail == 'scheduled' ? moment(data.item.scheduled_datetime).format('MMM DD hh:mm a'): data.item.time_detail}</Text>
|
|
145
146
|
</View>
|
|
146
147
|
{!is_live ?
|
|
147
148
|
<Switch
|
|
@@ -159,8 +160,8 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
return (
|
|
162
|
-
<View style={{
|
|
163
|
-
<View style={{
|
|
163
|
+
<View style={{ margin:0, width, height }}>
|
|
164
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
164
165
|
{active_league ?
|
|
165
166
|
<Image
|
|
166
167
|
source={{ uri: active_league.league_image }}
|
|
@@ -168,11 +169,11 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
168
169
|
resizeMode='cover'
|
|
169
170
|
/>
|
|
170
171
|
:<></>}
|
|
171
|
-
<View style={{ flex:1, marginRight:50 }}>
|
|
172
|
-
<Text theme='
|
|
173
|
-
<Text style={{ marginTop:3 }} theme='
|
|
172
|
+
<View transparent style={{ flex:1, marginRight:50 }}>
|
|
173
|
+
<Text theme='h1'>MANAGE CONTESTS</Text>
|
|
174
|
+
<Text style={{ marginTop:3 }} theme='description'>Add / Remove contests from the competition</Text>
|
|
174
175
|
</View>
|
|
175
|
-
<View style={{ position: 'absolute', top:10, right:10, justifyContent:'center', alignItems:'center' }}>
|
|
176
|
+
<View style={{ position: 'absolute', zIndex:1, top:10, right:10, justifyContent:'center', alignItems:'center' }}>
|
|
176
177
|
<DropDown
|
|
177
178
|
dropdown_options={[
|
|
178
179
|
{value:'league_id', eligible_options: leagues.sort((a,b) => a.priority - b.priority).map(l => l.league_name)}
|
|
@@ -203,9 +204,9 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
203
204
|
{divisions.length > 1 ?
|
|
204
205
|
<View nativeID='filters' style={{ flexDirection:'row' }}>
|
|
205
206
|
{show_ranked ?
|
|
206
|
-
<
|
|
207
|
-
<Text
|
|
208
|
-
</
|
|
207
|
+
<Button style={{ padding:10 }} onPress={() => filters.ranked ? setFilters({ ...filters, ranked: false }) : setFilters({ ...filters, ranked: true })}>
|
|
208
|
+
<Text theme={filters.ranked ? 'h1':'description'}>Top 25</Text>
|
|
209
|
+
</Button>
|
|
209
210
|
:<></>}
|
|
210
211
|
<FlatList
|
|
211
212
|
data={divisions}
|
|
@@ -227,7 +228,7 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
227
228
|
:<></>}
|
|
228
229
|
<View style={{ padding:10 }}>
|
|
229
230
|
{loading ?
|
|
230
|
-
<ActivityIndicator style={{ padding:20, alignSelf:'center' }} size='large' color={Colors.
|
|
231
|
+
<ActivityIndicator style={{ padding:20, alignSelf:'center' }} size='large' color={Colors.text.h1} />
|
|
231
232
|
:<></>}
|
|
232
233
|
<FlatList
|
|
233
234
|
data={filtered_events}
|
|
@@ -236,16 +237,14 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
236
237
|
/>
|
|
237
238
|
</View>
|
|
238
239
|
</ScrollView>
|
|
239
|
-
<View style={{
|
|
240
|
+
<View type='footer' style={{ flexDirection:'row' }}>
|
|
240
241
|
{filtered_events.length > 0 ?
|
|
241
242
|
<Button
|
|
242
243
|
title='ADD ALL'
|
|
243
244
|
style={{ flex:2, marginRight:10, opacity:!show_add_all || action_loading?0.5:1 }}
|
|
244
245
|
loading={action_loading}
|
|
245
246
|
disabled={!show_add_all || action_loading}
|
|
246
|
-
|
|
247
|
-
title_color={Colors.shades.white}
|
|
248
|
-
backgroundColor={Colors.brand.electric}
|
|
247
|
+
type='success'
|
|
249
248
|
onPress={() => {
|
|
250
249
|
///First remove any event that is already selected
|
|
251
250
|
let add_events = filtered_events.filter(e => !selected_team_events.map(e => e.event_id.toString()).includes(e.event_id))
|
|
@@ -256,9 +255,7 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
|
|
|
256
255
|
<Button
|
|
257
256
|
title='CLOSE'
|
|
258
257
|
style={{ flex:1 }}
|
|
259
|
-
|
|
260
|
-
title_color={Colors.shades.white}
|
|
261
|
-
backgroundColor={Colors.utility.error}
|
|
258
|
+
type='error'
|
|
262
259
|
onPress={() => onClose()}
|
|
263
260
|
/>
|
|
264
261
|
</View>
|