be-components 4.5.5 → 4.5.6

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 (101) hide show
  1. package/lib/commonjs/Bracket/api/index.js +0 -2
  2. package/lib/commonjs/Bracket/api/index.js.map +1 -1
  3. package/lib/commonjs/Bracket/components/BracketCompetitionActions.js +8 -7
  4. package/lib/commonjs/Bracket/components/BracketCompetitionActions.js.map +1 -1
  5. package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js +2 -0
  6. package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
  7. package/lib/commonjs/Bracket/components/BracketPlay/index.js +0 -8
  8. package/lib/commonjs/Bracket/components/BracketPlay/index.js.map +1 -1
  9. package/lib/commonjs/Bracket/components/EditPlayerBracket.js +32 -3
  10. package/lib/commonjs/Bracket/components/EditPlayerBracket.js.map +1 -1
  11. package/lib/commonjs/Bracket/components/EnteredCompetitionsModal.js +197 -0
  12. package/lib/commonjs/Bracket/components/EnteredCompetitionsModal.js.map +1 -0
  13. package/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.js +3 -3
  14. package/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.js.map +1 -1
  15. package/lib/commonjs/Bracket/components/PlayerBracketCard.js +21 -4
  16. package/lib/commonjs/Bracket/components/PlayerBracketCard.js.map +1 -1
  17. package/lib/commonjs/Bracket/components/PlayerBrackets.js +27 -4
  18. package/lib/commonjs/Bracket/components/PlayerBrackets.js.map +1 -1
  19. package/lib/commonjs/Bracket/components/RoomHome.js +408 -107
  20. package/lib/commonjs/Bracket/components/RoomHome.js.map +1 -1
  21. package/lib/commonjs/Bracket/index.js +246 -420
  22. package/lib/commonjs/Bracket/index.js.map +1 -1
  23. package/lib/module/Bracket/api/index.js +0 -2
  24. package/lib/module/Bracket/api/index.js.map +1 -1
  25. package/lib/module/Bracket/components/BracketCompetitionActions.js +8 -7
  26. package/lib/module/Bracket/components/BracketCompetitionActions.js.map +1 -1
  27. package/lib/module/Bracket/components/BracketPlay/BracketRound.js +2 -0
  28. package/lib/module/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
  29. package/lib/module/Bracket/components/BracketPlay/index.js +0 -8
  30. package/lib/module/Bracket/components/BracketPlay/index.js.map +1 -1
  31. package/lib/module/Bracket/components/EditPlayerBracket.js +33 -4
  32. package/lib/module/Bracket/components/EditPlayerBracket.js.map +1 -1
  33. package/lib/module/Bracket/components/EnteredCompetitionsModal.js +190 -0
  34. package/lib/module/Bracket/components/EnteredCompetitionsModal.js.map +1 -0
  35. package/lib/module/Bracket/components/ManageBracketCompetitionForm.js +3 -3
  36. package/lib/module/Bracket/components/ManageBracketCompetitionForm.js.map +1 -1
  37. package/lib/module/Bracket/components/PlayerBracketCard.js +21 -4
  38. package/lib/module/Bracket/components/PlayerBracketCard.js.map +1 -1
  39. package/lib/module/Bracket/components/PlayerBrackets.js +28 -5
  40. package/lib/module/Bracket/components/PlayerBrackets.js.map +1 -1
  41. package/lib/module/Bracket/components/RoomHome.js +410 -109
  42. package/lib/module/Bracket/components/RoomHome.js.map +1 -1
  43. package/lib/module/Bracket/index.js +247 -421
  44. package/lib/module/Bracket/index.js.map +1 -1
  45. package/lib/typescript/lib/commonjs/Bracket/api/index.d.ts.map +1 -1
  46. package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
  47. package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
  48. package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts +1 -2
  49. package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts.map +1 -1
  50. package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts +3 -1
  51. package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
  52. package/lib/typescript/lib/commonjs/Bracket/components/EnteredCompetitionsModal.d.ts +14 -0
  53. package/lib/typescript/lib/commonjs/Bracket/components/EnteredCompetitionsModal.d.ts.map +1 -0
  54. package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts +4 -1
  55. package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts.map +1 -1
  56. package/lib/typescript/lib/commonjs/Bracket/components/RoomHome.d.ts +3 -14
  57. package/lib/typescript/lib/commonjs/Bracket/components/RoomHome.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/Bracket/index.d.ts.map +1 -1
  59. package/lib/typescript/lib/module/Bracket/api/index.d.ts.map +1 -1
  60. package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
  61. package/lib/typescript/lib/module/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
  62. package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts +1 -2
  63. package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts.map +1 -1
  64. package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts +5 -2
  65. package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
  66. package/lib/typescript/lib/module/Bracket/components/EnteredCompetitionsModal.d.ts +15 -0
  67. package/lib/typescript/lib/module/Bracket/components/EnteredCompetitionsModal.d.ts.map +1 -0
  68. package/lib/typescript/lib/module/Bracket/components/PlayerBracketCard.d.ts +3 -1
  69. package/lib/typescript/lib/module/Bracket/components/PlayerBracketCard.d.ts.map +1 -1
  70. package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts +6 -2
  71. package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts.map +1 -1
  72. package/lib/typescript/lib/module/Bracket/components/RoomHome.d.ts +3 -14
  73. package/lib/typescript/lib/module/Bracket/components/RoomHome.d.ts.map +1 -1
  74. package/lib/typescript/lib/module/Bracket/index.d.ts.map +1 -1
  75. package/lib/typescript/src/Bracket/api/index.d.ts.map +1 -1
  76. package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
  77. package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts +1 -2
  78. package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts.map +1 -1
  79. package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts +8 -1
  80. package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
  81. package/lib/typescript/src/Bracket/components/EnteredCompetitionsModal.d.ts +21 -0
  82. package/lib/typescript/src/Bracket/components/EnteredCompetitionsModal.d.ts.map +1 -0
  83. package/lib/typescript/src/Bracket/components/PlayerBracketCard.d.ts +3 -2
  84. package/lib/typescript/src/Bracket/components/PlayerBracketCard.d.ts.map +1 -1
  85. package/lib/typescript/src/Bracket/components/PlayerBrackets.d.ts +9 -1
  86. package/lib/typescript/src/Bracket/components/PlayerBrackets.d.ts.map +1 -1
  87. package/lib/typescript/src/Bracket/components/RoomHome.d.ts +10 -18
  88. package/lib/typescript/src/Bracket/components/RoomHome.d.ts.map +1 -1
  89. package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
  90. package/package.json +1 -1
  91. package/src/Bracket/api/index.ts +0 -2
  92. package/src/Bracket/components/BracketCompetitionActions.tsx +7 -6
  93. package/src/Bracket/components/BracketPlay/BracketRound.tsx +2 -2
  94. package/src/Bracket/components/BracketPlay/index.tsx +13 -18
  95. package/src/Bracket/components/EditPlayerBracket.tsx +58 -42
  96. package/src/Bracket/components/EnteredCompetitionsModal.tsx +113 -0
  97. package/src/Bracket/components/ManageBracketCompetitionForm.tsx +3 -3
  98. package/src/Bracket/components/PlayerBracketCard.tsx +9 -4
  99. package/src/Bracket/components/PlayerBrackets.tsx +45 -33
  100. package/src/Bracket/components/RoomHome.tsx +335 -112
  101. package/src/Bracket/index.tsx +280 -410
