be-components 4.4.2 → 4.4.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.
Files changed (40) hide show
  1. package/lib/commonjs/Bracket/components/BracketCompetitionActions.js +13 -9
  2. package/lib/commonjs/Bracket/components/BracketCompetitionActions.js.map +1 -1
  3. package/lib/commonjs/Bracket/components/CompetitionLeaderboard.js +2 -2
  4. package/lib/commonjs/Bracket/components/CompetitionLeaderboard.js.map +1 -1
  5. package/lib/commonjs/Bracket/components/EditPlayerBracket.js +2 -0
  6. package/lib/commonjs/Bracket/components/EditPlayerBracket.js.map +1 -1
  7. package/lib/commonjs/Bracket/components/PlayerBrackets.js +2 -1
  8. package/lib/commonjs/Bracket/components/PlayerBrackets.js.map +1 -1
  9. package/lib/commonjs/Bracket/index.js +34 -2
  10. package/lib/commonjs/Bracket/index.js.map +1 -1
  11. package/lib/module/Bracket/components/BracketCompetitionActions.js +13 -9
  12. package/lib/module/Bracket/components/BracketCompetitionActions.js.map +1 -1
  13. package/lib/module/Bracket/components/CompetitionLeaderboard.js +2 -2
  14. package/lib/module/Bracket/components/CompetitionLeaderboard.js.map +1 -1
  15. package/lib/module/Bracket/components/EditPlayerBracket.js +2 -0
  16. package/lib/module/Bracket/components/EditPlayerBracket.js.map +1 -1
  17. package/lib/module/Bracket/components/PlayerBrackets.js +2 -1
  18. package/lib/module/Bracket/components/PlayerBrackets.js.map +1 -1
  19. package/lib/module/Bracket/index.js +34 -2
  20. package/lib/module/Bracket/index.js.map +1 -1
  21. package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
  22. package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts +2 -1
  23. package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
  24. package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts.map +1 -1
  25. package/lib/typescript/lib/commonjs/Bracket/index.d.ts.map +1 -1
  26. package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
  27. package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts +2 -1
  28. package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
  29. package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts.map +1 -1
  30. package/lib/typescript/lib/module/Bracket/index.d.ts.map +1 -1
  31. package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
  32. package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts +7 -1
  33. package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
  34. package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/Bracket/components/BracketCompetitionActions.tsx +15 -9
  37. package/src/Bracket/components/CompetitionLeaderboard.tsx +2 -2
  38. package/src/Bracket/components/EditPlayerBracket.tsx +3 -1
  39. package/src/Bracket/components/PlayerBrackets.tsx +2 -2
  40. package/src/Bracket/index.tsx +18 -2
@@ -76,14 +76,20 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, i
76
76
  const getData = async(id:string, comp_id?:string) => {
77
77
  setActionData({ ...action_data, loading:true });
78
78
  const bcs = await BracketComeptitionApi.getBracketCompetitionsByBracketId(id);
79
- let active_comp = comp_id
80
- if(!active_comp){ active_comp = bcs[0]?.bracket_competition_id }
81
- setActionData({
82
- ...action_data,
83
- bracket_competitions: bcs,
84
- active_competition_id: active_comp,
85
- loading:false
86
- })
79
+ let active_comp = bcs.find(bc => bc.bracket_competition_id == comp_id);
80
+ if(!active_comp){
81
+ active_comp = bcs[0]
82
+ }
83
+ if(!active_competition_id && active_comp){ onFoundCompetition(active_comp) }
84
+ else {
85
+ setActionData({
86
+ ...action_data,
87
+ bracket_competitions: bcs,
88
+ active_competition_id: active_comp?.bracket_competition_id,
89
+ loading:false
90
+ });
91
+ }
92
+
87
93
  }
88
94
 
89
95
  const handleSearch = async(code:string) => {
@@ -294,7 +300,7 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, i
294
300
  }
295
301
 
