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.
Files changed (116) hide show
  1. package/lib/commonjs/Components/Icons.js +30 -0
  2. package/lib/commonjs/Components/Icons.js.map +1 -1
  3. package/lib/commonjs/Components/SearchBox.js +17 -23
  4. package/lib/commonjs/Components/SearchBox.js.map +1 -1
  5. package/lib/commonjs/Components/Themed.js +2 -2
  6. package/lib/commonjs/Components/Themed.js.map +1 -1
  7. package/lib/commonjs/Engage/components/BracketCompetitionCard.js +75 -58
  8. package/lib/commonjs/Engage/components/BracketCompetitionCard.js.map +1 -1
  9. package/lib/commonjs/Engage/components/CompanyCard.js +31 -26
  10. package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -1
  11. package/lib/commonjs/Engage/components/CompetitionCard.js +85 -68
  12. package/lib/commonjs/Engage/components/CompetitionCard.js.map +1 -1
  13. package/lib/commonjs/Engage/components/EngageHeader.js +62 -36
  14. package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -1
  15. package/lib/commonjs/Engage/components/PrivateCodePrompt.js +47 -45
  16. package/lib/commonjs/Engage/components/PrivateCodePrompt.js.map +1 -1
  17. package/lib/commonjs/Engage/components/SquaresCompetitionCard.js +69 -56
  18. package/lib/commonjs/Engage/components/SquaresCompetitionCard.js.map +1 -1
  19. package/lib/commonjs/Engage/index.js +262 -259
  20. package/lib/commonjs/Engage/index.js.map +1 -1
  21. package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +69 -46
  22. package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
  23. package/lib/commonjs/constants/styles.js +1 -1
  24. package/lib/commonjs/constants/styles.js.map +1 -1
  25. package/lib/commonjs/constants/useColors.js +6 -3
  26. package/lib/commonjs/constants/useColors.js.map +1 -1
  27. package/lib/module/Components/Icons.js +30 -0
  28. package/lib/module/Components/Icons.js.map +1 -1
  29. package/lib/module/Components/SearchBox.js +11 -17
  30. package/lib/module/Components/SearchBox.js.map +1 -1
  31. package/lib/module/Components/Themed.js +2 -2
  32. package/lib/module/Components/Themed.js.map +1 -1
  33. package/lib/module/Engage/components/BracketCompetitionCard.js +52 -35
  34. package/lib/module/Engage/components/BracketCompetitionCard.js.map +1 -1
  35. package/lib/module/Engage/components/CompanyCard.js +27 -21
  36. package/lib/module/Engage/components/CompanyCard.js.map +1 -1
  37. package/lib/module/Engage/components/CompetitionCard.js +57 -40
  38. package/lib/module/Engage/components/CompetitionCard.js.map +1 -1
  39. package/lib/module/Engage/components/EngageHeader.js +53 -27
  40. package/lib/module/Engage/components/EngageHeader.js.map +1 -1
  41. package/lib/module/Engage/components/PrivateCodePrompt.js +36 -33
  42. package/lib/module/Engage/components/PrivateCodePrompt.js.map +1 -1
  43. package/lib/module/Engage/components/SquaresCompetitionCard.js +51 -38
  44. package/lib/module/Engage/components/SquaresCompetitionCard.js.map +1 -1
  45. package/lib/module/Engage/index.js +262 -259
  46. package/lib/module/Engage/index.js.map +1 -1
  47. package/lib/module/MarketComponents/components/TeamEventMarket/index.js +69 -46
  48. package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
  49. package/lib/module/constants/styles.js +1 -1
  50. package/lib/module/constants/styles.js.map +1 -1
  51. package/lib/module/constants/useColors.js +6 -3
  52. package/lib/module/constants/useColors.js.map +1 -1
  53. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  54. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  55. package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
  56. package/lib/typescript/lib/commonjs/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
  57. package/lib/typescript/lib/commonjs/Engage/components/CompanyCard.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/Engage/components/CompetitionCard.d.ts.map +1 -1
  59. package/lib/typescript/lib/commonjs/Engage/components/EngageHeader.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts +1 -2
  61. package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
  63. package/lib/typescript/lib/commonjs/Engage/index.d.ts +2 -1
  64. package/lib/typescript/lib/commonjs/Engage/index.d.ts.map +1 -1
  65. package/lib/typescript/lib/commonjs/constants/styles.d.ts +1 -1
  66. package/lib/typescript/lib/commonjs/constants/useColors.d.ts +5 -4
  67. package/lib/typescript/lib/commonjs/constants/useColors.d.ts.map +1 -1
  68. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  69. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  70. package/lib/typescript/lib/module/Components/SearchBox.d.ts +1 -2
  71. package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
  72. package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts +1 -2
  73. package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
  74. package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts +1 -2
  75. package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts.map +1 -1
  76. package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts +1 -2
  77. package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts.map +1 -1
  78. package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts +1 -2
  79. package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts.map +1 -1
  80. package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts +2 -4
  81. package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
  82. package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts +1 -2
  83. package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
  84. package/lib/typescript/lib/module/Engage/index.d.ts +3 -3
  85. package/lib/typescript/lib/module/Engage/index.d.ts.map +1 -1
  86. package/lib/typescript/lib/module/constants/useColors.d.ts +71 -0
  87. package/lib/typescript/lib/module/constants/useColors.d.ts.map +1 -1
  88. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  89. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  90. package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
  91. package/lib/typescript/src/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
  92. package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -1
  93. package/lib/typescript/src/Engage/components/CompetitionCard.d.ts.map +1 -1
  94. package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -1
  95. package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts +1 -2
  96. package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
  97. package/lib/typescript/src/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
  98. package/lib/typescript/src/Engage/index.d.ts +5 -1
  99. package/lib/typescript/src/Engage/index.d.ts.map +1 -1
  100. package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
  101. package/lib/typescript/src/constants/useColors.d.ts +71 -0
  102. package/lib/typescript/src/constants/useColors.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/src/Components/Icons.tsx +16 -0
  105. package/src/Components/SearchBox.tsx +11 -13
  106. package/src/Components/Themed.tsx +3 -3
  107. package/src/Engage/components/BracketCompetitionCard.tsx +34 -31
  108. package/src/Engage/components/CompanyCard.tsx +17 -19
  109. package/src/Engage/components/CompetitionCard.tsx +40 -35
  110. package/src/Engage/components/EngageHeader.tsx +30 -29
  111. package/src/Engage/components/PrivateCodePrompt.tsx +29 -33
  112. package/src/Engage/components/SquaresCompetitionCard.tsx +33 -29
  113. package/src/Engage/index.tsx +191 -187
  114. package/src/MarketComponents/components/TeamEventMarket/index.tsx +55 -44
  115. package/src/constants/styles.ts +1 -1
  116. package/src/constants/useColors.tsx +7 -5