@@ -1,38 +1,27 @@
1
- import React, { useCallback, useMemo, useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  import { Button, Text, View } from '../../Components/Themed';
3
- import type { AthleteProps, BracketCompetitionProps, BracketProps, CompetitionPlayerBracketProps, CompetitionResultTypeProps, LeagueProps, MyPlayerProps, PlayerBracketProps, TeamProps } from '../../types';
3
+ import type { AthleteProps, BracketCompetitionProps, BracketProps, CompetitionPlayerBracketProps, LeagueProps, MyPlayerProps, PlayerBracketProps, TeamProps } from '../../types';
4
4
  import { FlatList, Image } from 'react-native';
5
5
  import PlayerBracketCard from './PlayerBracketCard';
6
6
  import SearchBox from '../../Components/SearchBox';
7
7
  import { Icons, Toggle } from '../../Components';
8
8
  import { useColors } from '../../constants/useColors';
9
9
  import moment from 'moment-mini';
10
- import { BracketComeptitionApi } from '../api';
10
+ import { BracketApi, BracketComeptitionApi } from '../api';
11
+ import EditPlayerBracket from './EditPlayerBracket';
12
+ import EnteredCompetitionsModal from './EnteredCompetitionsModal';
11
13
 
12
14
  type RoomHomeProps = {
13
15
  player?:MyPlayerProps,
14
- visible?:boolean,
15
- player_brackets:PlayerBracketProps[],
16
- bracket_competitions:BracketCompetitionProps[],
17
- competition_player_brackets:CompetitionPlayerBracketProps[],
18
- brackets:BracketProps[],
16
+ visible:boolean,
19
17
  onManageCompetition:(bracket_competition_id:string) => void,
20
- onMoreAdmin:(offset:number) => void,
21
- admin_offset:number,
22
- admin_competitions:BracketCompetitionProps[],
23
18
  onFocusPosition?:(pos:{ x:number, y:number, height:number, width:number }) => void,
24
19
  width:number,
25
- public_competitions:BracketCompetitionProps[],
26
- active_brackets:BracketProps[],
20
+ insets?: { top:number, bottom:number, right:number, left:number },
27
21
  view_mode:'mobile'|'desktop'
28
- competition_result_types:CompetitionResultTypeProps[],
29
22
  leagues:LeagueProps[],
30
23
  onCreateNewCompetition?:(bracket_id?:string) => void,
31
- athletes:AthleteProps[],
32
- onUpdatePlayerBracket:(player_bracket:PlayerBracketProps) => void,
33
- onEditPlayerBracket:(player_bracket:PlayerBracketProps) => void,
34
- onView: (bracket_id:string, player_bracket_id?:string, bracket_competition_id?:string) => void,
35
- teams:TeamProps[]
24
+ onView: (bracket_id:string, player_bracket_id?:string, bracket_competition?:BracketCompetitionProps) => void,
36
25
  }
37
26
 
38
27
  const MIN_CARD_WIDTH = 330
@@ -47,59 +36,234 @@ const calcCardWidth = (width:number, margin:number) => {
47
36
 
48
37
  const sections = [ 'toggle', 'active_brackets', 'past_brackets', 'tournaments', 'admin_competitions', 'competitions']
49
38
 
50
- const RoomHome = ({ visible, width, player, leagues, active_brackets, public_competitions, admin_competitions, onMoreAdmin, admin_offset, onManageCompetition, onCreateNewCompetition, onView, onUpdatePlayerBracket, onEditPlayerBracket, onFocusPosition, brackets, player_brackets, bracket_competitions, competition_player_brackets, athletes, teams }:RoomHomeProps) => {
39
+ const RoomHome = ({ view_mode, visible, width, player, leagues, insets, onManageCompetition, onCreateNewCompetition, onView, onFocusPosition}:RoomHomeProps) => {
51
40
  const Colors = useColors();
41
+ const [ active_toggle, setActiveToggle ] = useState('my_brackets');
42
+ const [ show_comps, setShowComps ] = useState<{
43
+ player_bracket?:PlayerBracketProps,
44
+ champion_team?:TeamProps,
45
+ champion_athlete?:AthleteProps,
46
+ entered_competitions:BracketCompetitionProps[],
47
+ entered_brackets:CompetitionPlayerBracketProps[]
48
+ }>({
49
+ entered_brackets: [],
50
+ entered_competitions:[]
51
+ })
52
+ const [ editing_player_bracket, setEditingPlayerBracket ] = useState<PlayerBracketProps|undefined>(undefined);
53
+ const [ admin_data, setAdminData ] = useState<{
54
+ admin_loading:boolean,
55
+ admin_competitions:BracketCompetitionProps[],
56
+ admin_brackets:BracketProps[],
57
+ admin_offset:number
58
+ }>({
59
+ admin_loading: false,
60
+ admin_brackets: [],
61
+ admin_competitions:[],
62
+ admin_offset:0
63
+ });
64
+ const { admin_competitions, admin_offset } = admin_data;
65
+ const [ competitions_data, setCompetitionsData ] = useState<{
66
+ competitions_loaded:boolean,
67
+ competitions_loading: boolean,
68
+ public_competitions:BracketCompetitionProps[],
69
+ competition_brackets:BracketProps[]
70
+ }>({
71
+ competitions_loading: false,
72
+ competitions_loaded: false,
73
+ public_competitions:[],
74
+ competition_brackets:[]
75
+ });
76
+ const { public_competitions, competition_brackets } = competitions_data
77
+ const [ comp_search, setCompSearch ] = useState({
78
+ visible: false,
79
+ value: ''
80
+ });
81
+ let visisble_comps = [ ...public_competitions ]
82
+ if(comp_search.visible){
83
+ visisble_comps = visisble_comps.filter(c => `${c.competition_name} ${c.competition_description}`.toLowerCase().includes(comp_search.value.toLowerCase()))
84
+ }
85
+ const unique_competition_leagues = [ ...new Set(competition_brackets.filter(b => visisble_comps.map(c => c.bracket_id.toString()).includes(b.bracket_id.toString())).map(b => b.league_id)) ]
86
+
87
+ const [ tournaments_data, setTournamentsData ] = useState<{
88
+ tournaments_loading:boolean,
89
+ tournament_brackets:BracketProps[]
90
+ }>({
91
+ tournaments_loading: false,
92
+ tournament_brackets: []
93
+ });
94
+ const { tournament_brackets } = tournaments_data;
95
+ let visisble_tourney_brackets = [ ...tournament_brackets ]
96
+
97
+ const [ selected_league, setSelectedLeague ] = useState<string | undefined>(undefined);
98
+ if(selected_league){
99
+ visisble_tourney_brackets = visisble_tourney_brackets.filter(b => b.league_id == selected_league)
100
+ }
101
+ const [ tourney_search, setTourneySearch ] = useState({
102
+ visible:false, value:''
103
+ });
104
+ if(tourney_search.visible){
105
+ visisble_tourney_brackets = visisble_tourney_brackets.filter(b => `${b.bracket_name}`.toLowerCase().includes(tourney_search.value.toLowerCase()));
106
+ }
107
+ const unique_tournament_leagues = [ ...new Set(visisble_tourney_brackets.map(b => b.league_id)) ];
108
+
109
+ const [ my_brackets_data, setMyBrackets ] = useState<{
110
+ my_brackets_loading: boolean,
111
+ my_brackets_loaded:boolean,
112
+ competition_player_brackets:CompetitionPlayerBracketProps[],
113
+ my_competitions:BracketCompetitionProps[],
114
+ my_brackets:BracketProps[],
115
+ player_brackets:PlayerBracketProps[],
116
+ champion_teams:TeamProps[],
117
+ champion_athletes:AthleteProps[],
118
+ }>({
119
+ my_brackets_loading: false,
120
+ my_brackets_loaded: false,
121
+ competition_player_brackets: [],
122
+ my_brackets:[],
123
+ champion_athletes:[],
124
+ champion_teams: [],
125
+ my_competitions:[],
126
+ player_brackets:[]
127
+ });
128
+ const { my_brackets_loaded, my_brackets_loading, my_brackets, my_competitions, competition_player_brackets, player_brackets, champion_athletes, champion_teams } = my_brackets_data;
129
+ const active_brackets = player_brackets.filter(pb => pb.status == 'active');
130
+ const closed_brackets = player_brackets.filter(pb => pb.status == 'closed');
131
+
132
+ const [ past_search, setPastSearch ] = useState({
133
+ visible: false,
134
+ value:''
135
+ });
136
+ let closed_bracket_ids = [ ...new Set(closed_brackets.map(b => b.bracket_id)) ].slice(0,10)
137
+ if(past_search.visible){
138
+ let filtered_brackets = [ ...closed_brackets].filter(b => `${b.bracket_name}`.toLowerCase().includes(past_search.value.toLowerCase()))
139
+ closed_bracket_ids = [ ...new Set(filtered_brackets.map(b => b.bracket_id)) ].slice(0,10)
140
+ }
141
+
142
+ const [ active_search, setActiveSearch ] = useState({
143
+ visible:false,
144
+ value:''
145
+ });
146
+ let active_bracket_ids = [ ...new Set(active_brackets.map(b => b.bracket_id)) ]
147
+ if(active_search.visible){
148
+ let filtered_a_brackets = [ ...active_brackets].filter(b => `${b.bracket_name}`.toLowerCase().includes(active_search.value.toLowerCase()))
149
+ active_bracket_ids = [ ...new Set(filtered_a_brackets.map(b => b.bracket_id)) ].slice(0,10)
150
+ }
151
+
52
152
  const [ action_loading, setActionLoading ] = useState<string|undefined>(undefined)//This will be a bracket id
53
- const [ active_toggle, setActiveToggle ] = useState('competitions');
54
- const [ past_search, setPastSearch ] = useState('');
55
- const [ show_active_search, setShowActiveSearch ] = useState(false);
56
153
  const [ expanded_brackets, setExpandedBrackets ] = useState<string[]>([]);
57
154
  const [ expanded_leagues, setExpandedLeagues ] = useState<string[]>([]);
58
155
  const [ expanded_c_leagues, setExpandedCLeagues ] = useState<string[]>([])
59
- const [ active_search, setActiveSearch ] = useState('');
60
- const [ show_past_search, setShowPastSearch ] = useState(false);
61
- const [ show_brackets_search, setShowBracketsSearch ] = useState(false);
62
- const [ selected_league, setSelectedLeague ] = useState<string | undefined>(undefined);
63
- const [ brackets_search, setBracketsSearch ] = useState('');
64
- console.log(brackets_search)
65
- const [ competition_search, setCompetitionSearch ] = useState('');
66
- console.log(competition_search)
67
- const [ show_competition_search, setShowCompetitionSearch ] = useState(false);
68
- let visible_active_brackets = [ ...active_brackets ]
69
- const unique_leages = [ ...new Set(visible_active_brackets.map(b => b.league_id)) ];
70
- if(selected_league){ visible_active_brackets = visible_active_brackets.filter(b => b.league_id == selected_league) }
71
- //const inprogress_bracket_ids = [ ...new Set(visible_active_brackets.map(b => b.bracket_id)) ];
72
-
73
- const filterPlayerBrackets = (bs:BracketProps[], pbs:PlayerBracketProps[], status:'active'|'closed', search:string) => {
74
- let init_pbs = pbs.filter(pb => pb.status == status);
75
- if(!search || search == ''){ return init_pbs }
76
- let brackets = bs.filter(b => `${b.bracket_name.toLowerCase()}`.includes(search.toLowerCase()));
77
- return init_pbs.filter(pb => brackets.map(b => b.bracket_id.toString()).includes(pb.bracket_id.toString()));
156
+
157
+
158
+ useEffect(() => {
159
+ if(!visible){ return }
160
+ getData(active_toggle)
161
+ },[visible, active_toggle]);
162
+
163
+ const getData = async(toggle:string) => {
164
+ switch(toggle){
165
+ case 'my_brackets': getMyBrackets(); return
166
+ case 'tournaments': getTournaments(); return
167
+ case 'competitions': getCompetitions(); return
168
+ default: return
169
+ }
78
170
  }
79
171
 
80
- let visible_player_brackets = useMemo(() => {
81
- return filterPlayerBrackets(brackets, player_brackets, 'active', active_search);
82
- },[brackets.length, player_brackets.length, active_search]);
172
+ const getCompetitions = async() => {
173
+ setCompetitionsData({ ...competitions_data, competitions_loading: true });
174
+ const pub_comps = await BracketComeptitionApi.getActivePublicBrackets();
175
+ const unique_brackets = [ ...new Set(pub_comps.map(c => c.bracket_id)) ]
176
+ const comp_brackets = await BracketApi.getBracketsByIds(unique_brackets);
177
+ setCompetitionsData({
178
+ ...competitions_data,
179
+ public_competitions: pub_comps,
180
+ competitions_loaded: true,
181
+ competition_brackets: comp_brackets,
182
+ competitions_loading: false
183
+ })
184
+ getAdminComps(0);
185
+ }
83
186
 
84
- const active_bracket_ids = [ ...new Set(visible_player_brackets.map(pb => pb.bracket_id)) ]
187
+ const getAdminComps = async(offset:number) => {
188
+ const admin_comps = await BracketComeptitionApi.getMyAdminCompetitions(offset);
189
+ setAdminData({
190
+ admin_loading: false,
191
+ admin_brackets:[],
192
+ admin_competitions:admin_comps,
193
+ admin_offset:offset
194
+ })
195
+ }
85
196
 
86
- let past_player_brackets = useMemo(() => {
87
- return filterPlayerBrackets(brackets, player_brackets, 'closed', past_search);
88
- },[brackets.length, player_brackets.length, past_search])
89
-
90
- const past_bracket_ids = [ ...new Set(past_player_brackets.map(pb => pb.bracket_id)) ]
197
+ const getTournaments = async() => {
198
+ setTournamentsData({ ...tournaments_data, tournaments_loading: true });
199
+ const tourney_brackets = await BracketApi.getActiveBrackets();
200
+ setTournamentsData({
201
+ ...tournaments_data,
202
+ tournaments_loading: false,
203
+ tournament_brackets: tourney_brackets
204
+ });
205
+ }
206
+
207
+ const getMyBrackets = async() => {
208
+ setMyBrackets({ ...my_brackets_data, my_brackets_loading: true });
209
+ const my_response = await BracketComeptitionApi.getMyPlayerBrackets();
210
+ const bracket_ids = [ ...new Set(my_response.player_brackets.map(pb => pb.bracket_id))]
211
+ let brackets = await BracketApi.getBracketsByIds(bracket_ids);
212
+ let champ_team_ids = my_response.player_brackets.filter(pb => pb.champion_id_type == 'team').map(b => b.champion_id ?? '')
213
+ const champ_teams = await BracketApi.getTeamsByIds(champ_team_ids);
214
+ let champ_athlete_ids = my_response.player_brackets.filter(pb => pb.champion_id_type == 'athlete').map(b => b.champion_id ?? '')
215
+ const champ_athletes = await BracketApi.getAthletesByIds(champ_athlete_ids);
216
+ //Filter to active and closed
217
+ setMyBrackets({
218
+ ...my_brackets_data,
219
+ my_brackets_loading:false,
220
+ my_brackets_loaded: true,
221
+ champion_athletes: champ_athletes,
222
+ champion_teams: champ_teams,
223
+ my_brackets: brackets,
224
+ player_brackets: my_response.player_brackets,
225
+ competition_player_brackets: my_response.competition_player_brackets,
226
+ my_competitions: my_response.bracket_competitions
227
+ })
228
+ }
229
+
230
+ const handleView = async(bracket_id:string, player_bracket_id?:string, bracket_competition?:BracketCompetitionProps) => {
231
+ if(bracket_id && player_bracket_id && bracket_competition){ return onView(bracket_id, player_bracket_id, bracket_competition) }
232
+ //Ok! Now - what if we do not have a player_bracket
233
+ let init_pb_id = player_bracket_id
234
+ if(!init_pb_id){
235
+ //Lets try and find one!
236
+ init_pb_id = player_brackets.find(pb => pb.bracket_id == bracket_id && pb.status != 'deleted')?.player_bracket_id
237
+ if(!init_pb_id && !my_brackets_loaded){
238
+ //Lets try and get the plyaers brackets and see!
239
+ const my_pbs = await BracketComeptitionApi.getMyPlayerBrackets();
240
+ init_pb_id = my_pbs.player_brackets.find(pb => pb.bracket_id == bracket_id && pb.status != 'deleted')?.player_bracket_id
241
+ }
242
+ }
243
+
244
+ //Ok! Now - what if we do not have a bracket competition!
245
+ let init_bc = bracket_competition
246
+ if(!init_bc){
247
+ //First check if my competitions has any!
248
+ init_bc = my_competitions.find(c => c.bracket_id == bracket_id)
249
+ if(!init_bc){ init_bc = public_competitions.find(pc => pc.bracket_id == bracket_id) }
250
+ if(!init_bc){
251
+ //Lets try and get one from the server
252
+ const comps_bc = await BracketComeptitionApi.getBracketCompetitionsByBracketId(bracket_id);
253
+ init_bc = comps_bc.find(bc => bc.bracket_id == bracket_id && !bc.invite_only)
254
+ }
255
+ }
256
+ return onView(bracket_id, init_pb_id, init_bc)
257
+ }
91
258
 
92
- const competition_bracket_ids = [ ...new Set(public_competitions.map(bc => bc.bracket_id)) ]
93
- const competition_brackets = brackets.filter(b => competition_bracket_ids.includes(b.bracket_id));
94
- const competition_league_ids = [ ...new Set(competition_brackets.map(cb => cb.league_id)) ];
95
259
 
96
260
  const pb_width = calcCardWidth(width, 6);
97
261
 
98
262
  const renderBrackets = (data:{ item:string, index:number }) => {
99
- const bracket = brackets.find(b => b.bracket_id == data.item);
263
+ const bracket = my_brackets.find(b => b.bracket_id == data.item);
100
264
  if(!bracket){ return <></> }
101
265
  const expanded = expanded_brackets.includes(data.item) ? true : false
102
- let my_player_brackets = player_brackets.filter(pb => pb.bracket_id == data.item);
266
+ let my_player_brackets = player_brackets.filter(pb => pb.bracket_id == data.item && pb.status != 'deleted');
103
267
  let additional = my_player_brackets.length - 1
104
268
  if(!expanded){
105
269
  my_player_brackets = my_player_brackets.slice(0,1);
@@ -107,8 +271,8 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
107
271
  const league = leagues.find(l => l.league_id == bracket.league_id);
108
272
  const act_loading = action_loading == data.item ? true : false
109
273
  return (
110
- <View float style={{ margin:5, width: pb_width }}>
111
- <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
274
+ <View key={`${data.item}_${data.index}_bracket`} float style={{ margin:5, width: pb_width }}>
275
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
112
276
  {league ?
113
277
  <Image
114
278
  style={{ height:40, width:40, marginRight:5 }}
@@ -144,9 +308,12 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
144
308
  completion_status: 'inprogress',
145
309
  status: 'active'
146
310
  })
147
- onUpdatePlayerBracket(new_pb);
148
311
  setActionLoading(undefined);
149
312
  if(!expanded){ setExpandedBrackets(expanded_brackets.concat(data.item)) }
313
+ setMyBrackets({
314
+ ...my_brackets_data,
315
+ player_brackets: player_brackets.filter(pb => pb.player_bracket_id != new_pb.player_bracket_id).concat(new_pb)
316
+ })
150
317
  }}
151
318
  />
152
319
  :<></>}
@@ -173,7 +340,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
173
340
  const renderCompetitions = (data:{ item:BracketCompetitionProps, index:number }) => {
174
341
  return (
175
342
  <Button style={{ padding:10, flexDirection:'row', alignItems:'center', borderRadius:0, borderBottomWidth:1, borderColor:Colors.borders.light }}
176
- onPress={() => onView(data.item.bracket_id, player_brackets.find(pb => pb.bracket_id == data.item.bracket_id)?.player_bracket_id, data.item.bracket_competition_id)}>
343
+ onPress={() => handleView(data.item.bracket_id, undefined, data.item)}>
177
344
  <View transparent>
178
345
  <Image
179
346
  source={{ uri: data.item.image?.url }}
@@ -207,7 +374,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
207
374
  <Icons.BracketIcon size={50} color={Colors.text.h1} />
208
375
  }
209
376
  </View>
210
- <View type='footer' style={{ padding:8 }}>
377
+ <View type='footer' style={{ padding:8, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
211
378
  <Button
212
379
  type='action'
213
380
  style={{ padding:5 }}
@@ -219,14 +386,21 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
219
386
  )
220
387
  }
221
388
 
222
- const renderPlayerBrackets = useCallback((data:{ item:PlayerBracketProps, index:number }) => {
389
+ const handleSearchPrivate = async(code:string) => {
390
+ const bc = await BracketComeptitionApi.getBracketcompetitionByCode(code);
391
+ if(!bc){ return alert('Unable to find private competition by that code')}
392
+ let pb_response = await BracketComeptitionApi.getMyPlayerBrackets(bc.bracket_id);
393
+ return handleView(bc.bracket_id, pb_response.player_brackets[0]?.player_bracket_id, bc)
394
+ }
395
+
396
+ const renderPlayerBrackets = (data:{ item:PlayerBracketProps, index:number}) => {
223
397
  const cpbs = competition_player_brackets.filter(cpb => cpb.status != 'deleted' && cpb.player_bracket_id == data.item.player_bracket_id);
224
- const comps = bracket_competitions.filter(bc => cpbs.map(cpb => cpb.bracket_competition_id.toString()).includes(bc.bracket_competition_id.toString()));
225
- const bracket = brackets.find(b => b.bracket_id == data.item.bracket_id);
398
+ const comps = my_competitions.filter(bc => cpbs.map(cpb => cpb.bracket_competition_id.toString()).includes(bc.bracket_competition_id.toString()));
399
+ const bracket = my_brackets.find(b => b.bracket_id == data.item.bracket_id);
226
400
  if(!bracket){ return <></> }
227
401
  const league = leagues.find(l => l.league_id == bracket.league_id);
228
- const champion_team = teams.find(t => data.item.champion_id_type == 'team' && t.team_id == data.item.champion_id)
229
- const champion_athlete = athletes.find(t => data.item.champion_id_type == 'athlete' && t.athlete_id == data.item.champion_id)
402
+ const champion_team = champion_teams.find(t => data.item.champion_id_type == 'team' && t.team_id == data.item.champion_id)
403
+ const champion_athlete = champion_athletes.find(t => data.item.champion_id_type == 'athlete' && t.athlete_id == data.item.champion_id)
230
404
  return (
231
405
  <View style={{ borderBottomWidth:1, borderColor:Colors.borders.light, padding:5 }}>
232
406
  <PlayerBracketCard
@@ -237,12 +411,13 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
237
411
  competition_player_brackets={cpbs}
238
412
  bracket={bracket}
239
413
  bracket_competitions={comps}
240
- onView={onView}
241
- onEdit={onEditPlayerBracket}
414
+ onView={(bracket_id, player_bracket_id) => handleView(bracket_id, player_bracket_id)}
415
+ onEdit={() => setEditingPlayerBracket(data.item)}
416
+ onShowCompetitions={() => setShowComps({ player_bracket: data.item, entered_competitions:comps, entered_brackets: cpbs, champion_team, champion_athlete })}
242
417
  />
243
418
  </View>
244
419
  )
245
- }, [JSON.stringify(player_brackets)]);
420
+ };
246
421
 
247
422
  const renderLeagueFilters = (data:{ item:string, index:number }) => {
248
423
  const league = leagues.find(l => l.league_id == data.item);
@@ -251,7 +426,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
251
426
  return (
252
427
  <Button
253
428
  float
254
- style={{ flexDirection:'row', alignItems:'center', padding:5, paddingRight:10, paddingLeft:10, borderRadius:100, margin:5 }}
429
+ style={{ flexDirection:'row', alignItems:'center', padding:5, paddingRight:10, paddingLeft:10, borderRadius:100, margin:5, backgroundColor:selected?Colors.text.highlight:undefined }}
255
430
  onPress={() => selected ? setSelectedLeague(undefined): setSelectedLeague(data.item)}
256
431
  >
257
432
  <Image
@@ -267,7 +442,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
267
442
  const renderLeagueBrackets = (data:{ item:BracketProps, index:number }) => {
268
443
  return (
269
444
  <Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}
270
- onPress={() => onView(data.item.bracket_id, player_brackets.find(pb => pb.bracket_id == data.item.bracket_id)?.player_bracket_id, undefined)}>
445
+ onPress={() => handleView(data.item.bracket_id)}>
271
446
  <Icons.BracketIcon size={18} color={Colors.text.h1} />
272
447
  <View transparent style={{ flex:1, marginLeft:10, paddingLeft:5, borderLeftWidth:1, borderColor:Colors.borders.light }}>
273
448
  <Text theme='h2'>{data.item.bracket_name}</Text>
@@ -283,7 +458,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
283
458
  if(!league){ return <></> }
284
459
  const expanded = expanded_c_leagues.includes(data.item) ? true : false
285
460
  //Find all the brackets for this league
286
- let league_brackets = active_brackets.filter(b => b.league_id == data.item);
461
+ let league_brackets = competition_brackets.filter(b => b.league_id == data.item);
287
462
  let league_competitions = public_competitions.filter(bc => league_brackets.map(lb => lb.bracket_id.toString()).includes(bc.bracket_id.toString()));
288
463
  const num_comps = league_competitions.length
289
464
  let additional = league_competitions.length - 1
@@ -330,7 +505,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
330
505
  const league = leagues.find(l => l.league_id == data.item);
331
506
  if(!league){ return <></> }
332
507
  const expanded = expanded_leagues.includes(data.item) ? true : false
333
- let league_brackets = active_brackets.filter(b => b.league_id == data.item);
508
+ let league_brackets = tournament_brackets.filter(b => b.league_id == data.item);
334
509
  let additional = league_brackets.length - 1
335
510
  if(!expanded){
336
511
  league_brackets = league_brackets.slice(0,1);
@@ -375,7 +550,7 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
375
550
  switch(data.item){
376
551
  case 'toggle':
377
552
  return (
378
- <View style={{ margin:5 }}>
553
+ <View style={{ margin:10, marginTop:18 }}>
379
554
  <Toggle
380
555
  options={[
381
556
  { key: 'my_brackets', label:'My Brackets' },
@@ -391,8 +566,8 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
391
566
  case 'active_brackets':
392
567
  if(active_toggle != 'my_brackets'){ return <></> }
393
568
  return (
394
- <View nativeID='my_competitions'>
395
- <View type='header' style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
569
+ <View nativeID='my_competitions' style={{ marginTop:18 }}>
570
+ <View style={{ padding:18, flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.borders.light }}>
396
571
  <View transparent style={{ flex:1, marginRight:10 }}>
397
572
  <Text theme='h1'>My Active Brackets</Text>
398
573
  <Text style={{ marginTop:4 }}>View / Edit your active brackets</Text>
@@ -400,24 +575,24 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
400
575
  <Button
401
576
  float
402
577
  style={{ padding:0, height:35, width:35, justifyContent:'center', alignItems:'center' }}
403
- onPress={() => setShowActiveSearch(!show_active_search)}
578
+ onPress={() => setActiveSearch({ visible: !active_search.visible, value:'' })}
404
579
  >
405
- {show_active_search ?
580
+ {active_search.visible ?
406
581
  <Icons.CloseIcon size={14} color={Colors.text.error} />
407
582
  :
408
583
  <Icons.SearchIcon size={14} color={Colors.text.action} />
409
584
  }
410
585
  </Button>
411
586
  </View>
412
- {show_active_search ?
587
+ {active_search.visible ?
413
588
  <SearchBox
414
- onChange={(text) => setActiveSearch(text)}
589
+ onChange={(text) => setActiveSearch({ ...active_search, value: text })}
415
590
  hide_search_button
416
591
  placeholder='Search Active Brackets'
417
592
  onFocusPosition={onFocusPosition}
418
593
  />
419
594
  :<></>}
420
- <View type='body' style={{ marginBottom:10, flexDirection:'row', flexWrap:'wrap', justifyContent:'center'}}>
595
+ <View type='header' style={{ padding:10, flexDirection:'row', flexWrap:'wrap', justifyContent:'center'}}>
421
596
  {active_bracket_ids.map((id, index) => {
422
597
  return renderBrackets({ item:id, index })
423
598
  })}
@@ -436,38 +611,38 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
436
611
  <Button
437
612
  float
438
613
  style={{ padding:0, height:35, width:35, justifyContent:'center', alignItems:'center' }}
439
- onPress={() => setShowBracketsSearch(!show_brackets_search)}
614
+ onPress={() => setTourneySearch({ visible: !tourney_search.visible, value: '' })}
440
615
  >
441
- {show_brackets_search ?
616
+ {tourney_search.visible ?
442
617
  <Icons.CloseIcon size={14} color={Colors.text.error} />
443
618
  :
444
619
  <Icons.SearchIcon size={14} color={Colors.text.action} />
445
620
  }
446
621
  </Button>
447
622
  </View>
448
- {show_brackets_search ?
623
+ {tourney_search.visible ?
449
624
 
450
625
  <View style={{ padding:5 }}>
451
626
  <FlatList
452
627
  key='unique_leagues'
453
628
  keyExtractor={(item) => item}
454
- data={unique_leages}
629
+ data={unique_tournament_leagues}
455
630
  renderItem={renderLeagueFilters}
456
631
  horizontal
457
632
  />
458
633
  </View>
459
634
  :<></>}
460
635
 
461
- {show_brackets_search ?
636
+ {tourney_search.visible ?
462
637
  <SearchBox
463
- onChange={(text) => setBracketsSearch(text)}
638
+ onChange={(text) => setTourneySearch({ ...tourney_search, value: text })}
464
639
  hide_search_button
465
640
  placeholder='Search Active Tournaments'
466
641
  onFocusPosition={onFocusPosition}
467
642
  />
468
643
  :<></>}
469
644
  <View type='body' style={{ marginTop:10, marginBottom:10, flexDirection:'row', flexWrap:'wrap', justifyContent:'center'}}>
470
- {unique_leages.map((id, index) => {
645
+ {unique_tournament_leagues.map((id, index) => {
471
646
  return renderLeagues({ item:id, index })
472
647
  })}
473
648
  </View>
@@ -477,34 +652,34 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
477
652
  case 'past_brackets':
478
653
  if(active_toggle != 'my_brackets'){ return <></> }
479
654
  return (
480
- <View nativeID='past_brackets'>
481
- <View type='header' style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
655
+ <View nativeID='past_brackets' style={{ marginTop:18 }}>
656
+ <View style={{ padding:18, flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.borders.light }}>
482
657
  <View transparent style={{ flex:1, marginRight:10 }}>
483
- <Text theme='h1'>MY PAST BRACKETS</Text>
658
+ <Text theme='h1'>My Past Brackets</Text>
484
659
  <Text style={{ marginTop:4 }}>View your past brackets</Text>
485
660
  </View>
486
661
  <Button
487
662
  float
488
663
  style={{ padding:0, height:35, width:35, justifyContent:'center', alignItems:'center' }}
489
- onPress={() => setShowPastSearch(!show_past_search)}
664
+ onPress={() => setPastSearch({ visible: !past_search.visible, value: '' })}
490
665
  >
491
- {show_past_search ?
666
+ {past_search.visible ?
492
667
  <Icons.CloseIcon size={14} color={Colors.text.error} />
493
668
  :
494
669
  <Icons.SearchIcon size={14} color={Colors.text.action} />
495
670
  }
496
671
  </Button>
497
672
  </View>
498
- {show_past_search ?
673
+ {past_search.visible ?
499
674
  <SearchBox
500
- onChange={(text) => setPastSearch(text)}
675
+ onChange={(text) => setPastSearch({ ...past_search, value:text })}
501
676
  hide_search_button
502
677
  placeholder='Search Past Brackets'
503
678
  onFocusPosition={onFocusPosition}
504
679
  />
505
680
  :<></>}
506
- <View type='body' style={{ marginBottom:10, flexDirection:'row', flexWrap:'wrap', justifyContent:'center'}}>
507
- {past_bracket_ids.map((id, index) => {
681
+ <View type='header' style={{ padding:10, flexDirection:'row', flexWrap:'wrap', justifyContent:'center'}}>
682
+ {closed_bracket_ids.map((id, index) => {
508
683
  return renderBrackets({ item:id, index })
509
684
  })}
510
685
  </View>
@@ -524,23 +699,43 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
524
699
  title='PREV'
525
700
  type='text'
526
701
  style={{ padding:0, marginRight:10 }}
527
- onPress={() => onMoreAdmin(admin_offset - 1)}
702
+ onPress={() => getAdminComps(admin_offset - 1)}
528
703
  />
529
704
  :<></>}
530
705
  <Button
531
706
  title='MORE'
532
707
  type='text'
533
708
  style={{ padding:0 }}
534
- onPress={() => onMoreAdmin(admin_offset + 1)}
709
+ onPress={() => getAdminComps(admin_offset + 1)}
535
710
  />
536
711
  </View>
537
712
  <View style={{ padding:10 }}>
538
- <FlatList
539
- data={admin_competitions}
540
- renderItem={renderAdminCompetitions}
541
- keyExtractor={(item) => `admin_${item.bracket_competition_id.toString()}`}
542
- horizontal
543
- />
713
+ <View style={{ flexDirection:'row' }}>
714
+ {onCreateNewCompetition ?
715
+ <View float style={{ width:100, margin:5, borderWidth:1, borderColor:Colors.text.success }}>
716
+ <View type='header' style={{ borderTopRightRadius:8, borderTopLeftRadius:8, padding:5 }}>
717
+ <Text style={{ padding:5 }} theme='description' textAlign='center'>NEW</Text>
718
+ </View>
719
+ <View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
720
+ <Icons.BracketIcon size={40} color={Colors.text.h1} />
721
+ </View>
722
+ <View type='footer' style={{ padding:8, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
723
+ <Button
724
+ title='CREATE'
725
+ type='success'
726
+ style={{padding:5}}
727
+ onPress={() => onCreateNewCompetition()}
728
+ />
729
+ </View>
730
+ </View>
731
+ :<></>}
732
+ <FlatList
733
+ data={admin_competitions}
734
+ renderItem={renderAdminCompetitions}
735
+ keyExtractor={(item) => `admin_${item.bracket_competition_id.toString()}`}
736
+ horizontal
737
+ />
738
+ </View>
544
739
  </View>
545
740
  </View>
546
741
  )
@@ -556,9 +751,9 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
556
751
  <Button
557
752
  float
558
753
  style={{ padding:0, height:35, width:35, justifyContent:'center', alignItems:'center' }}
559
- onPress={() => setShowCompetitionSearch(!show_competition_search)}
754
+ onPress={() => setCompSearch({ visible: !comp_search.visible, value: '' })}
560
755
  >
561
- {show_competition_search ?
756
+ {comp_search.visible ?
562
757
  <Icons.CloseIcon size={12} color={Colors.text.error} />
563
758
  :
564
759
  <Icons.SearchIcon size={12} color={Colors.text.action} />
@@ -575,16 +770,16 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
575
770
  </Button>
576
771
  :<></>}
577
772
  </View>
578
- {show_competition_search ?
773
+ {comp_search.visible ?
579
774
  <SearchBox
580
- onChange={(text) => setCompetitionSearch(text)}
581
- onSearch={(text) => console.log(text)}
775
+ onChange={(text) => setCompSearch({ ...comp_search, value:text })}
776
+ onSearch={(text) => handleSearchPrivate(text)}
582
777
  placeholder='Search or Enter Private Code'
583
778
  onFocusPosition={onFocusPosition}
584
779
  />
585
780
  :<></>}
586
781
  <View type='body' style={{ marginTop:10, marginBottom:10, flexDirection:'row', flexWrap:'wrap', justifyContent:'center'}}>
587
- {competition_league_ids.map((id, index) => {
782
+ {unique_competition_leagues.map((id, index) => {
588
783
  return renderLeaguesForCompetitions({ item:id, index })
589
784
  })}
590
785
  </View>
@@ -595,15 +790,43 @@ const RoomHome = ({ visible, width, player, leagues, active_brackets, public_com
595
790
  }
596
791
 
597
792
  if(!visible){ return <></> }
598
-
599
793
  return (
600
794
  <View style={{ flex:1 }}>
601
795
  <FlatList
602
796
  data={sections}
603
797
  key='room_sections'
798
+ refreshing={my_brackets_loading}
604
799
  keyExtractor={(item) => item}
605
800
  renderItem={renderSections}
606
801
  />
802
+ <EditPlayerBracket
803
+ player_bracket={editing_player_bracket}
804
+ view_mode={view_mode}
805
+ insets={insets}
806
+ onClose={() => setEditingPlayerBracket(undefined)}
807
+ onFocusPosition={onFocusPosition}
808
+ onUpdatePlayerBracket={(new_pb) => {
809
+ setEditingPlayerBracket(undefined);
810
+ setMyBrackets({
811
+ ...my_brackets_data,
812
+ player_brackets: player_brackets.filter(pb => pb.player_bracket_id != new_pb.player_bracket_id).concat(new_pb)
813
+ })
814
+ }}
815
+ />
816
+ <EnteredCompetitionsModal
817
+ player_bracket={show_comps.player_bracket}
818
+ onSelectCompetition={(bc) => {
819
+ if(!show_comps.player_bracket){ return }
820
+ onView(show_comps.player_bracket.bracket_id, show_comps.player_bracket.player_bracket_id, bc)
821
+ }}
822
+ insets={insets}
823
+ champion_team={show_comps.champion_team}
824
+ champion_athlete={show_comps.champion_athlete}
825
+ onClose={() => setShowComps({ entered_brackets:[], entered_competitions:[] })}
826
+ entered_brackets={show_comps.entered_brackets}
827
+ entered_competitions={show_comps.entered_competitions}
828
+ view_mode={view_mode}
829
+ />
607
830
  </View>
608
831
  )
609
832
  }