be-components 3.4.2 → 3.4.3
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/Icons.js +30 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/SearchBox.js +17 -23
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/Components/Themed.js +2 -2
- package/lib/commonjs/Components/Themed.js.map +1 -1
- package/lib/commonjs/Engage/components/BracketCompetitionCard.js +75 -58
- package/lib/commonjs/Engage/components/BracketCompetitionCard.js.map +1 -1
- package/lib/commonjs/Engage/components/CompanyCard.js +31 -26
- package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -1
- package/lib/commonjs/Engage/components/CompetitionCard.js +85 -68
- package/lib/commonjs/Engage/components/CompetitionCard.js.map +1 -1
- package/lib/commonjs/Engage/components/EngageHeader.js +62 -36
- package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -1
- package/lib/commonjs/Engage/components/PrivateCodePrompt.js +47 -45
- package/lib/commonjs/Engage/components/PrivateCodePrompt.js.map +1 -1
- package/lib/commonjs/Engage/components/SquaresCompetitionCard.js +69 -56
- package/lib/commonjs/Engage/components/SquaresCompetitionCard.js.map +1 -1
- package/lib/commonjs/Engage/index.js +262 -259
- package/lib/commonjs/Engage/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +69 -46
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +1 -1
- package/lib/commonjs/constants/styles.js.map +1 -1
- package/lib/commonjs/constants/useColors.js +6 -3
- package/lib/commonjs/constants/useColors.js.map +1 -1
- package/lib/module/Components/Icons.js +30 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/SearchBox.js +11 -17
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/Components/Themed.js +2 -2
- package/lib/module/Components/Themed.js.map +1 -1
- package/lib/module/Engage/components/BracketCompetitionCard.js +52 -35
- package/lib/module/Engage/components/BracketCompetitionCard.js.map +1 -1
- package/lib/module/Engage/components/CompanyCard.js +27 -21
- package/lib/module/Engage/components/CompanyCard.js.map +1 -1
- package/lib/module/Engage/components/CompetitionCard.js +57 -40
- package/lib/module/Engage/components/CompetitionCard.js.map +1 -1
- package/lib/module/Engage/components/EngageHeader.js +53 -27
- package/lib/module/Engage/components/EngageHeader.js.map +1 -1
- package/lib/module/Engage/components/PrivateCodePrompt.js +36 -33
- package/lib/module/Engage/components/PrivateCodePrompt.js.map +1 -1
- package/lib/module/Engage/components/SquaresCompetitionCard.js +51 -38
- package/lib/module/Engage/components/SquaresCompetitionCard.js.map +1 -1
- package/lib/module/Engage/index.js +262 -259
- package/lib/module/Engage/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js +69 -46
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/module/constants/styles.js +1 -1
- package/lib/module/constants/styles.js.map +1 -1
- package/lib/module/constants/useColors.js +6 -3
- package/lib/module/constants/useColors.js.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/CompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Engage/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants/styles.d.ts +1 -1
- package/lib/typescript/lib/commonjs/constants/useColors.d.ts +5 -4
- package/lib/typescript/lib/commonjs/constants/useColors.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts +1 -2
- package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts +2 -4
- package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/index.d.ts +3 -3
- package/lib/typescript/lib/module/Engage/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/constants/useColors.d.ts +71 -0
- package/lib/typescript/lib/module/constants/useColors.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/CompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts +1 -2
- package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/index.d.ts +5 -1
- package/lib/typescript/src/Engage/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/constants/useColors.d.ts +71 -0
- package/lib/typescript/src/constants/useColors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Components/Icons.tsx +16 -0
- package/src/Components/SearchBox.tsx +11 -13
- package/src/Components/Themed.tsx +3 -3
- package/src/Engage/components/BracketCompetitionCard.tsx +34 -31
- package/src/Engage/components/CompanyCard.tsx +17 -19
- package/src/Engage/components/CompetitionCard.tsx +40 -35
- package/src/Engage/components/EngageHeader.tsx +30 -29
- package/src/Engage/components/PrivateCodePrompt.tsx +29 -33
- package/src/Engage/components/SquaresCompetitionCard.tsx +33 -29
- package/src/Engage/index.tsx +191 -187
- package/src/MarketComponents/components/TeamEventMarket/index.tsx +55 -44
- package/src/constants/styles.ts +1 -1
- package/src/constants/useColors.tsx +7 -5
package/src/Engage/index.tsx
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ActivityIndicator, FlatList, KeyboardAvoidingView, Modal, Platform } from 'react-native';
|
|
3
3
|
import type { BEEventProps, BracketCompetitionProps, BracketProps, CompanyProps, CompetitionPayoutTypeProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, EventProps, LeagueProps, PublicPlayerProps, SquaresCompetitionProps } from '../types';
|
|
4
|
-
import Colors from '../constants/colors';
|
|
5
4
|
import { EngageApi, EngageHelpers } from './api';
|
|
6
5
|
import CompetitionCard from './components/CompetitionCard';
|
|
7
|
-
import {
|
|
8
|
-
import { Button, Icons, Text } from '../Components';
|
|
6
|
+
import { Icons, Toggle } from '../Components';
|
|
9
7
|
import SquaresCompetitionCard from './components/SquaresCompetitionCard';
|
|
10
8
|
import BracketCompetitionCard from './components/BracketCompetitionCard';
|
|
11
9
|
import moment from 'moment-mini';
|
|
@@ -13,10 +11,13 @@ import SocketManager from '../Socket';
|
|
|
13
11
|
import SeasonCard from './components/SeasonCard';
|
|
14
12
|
import EngageHeader from './components/EngageHeader';
|
|
15
13
|
import PrivateCodePrompt from './components/PrivateCodePrompt';
|
|
14
|
+
import { Button, Text, View } from '../Components/Themed';
|
|
15
|
+
import { useColors } from '../constants/useColors';
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
type EngageModuleProps = {
|
|
19
19
|
player_id?:string,
|
|
20
|
+
insets?: { top:number, bottom:number },
|
|
20
21
|
onEvent?:(be_event:BEEventProps) => void,
|
|
21
22
|
onManage:() => void,
|
|
22
23
|
onCreateSeason?:() => void,
|
|
@@ -30,7 +31,9 @@ type EngageModuleProps = {
|
|
|
30
31
|
onSelectCompetitionSeason:(cs:CompetitionSeasonProps) => void
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
const
|
|
34
|
+
const engage_sections = ['header','toggle', 'private','engagements']
|
|
35
|
+
|
|
36
|
+
const EngageModule = ({ insets, onSelectBracketCompetition, onSelectCompetition, onSelectSquaresCompetition, onSelectCompetitionSeason,
|
|
34
37
|
onCreateSeason, onCreateCompetition, onCreateBracketCompetition, onCreateSquares, onManage, onEvent, onSelectCompany
|
|
35
38
|
}:EngageModuleProps) => {
|
|
36
39
|
const [ module_size, setModuleSize ] = useState({ width:0, height:0 });
|
|
@@ -73,6 +76,8 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
73
76
|
});
|
|
74
77
|
const { loading, competitions, competition_seasons, competition_result_types, squares_competitions, brackets, leagues, bracket_competitions, events, competition_types, companies, players } = module_data;
|
|
75
78
|
|
|
79
|
+
const Colors = useColors();
|
|
80
|
+
|
|
76
81
|
useEffect(() => {
|
|
77
82
|
EngageApi.setEnvironment();
|
|
78
83
|
getDataFromServer()
|
|
@@ -129,7 +134,7 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
129
134
|
const company = companies.find(c => c.company_id == data.item.company_id);
|
|
130
135
|
const event = events.find(e => e.event_id == data.item.event_id)
|
|
131
136
|
return (
|
|
132
|
-
<View>
|
|
137
|
+
<View transparent style={{ margin:10 }}>
|
|
133
138
|
<SquaresCompetitionCard
|
|
134
139
|
squares_competition={data.item}
|
|
135
140
|
company={company}
|
|
@@ -150,7 +155,7 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
150
155
|
const league = leagues.find(e => e.league_id == bracket?.league_id)
|
|
151
156
|
if(!competition_result_type){ return <></> }
|
|
152
157
|
return (
|
|
153
|
-
<View>
|
|
158
|
+
<View transparent style={{ margin:10 }}>
|
|
154
159
|
<BracketCompetitionCard
|
|
155
160
|
bracket_competition={data.item}
|
|
156
161
|
company={company}
|
|
@@ -183,7 +188,7 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
183
188
|
const competition_result_type = competition_result_types.find(t => t.competition_result_type_id == data.item.competition_result_type_id);
|
|
184
189
|
if(!competition_type || !competition_result_type){ return <></> }
|
|
185
190
|
return (
|
|
186
|
-
<View>
|
|
191
|
+
<View transparent style={{ margin:10 }}>
|
|
187
192
|
<CompetitionCard
|
|
188
193
|
competition={data.item}
|
|
189
194
|
company={company}
|
|
@@ -197,210 +202,209 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
|
|
|
197
202
|
)
|
|
198
203
|
}
|
|
199
204
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
)
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return (
|
|
209
|
-
<View style={{ flex:1, backgroundColor:Colors.shades.white }} >
|
|
210
|
-
<ScrollView style={{ flex:1 }} onLayout={(ev) => {
|
|
211
|
-
const { height, width } = ev.nativeEvent.layout;
|
|
212
|
-
setModuleSize({ width, height })
|
|
213
|
-
}}>
|
|
214
|
-
<EngageHeader
|
|
205
|
+
const renderSections = (data:{item:string, index:number}) => {
|
|
206
|
+
switch(data.item){
|
|
207
|
+
case 'header':
|
|
208
|
+
return (
|
|
209
|
+
<EngageHeader
|
|
215
210
|
companies={companies}
|
|
216
211
|
width={module_size.width}
|
|
217
212
|
onManage={onManage}
|
|
218
213
|
onEvent={onEvent}
|
|
219
214
|
onSelectCompany={onSelectCompany}
|
|
220
215
|
/>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
onPress={() => setActiveTab('competitions')}
|
|
237
|
-
/>
|
|
238
|
-
<Button
|
|
239
|
-
title='SQUARES'
|
|
240
|
-
title_size={12}
|
|
241
|
-
title_color={active_tab == 'squares' ? Colors.shades.white : Colors.brand.midnight}
|
|
242
|
-
title_weight={active_tab == 'squares' ? 'bold' : 'regular'}
|
|
243
|
-
padding={15}
|
|
244
|
-
style={{flex:1}}
|
|
245
|
-
borderRadius={0}
|
|
246
|
-
backgroundColor={active_tab == 'squares' ? Colors.brand.midnight : Colors.shades.white}
|
|
247
|
-
onPress={() => setActiveTab('squares')}
|
|
248
|
-
/>
|
|
249
|
-
<Button
|
|
250
|
-
title='BRACKETS'
|
|
251
|
-
style={{flex:1}}
|
|
252
|
-
title_size={12}
|
|
253
|
-
title_color={active_tab == 'brackets' ? Colors.shades.white : Colors.brand.midnight}
|
|
254
|
-
title_weight={active_tab == 'brackets' ? 'bold' : 'regular'}
|
|
255
|
-
padding={15}
|
|
256
|
-
borderRadiusOverride={{
|
|
257
|
-
borderTopLeftRadius: 0,
|
|
258
|
-
borderBottomLeftRadius:0,
|
|
259
|
-
borderTopRightRadius:22,
|
|
260
|
-
borderBottomRightRadius:22
|
|
261
|
-
}}
|
|
262
|
-
backgroundColor={active_tab == 'brackets' ? Colors.brand.midnight : Colors.shades.white}
|
|
263
|
-
onPress={() => setActiveTab('brackets')}
|
|
264
|
-
/>
|
|
265
|
-
</View>
|
|
266
|
-
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade600, borderRadius:0, marginBottom:10 }}>
|
|
267
|
-
<Icons.EyeOffIcon size={18} color={Colors.brand.midnight} />
|
|
268
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
269
|
-
<Text theme='header'>Find Private</Text>
|
|
270
|
-
<Text style={{ marginTop:3 }} theme='body'>Did you receive a private code? Enter it here.</Text>
|
|
216
|
+
)
|
|
217
|
+
case 'toggle':
|
|
218
|
+
return (
|
|
219
|
+
<View float style={{ margin:10 }}>
|
|
220
|
+
<Toggle
|
|
221
|
+
background_color={Colors.views.header}
|
|
222
|
+
inactive_title_color={Colors.text.h1}
|
|
223
|
+
options={[
|
|
224
|
+
{key:'competitions', label: 'Competitions'},
|
|
225
|
+
{key:'brackets', label: 'Brackets'},
|
|
226
|
+
{key:'squares', label: 'Squares'},
|
|
227
|
+
]}
|
|
228
|
+
selected_option={active_tab}
|
|
229
|
+
onSelectOption={(option) => setActiveTab(option)}
|
|
230
|
+
/>
|
|
271
231
|
</View>
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
{active_tab == 'competitions' ?
|
|
281
|
-
<View style={{ ...view_styles.section_body, justifyContent:'flex-start', padding:0 }}>
|
|
282
|
-
{competition_seasons.length > 0 ?
|
|
283
|
-
<View style={{ marginTop:10 }}>
|
|
284
|
-
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0, marginBottom:10 }}>
|
|
285
|
-
<View style={{ flex:1 }}>
|
|
286
|
-
<Text theme='header'>Public Seasons</Text>
|
|
287
|
-
<Text style={{ marginTop:3 }} theme='body'>Seasons are multi-competition contests. Payouts are split between each competition and the season long winners.</Text>
|
|
288
|
-
</View>
|
|
289
|
-
{onCreateSeason ?
|
|
290
|
-
<Button
|
|
291
|
-
title='NEW'
|
|
292
|
-
title_color={Colors.shades.white}
|
|
293
|
-
backgroundColor={Colors.utility.success}
|
|
294
|
-
onPress={() => onCreateSeason()}
|
|
295
|
-
/>
|
|
296
|
-
:<></>}
|
|
232
|
+
)
|
|
233
|
+
case 'private':
|
|
234
|
+
return (
|
|
235
|
+
<View type='header' style={{ padding:10, marginBottom:10, flexDirection:'row', alignItems:'center' }}>
|
|
236
|
+
<Icons.EyeOffIcon size={18} color={Colors.text.h1} />
|
|
237
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
238
|
+
<Text theme='h1'>Find Private</Text>
|
|
239
|
+
<Text style={{ marginTop:3 }} theme='description'>Did you receive a private code? Enter it here.</Text>
|
|
297
240
|
</View>
|
|
298
|
-
<
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
renderItem={renderSeasons}
|
|
241
|
+
<Button
|
|
242
|
+
title='ENTER PRIVATE CODE'
|
|
243
|
+
type='text'
|
|
244
|
+
onPress={() => setShowCodePrompt(true)}
|
|
303
245
|
/>
|
|
304
246
|
</View>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
247
|
+
)
|
|
248
|
+
case 'engagements':
|
|
249
|
+
return (
|
|
250
|
+
<View transparent>
|
|
251
|
+
{active_tab == 'competitions' ?
|
|
252
|
+
<View transparent>
|
|
253
|
+
{competition_seasons.length > 0 ?
|
|
254
|
+
<View transparent style={{ marginTop:10 }}>
|
|
255
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
256
|
+
<View style={{ flex:1 }}>
|
|
257
|
+
<Text theme='h1'>Public Seasons</Text>
|
|
258
|
+
<Text style={{ marginTop:3 }} theme='description'>Seasons are multi-competition contests. Payouts are split between each competition and the season long winners.</Text>
|
|
259
|
+
</View>
|
|
260
|
+
{onCreateSeason ?
|
|
261
|
+
<Button
|
|
262
|
+
title='NEW'
|
|
263
|
+
type='success'
|
|
264
|
+
onPress={() => onCreateSeason()}
|
|
265
|
+
/>
|
|
266
|
+
:<></>}
|
|
267
|
+
</View>
|
|
268
|
+
<FlatList
|
|
269
|
+
data={competition_seasons.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
|
|
270
|
+
horizontal
|
|
271
|
+
keyExtractor={(item) => item.competition_season_id.toString()}
|
|
272
|
+
renderItem={renderSeasons}
|
|
273
|
+
/>
|
|
311
274
|
</View>
|
|
312
|
-
{onCreateCompetition ?
|
|
313
|
-
<Button
|
|
314
|
-
title='NEW'
|
|
315
|
-
title_color={Colors.shades.white}
|
|
316
|
-
backgroundColor={Colors.utility.success}
|
|
317
|
-
onPress={() => onCreateCompetition()}
|
|
318
|
-
/>
|
|
319
275
|
:<></>}
|
|
276
|
+
<View transparent style={{ marginBottom:15, marginTop:10 }}>
|
|
277
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
278
|
+
<View transparent style={{ flex:1 }}>
|
|
279
|
+
<Text theme='h1'>Public Competitions</Text>
|
|
280
|
+
<Text style={{ marginTop:3 }} theme='description'>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>
|
|
281
|
+
</View>
|
|
282
|
+
{onCreateCompetition ?
|
|
283
|
+
<Button
|
|
284
|
+
title='NEW'
|
|
285
|
+
type='success'
|
|
286
|
+
onPress={() => onCreateCompetition()}
|
|
287
|
+
/>
|
|
288
|
+
:<></>}
|
|
289
|
+
|
|
290
|
+
</View>
|
|
291
|
+
<FlatList
|
|
292
|
+
data={competitions.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
|
|
293
|
+
renderItem={renderCompetitions}
|
|
294
|
+
keyExtractor={(item) => item.competition_id.toString()}
|
|
295
|
+
/>
|
|
296
|
+
</View>
|
|
320
297
|
</View>
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
298
|
+
:active_tab == 'squares' ?
|
|
299
|
+
<View transparent>
|
|
300
|
+
<View transparent style={{ marginBottom:15, marginTop:10 }}>
|
|
301
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
302
|
+
<View transparent style={{ flex:1 }}>
|
|
303
|
+
<Text theme='h1'>Public Auction Squares</Text>
|
|
304
|
+
<Text style={{ marginTop:3 }} theme='description'>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>
|
|
305
|
+
</View>
|
|
306
|
+
{onCreateSquares ?
|
|
307
|
+
<Button
|
|
308
|
+
title='NEW'
|
|
309
|
+
type='success'
|
|
310
|
+
onPress={() => onCreateSquares()}
|
|
311
|
+
/>
|
|
312
|
+
:<></>}
|
|
313
|
+
</View>
|
|
335
314
|
</View>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
backgroundColor={Colors.utility.success}
|
|
341
|
-
onPress={() => onCreateSquares()}
|
|
315
|
+
<FlatList
|
|
316
|
+
data={squares_competitions.sort((a,b) => moment(a.begin_datetime).unix() - moment(b.begin_datetime).unix())}
|
|
317
|
+
renderItem={renderSquaresCompetitions}
|
|
318
|
+
keyExtractor={(item) => item.sq_comp_id.toString()}
|
|
342
319
|
/>
|
|
343
|
-
:<></>}
|
|
344
320
|
</View>
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
321
|
+
:active_tab == 'brackets' ?
|
|
322
|
+
<View transparent>
|
|
323
|
+
<View transparent style={{ marginBottom:15, marginTop:10 }}>
|
|
324
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
325
|
+
<View transparent style={{ flex:1 }}>
|
|
326
|
+
<Text theme='h1'>Public Bracket Competitions</Text>
|
|
327
|
+
<Text style={{ marginTop:3 }} theme='description'>Below are available bracket competitions. All competitions are offered with 0 fees. All ticket sales are paid out to the winners!</Text>
|
|
328
|
+
</View>
|
|
329
|
+
{onCreateBracketCompetition ?
|
|
330
|
+
<Button
|
|
331
|
+
title='NEW'
|
|
332
|
+
type='success'
|
|
333
|
+
onPress={() => onCreateBracketCompetition()}
|
|
334
|
+
/>
|
|
335
|
+
:<></>}
|
|
336
|
+
</View>
|
|
359
337
|
</View>
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
backgroundColor={Colors.utility.success}
|
|
365
|
-
onPress={() => onCreateBracketCompetition()}
|
|
338
|
+
<FlatList
|
|
339
|
+
data={bracket_competitions.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
|
|
340
|
+
renderItem={renderBracketCompetitions}
|
|
341
|
+
keyExtractor={(item) => item.bracket_competition_id.toString()}
|
|
366
342
|
/>
|
|
367
|
-
:<></>}
|
|
368
343
|
</View>
|
|
344
|
+
:<></>}
|
|
369
345
|
</View>
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
346
|
+
)
|
|
347
|
+
default: return <></>
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
return (
|
|
352
|
+
<View style={{ flexGrow:1 }} onLayout={(ev) => {
|
|
353
|
+
const { height, width } = ev.nativeEvent.layout;
|
|
354
|
+
setModuleSize({ width, height })
|
|
355
|
+
}}>
|
|
356
|
+
<FlatList
|
|
357
|
+
data={engage_sections}
|
|
358
|
+
key={`engage_sections`}
|
|
359
|
+
keyExtractor={(item) => item}
|
|
360
|
+
renderItem={renderSections}
|
|
361
|
+
refreshing={loading}
|
|
362
|
+
onRefresh={() => getDataFromServer()}
|
|
363
|
+
/>
|
|
364
|
+
|
|
378
365
|
{show_code_prompt ?
|
|
379
|
-
<
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
366
|
+
<Modal
|
|
367
|
+
transparent
|
|
368
|
+
animationType='slide'
|
|
369
|
+
style={{ flex:1 }}
|
|
370
|
+
>
|
|
371
|
+
<KeyboardAvoidingView
|
|
372
|
+
style={{ flex:1 }}
|
|
373
|
+
behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
|
|
374
|
+
>
|
|
375
|
+
<View type='blur' style={{ flex:1, justifyContent:'flex-end', paddingBottom:insets?.bottom }}>
|
|
376
|
+
<PrivateCodePrompt
|
|
377
|
+
onFoundBracket={(b) => {
|
|
378
|
+
onSelectBracketCompetition(b)
|
|
379
|
+
setShowCodePrompt(false);
|
|
380
|
+
}}
|
|
381
|
+
onFoundCompetition={(c) => {
|
|
382
|
+
onSelectCompetition(c)
|
|
383
|
+
setShowCodePrompt(false);
|
|
389
384
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
385
|
+
}}
|
|
386
|
+
onFoundSeason={(s) => {
|
|
387
|
+
onSelectCompetitionSeason(s)
|
|
388
|
+
setShowCodePrompt(false);
|
|
389
|
+
}}
|
|
390
|
+
onFoundSquaresCompetition={(sc) => {
|
|
391
|
+
onSelectSquaresCompetition(sc)
|
|
392
|
+
setShowCodePrompt(false);
|
|
393
|
+
}}
|
|
394
|
+
onClose={() => setShowCodePrompt(false)}
|
|
395
|
+
/>
|
|
396
|
+
</View>
|
|
397
|
+
</KeyboardAvoidingView>
|
|
398
|
+
</Modal>
|
|
399
|
+
:<></>}
|
|
400
|
+
{loading ?
|
|
401
|
+
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, alignItems:'center', padding:20 }}>
|
|
402
|
+
<ActivityIndicator
|
|
403
|
+
size='large'
|
|
404
|
+
color={Colors.text.h1}
|
|
400
405
|
/>
|
|
401
406
|
</View>
|
|
402
407
|
:<></>}
|
|
403
|
-
|
|
404
408
|
<SocketManager
|
|
405
409
|
onConnect={() => setSocketState({ ...socket_state, connected: true })}
|
|
406
410
|
subscribed_events={[]}
|
|
@@ -333,39 +333,45 @@ const TeamEventMarket = ({ event, league, float, style, init_expanded, hot_marke
|
|
|
333
333
|
<View float={float} style={[style]}>
|
|
334
334
|
{sponsor ?
|
|
335
335
|
<LinearGradient style={{ marginTop:-1, marginLeft:-1, marginRight:-1, padding:10, flexDirection:'row', alignItems:'center', borderTopRightRadius:8, borderTopLeftRadius:8 }} start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[sponsor.brand_primary ?? C.text.h1, sponsor.brand_secondary ?? C.text.h1]}>
|
|
336
|
-
|
|
336
|
+
{onActivate && event_status != 'closed' ?
|
|
337
|
+
<Button
|
|
338
|
+
float
|
|
339
|
+
style={{ opacity: activate_loading ? 0.5 : 1, backgroundColor:C.text.success, padding:0, height:34, width:34, justifyContent:'center', alignItems:'center', borderRadius:100 }}
|
|
340
|
+
disabled={activate_loading}
|
|
341
|
+
loading={activate_loading}
|
|
342
|
+
|
|
343
|
+
onPress={() => onActivate(event.event_id, 'team')}
|
|
344
|
+
>
|
|
345
|
+
<Icons.RefreshIcon size={20} color={C.text.white} />
|
|
346
|
+
</Button>
|
|
347
|
+
:
|
|
348
|
+
<View transparent style={{ height:30, width:30, borderRadius:4, backgroundColor:Colors.shades.white }}>
|
|
349
|
+
|
|
337
350
|
<Image
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
351
|
+
source={{ uri: sponsor.company_image?.url }}
|
|
352
|
+
style={{ height:30, width:30, borderRadius:4 }}
|
|
353
|
+
resizeMode='cover'
|
|
341
354
|
/>
|
|
342
|
-
|
|
355
|
+
</View>
|
|
356
|
+
}
|
|
343
357
|
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
344
358
|
<Text size={12} color={Colors.shades.white} weight='bold'>Brought to you by {sponsor.company_name}</Text>
|
|
345
|
-
<View transparent style={{ marginTop:3, flexDirection:'row', alignItems:'center' }}>
|
|
346
|
-
{
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
359
|
+
<View transparent style={{ marginTop:3, flexDirection:'row', alignItems:'center' }}>
|
|
360
|
+
<View style={{ marginLeft:5 }} transparent>
|
|
361
|
+
{event.event_sub_title ?
|
|
362
|
+
<Text size={12} style={{ maxWidth:150 }} theme='description'>{event.event_sub_title}</Text>
|
|
363
|
+
:<></>}
|
|
364
|
+
{show_id ?
|
|
365
|
+
<Text theme='light' selectable>{event.event_id} </Text>
|
|
366
|
+
:<></>}
|
|
367
|
+
</View>
|
|
352
368
|
</View>
|
|
353
369
|
</View>
|
|
354
370
|
<View transparent style={{ flexDirection:'row', alignItems:'center' }}>
|
|
355
371
|
<Icons.TVIcon size={10} color={Colors.shades.white} />
|
|
356
372
|
<Text style={{ marginLeft:8 }} size={12} color={Colors.shades.white} weight='semibold'>{event.info?.broadcast?.network}</Text>
|
|
357
373
|
</View>
|
|
358
|
-
|
|
359
|
-
<Button
|
|
360
|
-
title={event_status == 'active' ? 'Refresh' : 'Activate'}
|
|
361
|
-
style={{ opacity: activate_loading ? 0.5 : 1, marginLeft:5 }}
|
|
362
|
-
disabled={activate_loading}
|
|
363
|
-
loading={activate_loading}
|
|
364
|
-
title_color={Colors.shades.white}
|
|
365
|
-
backgroundColor={Colors.utility.success}
|
|
366
|
-
onPress={() => onActivate(event.event_id, 'team')}
|
|
367
|
-
/>
|
|
368
|
-
:<></>}
|
|
374
|
+
|
|
369
375
|
{onShare ?
|
|
370
376
|
<Button type='text' style={{ marginLeft:10 }} onPress={() => onShare(event)}>
|
|
371
377
|
<Icons.ShareIcon size={14} color={C.text.action} />
|
|
@@ -373,36 +379,41 @@ const TeamEventMarket = ({ event, league, float, style, init_expanded, hot_marke
|
|
|
373
379
|
:<></>}
|
|
374
380
|
</LinearGradient>
|
|
375
381
|
:
|
|
376
|
-
<View
|
|
382
|
+
<View type='header' nativeID='event_header_data' style={{ flexDirection:'row', alignItems:'center', flexWrap:'wrap', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8, borderBottomWidth:1, borderBottomColor:C.borders.light }}>
|
|
377
383
|
<View transparent style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
378
|
-
{
|
|
384
|
+
{onActivate && event_status != 'closed' ?
|
|
385
|
+
<Button
|
|
386
|
+
float
|
|
387
|
+
style={{ opacity: activate_loading ? 0.5 : 1, backgroundColor:C.text.success, padding:0, height:34, width:34, justifyContent:'center', alignItems:'center', borderRadius:100 }}
|
|
388
|
+
disabled={activate_loading}
|
|
389
|
+
loading={activate_loading}
|
|
390
|
+
|
|
391
|
+
onPress={() => onActivate(event.event_id, 'team')}
|
|
392
|
+
>
|
|
393
|
+
<Icons.RefreshIcon size={20} color={C.text.white} />
|
|
394
|
+
</Button>
|
|
395
|
+
: league ?
|
|
379
396
|
<Image
|
|
380
397
|
source={{ uri: league.league_image }}
|
|
381
398
|
style={{ height:30, width:30, borderRadius:2, marginRight:4 }}
|
|
382
399
|
resizeMode='cover'
|
|
383
400
|
/>
|
|
384
401
|
:<></>}
|
|
385
|
-
{
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
402
|
+
<View style={{ marginLeft:5 }} transparent>
|
|
403
|
+
{event.event_sub_title ?
|
|
404
|
+
<Text size={12} style={{ maxWidth:150 }} theme='description'>{event.event_sub_title}</Text>
|
|
405
|
+
:<></>}
|
|
406
|
+
{show_id ?
|
|
407
|
+
<Text theme='light' selectable>{event.event_id}</Text>
|
|
408
|
+
:<></>}
|
|
409
|
+
</View>
|
|
410
|
+
|
|
391
411
|
</View>
|
|
392
|
-
<View style={{ flexDirection:'row', alignItems:'center' }}>
|
|
412
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center' }}>
|
|
393
413
|
<Icons.TVIcon size={16} color={C.text.h1} />
|
|
394
|
-
<Text style={{ marginLeft:8 }} theme='description'>{event.info?.broadcast?.network}</Text>
|
|
414
|
+
<Text style={{ marginLeft:8, maxWidth:75 }} theme='description'>{event.info?.broadcast?.network}</Text>
|
|
395
415
|
</View>
|
|
396
|
-
|
|
397
|
-
<Button
|
|
398
|
-
title={event_status == 'active' ? 'Refresh' : 'Activate'}
|
|
399
|
-
style={{ opacity: activate_loading ? 0.5 : 1, marginLeft:5, padding:10 }}
|
|
400
|
-
disabled={activate_loading}
|
|
401
|
-
loading={activate_loading}
|
|
402
|
-
type='success'
|
|
403
|
-
onPress={() => onActivate(event.event_id, 'team')}
|
|
404
|
-
/>
|
|
405
|
-
:<></>}
|
|
416
|
+
|
|
406
417
|
{onShare ?
|
|
407
418
|
<Button type='text' style={{ marginLeft:10 }} onPress={() => onShare(event)}>
|
|
408
419
|
<Icons.ShareIcon size={14} color={C.text.action} />
|
|
@@ -561,7 +572,7 @@ const TeamEventMarket = ({ event, league, float, style, init_expanded, hot_marke
|
|
|
561
572
|
>
|
|
562
573
|
<Icons.ChevronIcon direction={expanded ? 'up' : 'down'} size={8} color={C.text.h1} />
|
|
563
574
|
</Button>
|
|
564
|
-
:available ?
|
|
575
|
+
:available && !expanded ?
|
|
565
576
|
<Button
|
|
566
577
|
title='MORE'
|
|
567
578
|
type='info'
|
package/src/constants/styles.ts
CHANGED
|
@@ -90,7 +90,7 @@ export const MyViewStyles = StyleSheet.create({
|
|
|
90
90
|
shadowOffset: { width: 0, height: 10 }, // Vertical shadow offset
|
|
91
91
|
shadowRadius: 14, // Larger shadow radius to enhance floating effect
|
|
92
92
|
shadowOpacity: 1, // Full shadow opacity
|
|
93
|
-
borderColor:
|
|
93
|
+
borderColor: Colors.shades.shade500, // Subtle border to define edges
|
|
94
94
|
borderWidth: 1, // Consistent border width
|
|
95
95
|
borderRadius: 8, // Rounded corners for consistency
|
|
96
96
|
elevation: 10, // Higher elevation for Android shadows
|