@@ -1,11 +1,9 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, ActivityIndicator, FlatList, ScrollView } from 'react-native';
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 { view_styles } from '../constants/styles';
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 EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelectSquaresCompetition, onSelectCompetitionSeason,
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
- if(loading){
201
- return (
202
- <View style={{flex:1, backgroundColor:Colors.shades.white}}>
203
- <ActivityIndicator style={{ padding:20, alignSelf:'center' }} size='large' color={Colors.brand.midnight} />
204
- </View>
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
- <View style={{ ...view_styles.body_row, margin:10, backgroundColor:Colors.shades.white, borderRadius:22, borderWidth:4, borderColor:Colors.shades.shade100}}>
222
- <Button
223
- title='COMPETITIONS'
224
- title_color={active_tab == 'competitions' ? Colors.shades.white : Colors.brand.midnight}
225
- title_weight={active_tab == 'competitions' ? 'bold' : 'regular'}
226
- padding={15}
227
- title_size={12}
228
- style={{flex:1}}
229
- borderRadiusOverride={{
230
- borderTopLeftRadius: 22,
231
- borderBottomLeftRadius:22,
232
- borderTopRightRadius:0,
233
- borderBottomRightRadius:0
234
- }}
235
- backgroundColor={active_tab == 'competitions' ? Colors.brand.midnight : Colors.shades.white}
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
- <Button
273
- title='ENTER PRIVATE CODE'
274
- padding={15}
275
- title_color={Colors.shades.white}
276
- backgroundColor={Colors.utility.success}
277
- onPress={() => setShowCodePrompt(true)}
278
- />
279
- </View>
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
- <FlatList
299
- data={competition_seasons.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
300
- horizontal
301
- keyExtractor={(item) => item.competition_season_id.toString()}
302
- renderItem={renderSeasons}
241
+ <Button
242
+ title='ENTER PRIVATE CODE'
243
+ type='text'
244
+ onPress={() => setShowCodePrompt(true)}
303
245
  />
304
246
  </View>
305
- :<></>}
306
- <View style={{ marginBottom:15, marginTop:10 }}>
307
- <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0 }}>
308
- <View style={{ flex:1 }}>
309
- <Text theme='header'>Public Competitions</Text>
310
- <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>
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
- </View>
322
- <FlatList
323
- data={competitions.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
324
- renderItem={renderCompetitions}
325
- keyExtractor={(item) => item.competition_id.toString()}
326
- />
327
- </View>
328
- :active_tab == 'squares' ?
329
- <View style={{ ...view_styles.section_body, padding:0 }}>
330
- <View style={{ marginBottom:15, marginTop:10 }}>
331
- <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0 }}>
332
- <View style={{ flex:1 }}>
333
- <Text theme='header'>Public Auction Squares</Text>
334
- <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>
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
- {onCreateSquares ?
337
- <Button
338
- title='NEW'
339
- title_color={Colors.shades.white}
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
- </View>
346
- <FlatList
347
- data={squares_competitions.sort((a,b) => moment(a.begin_datetime).unix() - moment(b.begin_datetime).unix())}
348
- renderItem={renderSquaresCompetitions}
349
- keyExtractor={(item) => item.sq_comp_id.toString()}
350
- />
351
- </View>
352
- :active_tab == 'brackets' ?
353
- <View style={{ ...view_styles.section_body, padding:0 }}>
354
- <View style={{ marginBottom:15, marginTop:10 }}>
355
- <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0 }}>
356
- <View style={{ flex:1 }}>
357
- <Text theme='header'>Public Bracket Competitions</Text>
358
- <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>
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
- {onCreateBracketCompetition ?
361
- <Button
362
- title='NEW'
363
- title_color={Colors.shades.white}
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
- <FlatList
371
- data={bracket_competitions.sort((a,b) => moment(a.scheduled_datetime).unix() - moment(b.scheduled_datetime).unix())}
372
- renderItem={renderBracketCompetitions}
373
- keyExtractor={(item) => item.bracket_competition_id.toString()}
374
- />
375
- </View>
376
- :<></>}
377
- </ScrollView>
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
- <View style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'flex-end', backgroundColor:Colors.shades.black_faded_heavy }}>
380
- <PrivateCodePrompt
381
- width={module_size.width - 20}
382
- onFoundBracket={(b) => {
383
- onSelectBracketCompetition(b)
384
- setShowCodePrompt(false);
385
- }}
386
- onFoundCompetition={(c) => {
387
- onSelectCompetition(c)
388
- setShowCodePrompt(false);
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
- onFoundSeason={(s) => {
392
- onSelectCompetitionSeason(s)
393
- setShowCodePrompt(false);
394
- }}
395
- onFoundSquaresCompetition={(sc) => {
396
- onSelectSquaresCompetition(sc)
397
- setShowCodePrompt(false);
398
- }}
399
- onClose={() => setShowCodePrompt(false)}
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
- <View transparent style={{ height:30, width:30, borderRadius:4, backgroundColor:Colors.shades.white }}>
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
- source={{ uri: sponsor.company_image?.url }}
339
- style={{ height:30, width:30, borderRadius:4 }}
340
- resizeMode='cover'
351
+ source={{ uri: sponsor.company_image?.url }}
352
+ style={{ height:30, width:30, borderRadius:4 }}
353
+ resizeMode='cover'
341
354
  />
342
- </View>
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
- {show_id ?
347
- <Text style={{ marginLeft:2, marginRight:3 }} size={12} color={Colors.shades.white} weight='semibold' selectable>{event.event_id} </Text>
348
- :<></>}
349
- {event.event_sub_title ?
350
- <Text size={12} color={Colors.shades.white} weight='semibold'>{event.event_sub_title}</Text>
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
- {onActivate && event_status != 'closed' ?
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 transparent nativeID='event_header_data' style={{ flexDirection:'row', alignItems:'center', flexWrap:'wrap', padding:10, borderBottomWidth:1, borderBottomColor:C.borders.light }}>
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
- {league ?
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
- {show_id ?
386
- <Text style={{ marginLeft:2, marginRight:3 }} theme='description' selectable>{event.event_id} </Text>
387
- :<></>}
388
- {event.event_sub_title ?
389
- <Text size={12} theme='description'>{event.event_sub_title}</Text>
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
- {onActivate && event_status != 'closed' ?
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'
@@ -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: '#4A4A4A', // Subtle border to define edges
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