296
302
  return (
297
- <View transparent style={{ flex:1 }}>
303
+ <View transparent style={{ flexGrow:1 }}>
298
304
  <FlatList
299
305
  key={`comp_actions_list`}
300
306
  keyExtractor={(item) => item}
@@ -114,7 +114,7 @@ const CompetitionLeaderboard = ({ bracket_competition_id, onEnterCompetition, ca
114
114
  }
115
115
 
116
116
  return (
117
- <View transparent style={{ flex:1 }}>
117
+ <View transparent style={{ flexGrow:1 }}>
118
118
 
119
119
  <View type='header' style={{ padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
120
120
  <View transparent style={{ marginBottom:5 }}>
@@ -135,7 +135,7 @@ const CompetitionLeaderboard = ({ bracket_competition_id, onEnterCompetition, ca
135
135
  :<></>}
136
136
 
137
137
  </View>
138
- <View style={{ flex:1, padding:10, borderRadius:8 }}>
138
+ <View style={{ flexGrow:1, padding:10, borderRadius:8 }}>
139
139
  <View style={{ marginBottom:5 }}>
140
140
  <Text size={14} theme='h2'>RESULTS</Text>
141
141
  </View>
@@ -6,9 +6,10 @@ import { BracketComeptitionApi } from '../api';
6
6
  type EditPlayerBracketProps = {
7
7
  player_bracket?:PlayerBracketProps,
8
8
  onUpdatePlayerBracket:(pb:PlayerBracketProps) => void,
9
+ onFocusPosition?:(data:{ x:number, y:number, height:number, width:number }) => void,
9
10
  onClose:() => void
10
11
  }
11
- const EditPlayerBracket = ({ player_bracket, onUpdatePlayerBracket, onClose }:EditPlayerBracketProps) => {
12
+ const EditPlayerBracket = ({ player_bracket, onUpdatePlayerBracket, onFocusPosition, onClose }:EditPlayerBracketProps) => {
12
13
  const [ draft_pb, setDraftPb ] = useState(player_bracket);
13
14
  const [ action_loading, setActionLoading ] = useState(false);
14
15
 
@@ -54,6 +55,7 @@ const EditPlayerBracket = ({ player_bracket, onUpdatePlayerBracket, onClose }:Ed
54
55
  <Text style={{ marginBottom:10 }} theme='h2'>Update Bracket Name</Text>
55
56
  <TextInput
56
57
  value={draft_pb?.bracket_name}
58
+ onFocusPosition={onFocusPosition}
57
59
  onChangeText={(text) => setDraftPb({ ...draft_pb, bracket_name: text })}
58
60
  />
59
61
  </View>
@@ -109,7 +109,7 @@ const PlayerBracketSelector = ({ brackets, bracket_id, leagues, teams, athletes,
109
109
 
110
110
 
111
111
  return (
112
- <View transparent style={{ flex:1 }}>
112
+ <View transparent style={{ flexGrow:1 }}>
113
113
  <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
114
114
  <View transparent style={{ flex:1 }}>
115
115
  <Text theme='h1'>My Brackets</Text>
@@ -126,7 +126,7 @@ const PlayerBracketSelector = ({ brackets, bracket_id, leagues, teams, athletes,
126
126
  </Button>
127
127
  :<></>}
128
128
  </View>
129
- <View transparent style={{ marginTop:1 }}>
129
+ <View transparent style={{ flexGrow:1, marginTop:1 }}>
130
130
  <FlatList
131
131
  data={unique_bracket_ids}
132
132
  renderItem={renderBrackets}
@@ -317,7 +317,22 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, bracket_
317
317
  onPress={() => console.log('')}
318
318
  />
319
319
  </View>
320
- :<></>}
320
+ :
321
+ <View transparent style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
322
+ <Icons.BracketIcon size={20} color={Colors.text.white} />
323
+ <View transparent style={{ flex:1, marginLeft:10 }}>
324
+ <Text theme='h2' color={Colors.text.white}>Available Competitions</Text>
325
+ <Text style={{ marginTop:3 }} theme='description' color={Colors.text.white}>Press here to see eligible competitions to join!</Text>
326
+ </View>
327
+ <Button
328
+ float
329
+ disabled={true}
330
+ type='action'
331
+ title='VIEW'
332
+ onPress={() => console.log('')}
333
+ />
334
+ </View>
335
+ }
321
336
  </Button>
322
337
  :<></>}
323
338
  </View>
@@ -405,7 +420,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, bracket_
405
420
  }, 500);
406
421
  }}
407
422
  >
408
- <Icons.ShareIcon size={14} color={Colors.text.action} />
423
+ <Icons.ShareIcon size={14} color={Colors.text.white} />
409
424
  </Button>
410
425
  </View>
411
426
  :<></>}
@@ -519,6 +534,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, bracket_
519
534
  <EditPlayerBracket
520
535
  player_bracket={editing_player_bracket}
521
536
  onClose={() => setEditingPlayerBracket(undefined)}
537
+ onFocusPosition={onFocusPosition}
522
538
  onUpdatePlayerBracket={(new_pb) => {
523
539
  setNavData({ ...nav_data, active_player_bracket_id: undefined });
524
540