be-components 1.5.4 → 1.5.5
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/Components/SearchBox.js +4 -2
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/Engage/api/index.js +23 -3
- package/lib/commonjs/Engage/api/index.js.map +1 -1
- package/lib/commonjs/Engage/components/CompanyCard.js +83 -0
- package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -0
- package/lib/commonjs/Engage/components/EngageHeader.js +181 -0
- package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -0
- package/lib/commonjs/Engage/components/PrivateCodePrompt.js +158 -0
- package/lib/commonjs/Engage/components/PrivateCodePrompt.js.map +1 -0
- package/lib/commonjs/Engage/index.js +73 -2
- package/lib/commonjs/Engage/index.js.map +1 -1
- package/lib/module/Components/SearchBox.js +4 -2
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/Engage/api/index.js +23 -3
- package/lib/module/Engage/api/index.js.map +1 -1
- package/lib/module/Engage/components/CompanyCard.js +76 -0
- package/lib/module/Engage/components/CompanyCard.js.map +1 -0
- package/lib/module/Engage/components/EngageHeader.js +172 -0
- package/lib/module/Engage/components/EngageHeader.js.map +1 -0
- package/lib/module/Engage/components/PrivateCodePrompt.js +149 -0
- package/lib/module/Engage/components/PrivateCodePrompt.js.map +1 -0
- package/lib/module/Engage/index.js +75 -4
- package/lib/module/Engage/index.js.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/Engage/api/index.d.ts +7 -0
- package/lib/typescript/src/Engage/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/CompanyCard.d.ts +9 -0
- package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -0
- package/lib/typescript/src/Engage/components/EngageHeader.d.ts +9 -0
- package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -0
- package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts +13 -0
- package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts.map +1 -0
- package/lib/typescript/src/Engage/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Components/SearchBox.tsx +4 -3
- package/src/Engage/api/index.ts +18 -3
- package/src/Engage/components/CompanyCard.tsx +48 -0
- package/src/Engage/components/EngageHeader.tsx +139 -0
- package/src/Engage/components/PrivateCodePrompt.tsx +94 -0
- package/src/Engage/index.tsx +181 -132
- package/src/types.d.ts +1 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, Image, FlatList, TouchableOpacity, ActivityIndicator } from "react-native";
|
|
3
|
+
import type { CompanyProps } from '../../types';
|
|
4
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
5
|
+
import Colors from '../../constants/colors';
|
|
6
|
+
import { Icons, Text } from '../../Components';
|
|
7
|
+
import { view_styles } from '../../constants/styles';
|
|
8
|
+
import CompanyCard from './CompanyCard';
|
|
9
|
+
import SearchBox from '../../Components/SearchBox';
|
|
10
|
+
import { EngageApi } from '../api';
|
|
11
|
+
|
|
12
|
+
type EngageHeaderProps = {
|
|
13
|
+
companies:CompanyProps[],
|
|
14
|
+
width:number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const EngageHeader = ({ companies, width }:EngageHeaderProps) => {
|
|
18
|
+
const [ active_company, setActiveComany ] = useState<number>(0);
|
|
19
|
+
const [ search, setSearch ] = useState<{
|
|
20
|
+
loading:boolean,
|
|
21
|
+
active: boolean,
|
|
22
|
+
value: string,
|
|
23
|
+
offset: number
|
|
24
|
+
}>({
|
|
25
|
+
loading:false,
|
|
26
|
+
active: false,
|
|
27
|
+
value: 'a',
|
|
28
|
+
offset:0
|
|
29
|
+
});
|
|
30
|
+
const [ found_companies, setFoundCompanies ] = useState<CompanyProps[]>([]);
|
|
31
|
+
const { active, loading, value } = search;
|
|
32
|
+
|
|
33
|
+
let filtered_companies = [ ...found_companies ]
|
|
34
|
+
filtered_companies = filtered_companies.filter(c => c.company_name.toLowerCase().includes(value.toLowerCase()))
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
getCompaniesFromServer(0);
|
|
38
|
+
},[])
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if(companies.length == 0){ return }
|
|
42
|
+
setActiveComany(0)
|
|
43
|
+
},[companies.length])
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if(companies.length == 0){ return }
|
|
47
|
+
let next_company_index = active_company + 1
|
|
48
|
+
let next_company = companies[next_company_index]
|
|
49
|
+
if(!next_company){ next_company_index = 0 }
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
setActiveComany(next_company_index)
|
|
52
|
+
}, 3000);
|
|
53
|
+
},[active_company])
|
|
54
|
+
|
|
55
|
+
const getCompaniesFromServer = async(offset:number) => {
|
|
56
|
+
const cpnys = await EngageApi.searchCompanies(value, offset);
|
|
57
|
+
setSearch({ ...search, loading: false, offset })
|
|
58
|
+
setFoundCompanies(cpnys);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const renderCompanies = (data:{ item:CompanyProps, index:number }) => {
|
|
62
|
+
return (
|
|
63
|
+
<View>
|
|
64
|
+
<CompanyCard
|
|
65
|
+
company={data.item}
|
|
66
|
+
width={width / 2.5}
|
|
67
|
+
/>
|
|
68
|
+
</View>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const company = companies[active_company]
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<View>
|
|
76
|
+
<LinearGradient colors={[Colors.brand.midnightTopGradient, Colors.brand.midnight ]} style={{ padding:20, flexDirection:'row', alignItems:'center' }}>
|
|
77
|
+
<View style={{ borderRadius:100, height:75, width:75, backgroundColor:Colors.shades.white, justifyContent:'center', alignItems:'center', ...view_styles.float }}>
|
|
78
|
+
{company ?
|
|
79
|
+
<Image
|
|
80
|
+
source={{ uri: company.company_image?.url }}
|
|
81
|
+
style={{ height:50, width:50 }}
|
|
82
|
+
resizeMode='cover'
|
|
83
|
+
/>
|
|
84
|
+
:<></>}
|
|
85
|
+
</View>
|
|
86
|
+
<View style={{ flex:1, marginLeft:20 }}>
|
|
87
|
+
<Text size={20} weight='bold' color={Colors.shades.white}>Engage with our partners</Text>
|
|
88
|
+
<Text style={{ marginTop:10 }} size={14} weight='regular' color={Colors.shades.white}>Competitions, squares, brackets are all brought to you without fees thanks to our amazing partners.</Text>
|
|
89
|
+
</View>
|
|
90
|
+
</LinearGradient>
|
|
91
|
+
<View nativeID='brands'>
|
|
92
|
+
<TouchableOpacity style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0, marginBottom:10 }} onPress={() => setSearch({ ...search, active: !active })}>
|
|
93
|
+
<View style={{ flex:1, marginRight:10 }}>
|
|
94
|
+
<Text theme='header'>{active?'Search':'Support'} Our Partners!</Text>
|
|
95
|
+
{active ?
|
|
96
|
+
<Text style={{ marginTop:3 }} theme='body'>Use the search box below to find a brand that you're interested in!</Text>
|
|
97
|
+
:
|
|
98
|
+
<Text style={{ marginTop:3 }} theme='body'>Below are brands that currently have availble competitions!</Text>
|
|
99
|
+
}
|
|
100
|
+
</View>
|
|
101
|
+
{active ?
|
|
102
|
+
<Icons.CloseIcon color={Colors.utility.error} size={18} />
|
|
103
|
+
:
|
|
104
|
+
<Icons.SearchIcon color={Colors.brand.midnight} size={18} />
|
|
105
|
+
}
|
|
106
|
+
</TouchableOpacity>
|
|
107
|
+
{active ?
|
|
108
|
+
<View>
|
|
109
|
+
<View style={{ marginBottom:10 }}>
|
|
110
|
+
<SearchBox
|
|
111
|
+
placeholder='Search our brands'
|
|
112
|
+
onChange={(text) => setSearch({ ...search, value: text })}
|
|
113
|
+
onSearch={() => getCompaniesFromServer(0)}
|
|
114
|
+
/>
|
|
115
|
+
</View>
|
|
116
|
+
{loading ?
|
|
117
|
+
<ActivityIndicator size='large' color={Colors.brand.midnight} />
|
|
118
|
+
:<></>}
|
|
119
|
+
<FlatList
|
|
120
|
+
data={filtered_companies}
|
|
121
|
+
renderItem={renderCompanies}
|
|
122
|
+
horizontal
|
|
123
|
+
keyExtractor={(item) => item.company_id.toString()}
|
|
124
|
+
/>
|
|
125
|
+
</View>
|
|
126
|
+
:
|
|
127
|
+
<FlatList
|
|
128
|
+
data={companies}
|
|
129
|
+
renderItem={renderCompanies}
|
|
130
|
+
horizontal
|
|
131
|
+
keyExtractor={(item) => item.company_id}
|
|
132
|
+
/>
|
|
133
|
+
}
|
|
134
|
+
</View>
|
|
135
|
+
</View>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export default EngageHeader
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View } from "react-native"
|
|
3
|
+
import type { BracketCompetitionProps, CompetitionProps, CompetitionSeasonProps, SquaresCompetitionProps } from '../../types';
|
|
4
|
+
import { view_styles } from '../../constants/styles';
|
|
5
|
+
import { Button, Icons, Text, TextInput } from '../../Components';
|
|
6
|
+
import Colors from '../../constants/colors';
|
|
7
|
+
import { EngageApi } from '../api';
|
|
8
|
+
|
|
9
|
+
type PrivateCodePromptProps = {
|
|
10
|
+
width:number,
|
|
11
|
+
onFoundCompetition:(c:CompetitionProps) => void,
|
|
12
|
+
onFoundSquaresCompetition:(sc:SquaresCompetitionProps) => void,
|
|
13
|
+
onFoundSeason:(cs:CompetitionSeasonProps) => void,
|
|
14
|
+
onFoundBracket:(b:BracketCompetitionProps) => void,
|
|
15
|
+
onClose:() => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const PrivateCodePrompt = ({ width, onFoundCompetition, onFoundSquaresCompetition, onFoundSeason, onFoundBracket, onClose }:PrivateCodePromptProps) => {
|
|
19
|
+
const [ search, setSearch ] = useState<{
|
|
20
|
+
loading:boolean,
|
|
21
|
+
value: string,
|
|
22
|
+
}>({
|
|
23
|
+
loading:false,
|
|
24
|
+
value: ''
|
|
25
|
+
});
|
|
26
|
+
const [ error, setError ] = useState<string|undefined>();
|
|
27
|
+
const { loading, value } = search;
|
|
28
|
+
|
|
29
|
+
const handleSearch = async() => {
|
|
30
|
+
setSearch({ ...search, loading:true });
|
|
31
|
+
const result = await EngageApi.getPrivateEngage(value);
|
|
32
|
+
setSearch({ ...search, loading:false });
|
|
33
|
+
if(result.competition){ return onFoundCompetition(result.competition) }
|
|
34
|
+
if(result.competition_season){ return onFoundSeason(result.competition_season) }
|
|
35
|
+
if(result.bracket_competition){ return onFoundBracket(result.bracket_competition) }
|
|
36
|
+
if(result.squares_competition){ return onFoundSquaresCompetition(result.squares_competition) }
|
|
37
|
+
setError('Sorry! We could not find any competitions, squares, brackets with that code.')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const search_valid = value ? true : false
|
|
41
|
+
return (
|
|
42
|
+
<View style={{ ...view_styles.section, width }}>
|
|
43
|
+
<View style={{ ...view_styles.section_header, padding:15 }}>
|
|
44
|
+
<Icons.SearchIcon color={Colors.brand.midnight} size={20}/>
|
|
45
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
46
|
+
<Text theme='header'>Find Private Competition!</Text>
|
|
47
|
+
</View>
|
|
48
|
+
</View>
|
|
49
|
+
<View style={{ ...view_styles.section_body }}>
|
|
50
|
+
<View style={{ borderRadius:8, backgroundColor:Colors.shades.shade100, padding:10 }}>
|
|
51
|
+
<Text size={18} color={Colors.brand.midnight} textAlign='center' weight='bold'>Did you receive a private code?</Text>
|
|
52
|
+
<Text style={{ marginTop:10 }} size={14} color={Colors.brand.midnight} textAlign='center' weight='regular'>Enter the code in the input section below and press FIND. If we find the competition / squares / bracket, we will send you to it!</Text>
|
|
53
|
+
|
|
54
|
+
<TextInput
|
|
55
|
+
style={{ ...view_styles.input, marginTop:20, textAlign:'center', borderRadius:22, padding:15 }}
|
|
56
|
+
placeholder='Enter Private Code'
|
|
57
|
+
placeholderTextColor={Colors.brand.slate}
|
|
58
|
+
onChangeText={(text) => {
|
|
59
|
+
if(error){ setError(undefined) }
|
|
60
|
+
setSearch({ ...search, value:text })
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
{error?
|
|
64
|
+
<View style={{ marginTop:10, padding:10 }}>
|
|
65
|
+
<Text size={14} color={Colors.utility.error} weight='bold' textAlign='center'>{error}</Text>
|
|
66
|
+
</View>
|
|
67
|
+
:<></>}
|
|
68
|
+
</View>
|
|
69
|
+
</View>
|
|
70
|
+
<View style={{ ...view_styles.section_footer }}>
|
|
71
|
+
<Button
|
|
72
|
+
title='CANCEL'
|
|
73
|
+
backgroundColor={Colors.utility.error}
|
|
74
|
+
title_color={Colors.shades.white}
|
|
75
|
+
style={{ marginRight:5 }}
|
|
76
|
+
padding={15}
|
|
77
|
+
onPress={() => onClose()}
|
|
78
|
+
/>
|
|
79
|
+
<Button
|
|
80
|
+
style={{ flex:1, opacity:search_valid&&!loading?1:0.5 }}
|
|
81
|
+
padding={15}
|
|
82
|
+
disabled={loading || !search_valid}
|
|
83
|
+
loading={loading}
|
|
84
|
+
backgroundColor={Colors.utility.success}
|
|
85
|
+
title_color={Colors.shades.white}
|
|
86
|
+
title='FIND'
|
|
87
|
+
onPress={async() => handleSearch()}
|
|
88
|
+
/>
|
|
89
|
+
</View>
|
|
90
|
+
</View>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export default PrivateCodePrompt
|
package/src/Engage/index.tsx
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, ActivityIndicator, FlatList } from 'react-native';
|
|
2
|
+
import { View, ActivityIndicator, FlatList, ScrollView } from 'react-native';
|
|
3
3
|
import type { BracketCompetitionProps, BracketProps, CompanyProps, CompetitionPayoutTypeProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, EventProps, LeagueProps, PublicPlayerProps, SquaresCompetitionProps } from '../types';
|
|
4
4
|
import Colors from '../constants/colors';
|
|
5
5
|
import { EngageApi, EngageHelpers } from './api';
|
|
6
6
|
import CompetitionCard from './components/CompetitionCard';
|
|
7
7
|
import { view_styles } from '../constants/styles';
|
|
8
|
-
import { Button, Text } from '../Components';
|
|
8
|
+
import { Button, Icons, Text } from '../Components';
|
|
9
9
|
import SquaresCompetitionCard from './components/SquaresCompetitionCard';
|
|
10
10
|
import BracketCompetitionCard from './components/BracketCompetitionCard';
|
|
11
11
|
import moment from 'moment-mini';
|
|
12
12
|
import SocketManager from '../Socket';
|
|
13
13
|
import SeasonCard from './components/SeasonCard';
|
|
14
|
+
import EngageHeader from './components/EngageHeader';
|
|
15
|
+
import PrivateCodePrompt from './components/PrivateCodePrompt';
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
type EngageModuleProps = {
|
|
@@ -29,6 +31,7 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
29
31
|
onCreateSeason, onCreateCompetition, onCreateBracketCompetition, onCreateSquares
|
|
30
32
|
}:EngageModuleProps) => {
|
|
31
33
|
const [ module_size, setModuleSize ] = useState({ width:0, height:0 });
|
|
34
|
+
const [ show_code_prompt, setShowCodePrompt ] = useState(false);
|
|
32
35
|
const [ socket_state, setSocketState ] = useState<{
|
|
33
36
|
connected:boolean,
|
|
34
37
|
reload_needed?:boolean
|
|
@@ -67,7 +70,6 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
67
70
|
});
|
|
68
71
|
const { loading, competitions, competition_seasons, competition_result_types, squares_competitions, brackets, leagues, bracket_competitions, events, competition_types, companies, players } = module_data;
|
|
69
72
|
|
|
70
|
-
|
|
71
73
|
useEffect(() => {
|
|
72
74
|
EngageApi.setEnvironment();
|
|
73
75
|
getDataFromServer()
|
|
@@ -118,6 +120,7 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
118
120
|
})
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
|
|
121
124
|
const renderSquaresCompetitions = (data: { item:SquaresCompetitionProps, index:number }) => {
|
|
122
125
|
const admin = players.find(p => p.player_id == data.item.admin_id);
|
|
123
126
|
const company = companies.find(c => c.company_id == data.item.company_id);
|
|
@@ -200,152 +203,198 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
200
203
|
}
|
|
201
204
|
|
|
202
205
|
return (
|
|
203
|
-
<View style={{ flex:1, backgroundColor:Colors.shades.white }}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
title_weight={active_tab == 'competitions' ? 'bold' : 'regular'}
|
|
212
|
-
padding={15}
|
|
213
|
-
title_size={12}
|
|
214
|
-
style={{flex:1}}
|
|
215
|
-
borderRadiusOverride={{
|
|
216
|
-
borderTopLeftRadius: 22,
|
|
217
|
-
borderBottomLeftRadius:22,
|
|
218
|
-
borderTopRightRadius:0,
|
|
219
|
-
borderBottomRightRadius:0
|
|
220
|
-
}}
|
|
221
|
-
backgroundColor={active_tab == 'competitions' ? Colors.brand.midnight : Colors.shades.white}
|
|
222
|
-
onPress={() => setActiveTab('competitions')}
|
|
206
|
+
<View style={{ flex:1, backgroundColor:Colors.shades.white }} >
|
|
207
|
+
<ScrollView style={{ flex:1 }} onLayout={(ev) => {
|
|
208
|
+
const { height, width } = ev.nativeEvent.layout;
|
|
209
|
+
setModuleSize({ width, height })
|
|
210
|
+
}}>
|
|
211
|
+
<EngageHeader
|
|
212
|
+
companies={companies}
|
|
213
|
+
width={module_size.width}
|
|
223
214
|
/>
|
|
224
|
-
<
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
215
|
+
<View style={{ ...view_styles.body_row, margin:10, backgroundColor:Colors.shades.white, borderRadius:22, borderWidth:4, borderColor:Colors.shades.shade100}}>
|
|
216
|
+
<Button
|
|
217
|
+
title='COMPETITIONS'
|
|
218
|
+
title_color={active_tab == 'competitions' ? Colors.shades.white : Colors.brand.midnight}
|
|
219
|
+
title_weight={active_tab == 'competitions' ? 'bold' : 'regular'}
|
|
220
|
+
padding={15}
|
|
221
|
+
title_size={12}
|
|
222
|
+
style={{flex:1}}
|
|
223
|
+
borderRadiusOverride={{
|
|
224
|
+
borderTopLeftRadius: 22,
|
|
225
|
+
borderBottomLeftRadius:22,
|
|
226
|
+
borderTopRightRadius:0,
|
|
227
|
+
borderBottomRightRadius:0
|
|
228
|
+
}}
|
|
229
|
+
backgroundColor={active_tab == 'competitions' ? Colors.brand.midnight : Colors.shades.white}
|
|
230
|
+
onPress={() => setActiveTab('competitions')}
|
|
231
|
+
/>
|
|
232
|
+
<Button
|
|
233
|
+
title='SQUARES'
|
|
234
|
+
title_size={12}
|
|
235
|
+
title_color={active_tab == 'squares' ? Colors.shades.white : Colors.brand.midnight}
|
|
236
|
+
title_weight={active_tab == 'squares' ? 'bold' : 'regular'}
|
|
237
|
+
padding={15}
|
|
238
|
+
style={{flex:1}}
|
|
239
|
+
borderRadius={0}
|
|
240
|
+
backgroundColor={active_tab == 'squares' ? Colors.brand.midnight : Colors.shades.white}
|
|
241
|
+
onPress={() => setActiveTab('squares')}
|
|
242
|
+
/>
|
|
243
|
+
<Button
|
|
244
|
+
title='BRACKETS'
|
|
245
|
+
style={{flex:1}}
|
|
246
|
+
title_size={12}
|
|
247
|
+
title_color={active_tab == 'brackets' ? Colors.shades.white : Colors.brand.midnight}
|
|
248
|
+
title_weight={active_tab == 'brackets' ? 'bold' : 'regular'}
|
|
249
|
+
padding={15}
|
|
250
|
+
borderRadiusOverride={{
|
|
251
|
+
borderTopLeftRadius: 0,
|
|
252
|
+
borderBottomLeftRadius:0,
|
|
253
|
+
borderTopRightRadius:22,
|
|
254
|
+
borderBottomRightRadius:22
|
|
255
|
+
}}
|
|
256
|
+
backgroundColor={active_tab == 'brackets' ? Colors.brand.midnight : Colors.shades.white}
|
|
257
|
+
onPress={() => setActiveTab('brackets')}
|
|
258
|
+
/>
|
|
259
|
+
</View>
|
|
260
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade600, borderRadius:0, marginBottom:10 }}>
|
|
261
|
+
<Icons.EyeOffIcon size={18} color={Colors.brand.midnight} />
|
|
262
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
263
|
+
<Text theme='header'>Find Private</Text>
|
|
264
|
+
<Text style={{ marginTop:3 }} theme='body'>Did you receive a private code? Enter it here.</Text>
|
|
269
265
|
</View>
|
|
270
|
-
<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
266
|
+
<Button
|
|
267
|
+
title='ENTER PRIVATE CODE'
|
|
268
|
+
padding={15}
|
|
269
|
+
title_color={Colors.shades.white}
|
|
270
|
+
backgroundColor={Colors.utility.success}
|
|
271
|
+
onPress={() => setShowCodePrompt(true)}
|
|
275
272
|
/>
|
|
276
273
|
</View>
|
|
277
|
-
|
|
278
|
-
<View style={{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
<
|
|
274
|
+
{active_tab == 'competitions' ?
|
|
275
|
+
<View style={{ ...view_styles.section_body, justifyContent:'flex-start', padding:0 }}>
|
|
276
|
+
{competition_seasons.length > 0 ?
|
|
277
|
+
<View style={{ marginTop:10 }}>
|
|
278
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0, marginBottom:10 }}>
|
|
279
|
+
<View style={{ flex:1 }}>
|
|
280
|
+
<Text theme='header'>Public Seasons</Text>
|
|
281
|
+
<Text style={{ marginTop:3 }} theme='body'>Seasons are multi-competition contests. Payouts are split between each competition and the season long winners.</Text>
|
|
282
|
+
</View>
|
|
283
|
+
{onCreateSeason ?
|
|
284
|
+
<Button
|
|
285
|
+
title='NEW'
|
|
286
|
+
title_color={Colors.shades.white}
|
|
287
|
+
backgroundColor={Colors.utility.success}
|
|
288
|
+
onPress={() => onCreateSeason()}
|
|
289
|
+
/>
|
|
290
|
+
:<></>}
|
|
283
291
|
</View>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
onPress={() => onCreateCompetition()}
|
|
292
|
+
<FlatList
|
|
293
|
+
data={competition_seasons.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
|
|
294
|
+
horizontal
|
|
295
|
+
keyExtractor={(item) => item.competition_season_id.toString()}
|
|
296
|
+
renderItem={renderSeasons}
|
|
290
297
|
/>
|
|
291
|
-
:<></>}
|
|
292
298
|
</View>
|
|
299
|
+
:<></>}
|
|
300
|
+
<View style={{ marginBottom:15, marginTop:10 }}>
|
|
301
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0 }}>
|
|
302
|
+
<View style={{ flex:1 }}>
|
|
303
|
+
<Text theme='header'>Public Competitions</Text>
|
|
304
|
+
<Text style={{ marginTop:3 }} theme='body'>Below are available pick-em and wager based competitions. All competitions are offered with 0 fees. All ticket sales are paid out to the winners!</Text>
|
|
305
|
+
</View>
|
|
306
|
+
{onCreateCompetition ?
|
|
307
|
+
<Button
|
|
308
|
+
title='NEW'
|
|
309
|
+
title_color={Colors.shades.white}
|
|
310
|
+
backgroundColor={Colors.utility.success}
|
|
311
|
+
onPress={() => onCreateCompetition()}
|
|
312
|
+
/>
|
|
313
|
+
:<></>}
|
|
314
|
+
</View>
|
|
315
|
+
</View>
|
|
316
|
+
<FlatList
|
|
317
|
+
data={competitions.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
|
|
318
|
+
renderItem={renderCompetitions}
|
|
319
|
+
keyExtractor={(item) => item.competition_id.toString()}
|
|
320
|
+
/>
|
|
293
321
|
</View>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
322
|
+
:active_tab == 'squares' ?
|
|
323
|
+
<View style={{ ...view_styles.section_body, padding:0 }}>
|
|
324
|
+
<View style={{ marginBottom:15, marginTop:10 }}>
|
|
325
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0 }}>
|
|
326
|
+
<View style={{ flex:1 }}>
|
|
327
|
+
<Text theme='header'>Public Auction Squares</Text>
|
|
328
|
+
<Text style={{ marginTop:3 }} theme='body'>Below are available squares competitions. Bid on squares until the auction period ends. Win $ and prizes when your square hits at the end of each quarter!</Text>
|
|
329
|
+
</View>
|
|
330
|
+
{onCreateSquares ?
|
|
331
|
+
<Button
|
|
332
|
+
title='NEW'
|
|
333
|
+
title_color={Colors.shades.white}
|
|
334
|
+
backgroundColor={Colors.utility.success}
|
|
335
|
+
onPress={() => onCreateSquares()}
|
|
336
|
+
/>
|
|
337
|
+
:<></>}
|
|
307
338
|
</View>
|
|
308
|
-
{onCreateSquares ?
|
|
309
|
-
<Button
|
|
310
|
-
title='NEW'
|
|
311
|
-
title_color={Colors.shades.white}
|
|
312
|
-
backgroundColor={Colors.utility.success}
|
|
313
|
-
onPress={() => onCreateSquares()}
|
|
314
|
-
/>
|
|
315
|
-
:<></>}
|
|
316
339
|
</View>
|
|
340
|
+
<FlatList
|
|
341
|
+
data={squares_competitions.sort((a,b) => moment(a.begin_datetime).unix() - moment(b.begin_datetime).unix())}
|
|
342
|
+
renderItem={renderSquaresCompetitions}
|
|
343
|
+
keyExtractor={(item) => item.sq_comp_id.toString()}
|
|
344
|
+
/>
|
|
317
345
|
</View>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
346
|
+
:active_tab == 'brackets' ?
|
|
347
|
+
<View style={{ ...view_styles.section_body, padding:0 }}>
|
|
348
|
+
<View style={{ marginBottom:15, marginTop:10 }}>
|
|
349
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0 }}>
|
|
350
|
+
<View style={{ flex:1 }}>
|
|
351
|
+
<Text theme='header'>Public Bracket Competitions</Text>
|
|
352
|
+
<Text style={{ marginTop:3 }} theme='body'>Below are available bracket competitions. All competitions are offered with 0 fees. All ticket sales are paid out to the winners!</Text>
|
|
353
|
+
</View>
|
|
354
|
+
{onCreateBracketCompetition ?
|
|
355
|
+
<Button
|
|
356
|
+
title='NEW'
|
|
357
|
+
title_color={Colors.shades.white}
|
|
358
|
+
backgroundColor={Colors.utility.success}
|
|
359
|
+
onPress={() => onCreateBracketCompetition()}
|
|
360
|
+
/>
|
|
361
|
+
:<></>}
|
|
331
362
|
</View>
|
|
332
|
-
{onCreateBracketCompetition ?
|
|
333
|
-
<Button
|
|
334
|
-
title='NEW'
|
|
335
|
-
title_color={Colors.shades.white}
|
|
336
|
-
backgroundColor={Colors.utility.success}
|
|
337
|
-
onPress={() => onCreateBracketCompetition()}
|
|
338
|
-
/>
|
|
339
|
-
:<></>}
|
|
340
363
|
</View>
|
|
364
|
+
<FlatList
|
|
365
|
+
data={bracket_competitions.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
|
|
366
|
+
renderItem={renderBracketCompetitions}
|
|
367
|
+
keyExtractor={(item) => item.bracket_competition_id.toString()}
|
|
368
|
+
/>
|
|
341
369
|
</View>
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
370
|
+
:<></>}
|
|
371
|
+
</ScrollView>
|
|
372
|
+
{show_code_prompt ?
|
|
373
|
+
<View style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'flex-end', backgroundColor:Colors.shades.black_faded_heavy }}>
|
|
374
|
+
<PrivateCodePrompt
|
|
375
|
+
width={module_size.width - 20}
|
|
376
|
+
onFoundBracket={(b) => {
|
|
377
|
+
onSelectBracketCompetition(b)
|
|
378
|
+
setShowCodePrompt(false);
|
|
379
|
+
}}
|
|
380
|
+
onFoundCompetition={(c) => {
|
|
381
|
+
onSelectCompetition(c)
|
|
382
|
+
setShowCodePrompt(false);
|
|
383
|
+
|
|
384
|
+
}}
|
|
385
|
+
onFoundSeason={(s) => {
|
|
386
|
+
onSelectCompetitionSeason(s)
|
|
387
|
+
setShowCodePrompt(false);
|
|
388
|
+
}}
|
|
389
|
+
onFoundSquaresCompetition={(sc) => {
|
|
390
|
+
onSelectSquaresCompetition(sc)
|
|
391
|
+
setShowCodePrompt(false);
|
|
392
|
+
}}
|
|
393
|
+
onClose={() => setShowCodePrompt(false)}
|
|
346
394
|
/>
|
|
347
395
|
</View>
|
|
348
396
|
:<></>}
|
|
397
|
+
|
|
349
398
|
<SocketManager
|
|
350
399
|
onConnect={() => setSocketState({ ...socket_state, connected: true })}
|
|
351
400
|
subscribed_events={[]}
|