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.
- package/lib/commonjs/Bracket/api/index.js +0 -2
- package/lib/commonjs/Bracket/api/index.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js +8 -7
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js +2 -0
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/index.js +0 -8
- package/lib/commonjs/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/commonjs/Bracket/components/EditPlayerBracket.js +32 -3
- package/lib/commonjs/Bracket/components/EditPlayerBracket.js.map +1 -1
- package/lib/commonjs/Bracket/components/EnteredCompetitionsModal.js +197 -0
- package/lib/commonjs/Bracket/components/EnteredCompetitionsModal.js.map +1 -0
- package/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.js +3 -3
- package/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.js.map +1 -1
- package/lib/commonjs/Bracket/components/PlayerBracketCard.js +21 -4
- package/lib/commonjs/Bracket/components/PlayerBracketCard.js.map +1 -1
- package/lib/commonjs/Bracket/components/PlayerBrackets.js +27 -4
- package/lib/commonjs/Bracket/components/PlayerBrackets.js.map +1 -1
- package/lib/commonjs/Bracket/components/RoomHome.js +408 -107
- package/lib/commonjs/Bracket/components/RoomHome.js.map +1 -1
- package/lib/commonjs/Bracket/index.js +246 -420
- package/lib/commonjs/Bracket/index.js.map +1 -1
- package/lib/module/Bracket/api/index.js +0 -2
- package/lib/module/Bracket/api/index.js.map +1 -1
- package/lib/module/Bracket/components/BracketCompetitionActions.js +8 -7
- package/lib/module/Bracket/components/BracketCompetitionActions.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js +2 -0
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/index.js +0 -8
- package/lib/module/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/module/Bracket/components/EditPlayerBracket.js +33 -4
- package/lib/module/Bracket/components/EditPlayerBracket.js.map +1 -1
- package/lib/module/Bracket/components/EnteredCompetitionsModal.js +190 -0
- package/lib/module/Bracket/components/EnteredCompetitionsModal.js.map +1 -0
- package/lib/module/Bracket/components/ManageBracketCompetitionForm.js +3 -3
- package/lib/module/Bracket/components/ManageBracketCompetitionForm.js.map +1 -1
- package/lib/module/Bracket/components/PlayerBracketCard.js +21 -4
- package/lib/module/Bracket/components/PlayerBracketCard.js.map +1 -1
- package/lib/module/Bracket/components/PlayerBrackets.js +28 -5
- package/lib/module/Bracket/components/PlayerBrackets.js.map +1 -1
- package/lib/module/Bracket/components/RoomHome.js +410 -109
- package/lib/module/Bracket/components/RoomHome.js.map +1 -1
- package/lib/module/Bracket/index.js +247 -421
- package/lib/module/Bracket/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/EnteredCompetitionsModal.d.ts +14 -0
- package/lib/typescript/lib/commonjs/Bracket/components/EnteredCompetitionsModal.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts +4 -1
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/RoomHome.d.ts +3 -14
- package/lib/typescript/lib/commonjs/Bracket/components/RoomHome.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts +1 -2
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts +5 -2
- package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/EnteredCompetitionsModal.d.ts +15 -0
- package/lib/typescript/lib/module/Bracket/components/EnteredCompetitionsModal.d.ts.map +1 -0
- package/lib/typescript/lib/module/Bracket/components/PlayerBracketCard.d.ts +3 -1
- package/lib/typescript/lib/module/Bracket/components/PlayerBracketCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts +6 -2
- package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/RoomHome.d.ts +3 -14
- package/lib/typescript/lib/module/Bracket/components/RoomHome.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts +1 -2
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts +8 -1
- package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/EnteredCompetitionsModal.d.ts +21 -0
- package/lib/typescript/src/Bracket/components/EnteredCompetitionsModal.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/components/PlayerBracketCard.d.ts +3 -2
- package/lib/typescript/src/Bracket/components/PlayerBracketCard.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/PlayerBrackets.d.ts +9 -1
- package/lib/typescript/src/Bracket/components/PlayerBrackets.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/RoomHome.d.ts +10 -18
- package/lib/typescript/src/Bracket/components/RoomHome.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Bracket/api/index.ts +0 -2
- package/src/Bracket/components/BracketCompetitionActions.tsx +7 -6
- package/src/Bracket/components/BracketPlay/BracketRound.tsx +2 -2
- package/src/Bracket/components/BracketPlay/index.tsx +13 -18
- package/src/Bracket/components/EditPlayerBracket.tsx +58 -42
- package/src/Bracket/components/EnteredCompetitionsModal.tsx +113 -0
- package/src/Bracket/components/ManageBracketCompetitionForm.tsx +3 -3
- package/src/Bracket/components/PlayerBracketCard.tsx +9 -4
- package/src/Bracket/components/PlayerBrackets.tsx +45 -33
- package/src/Bracket/components/RoomHome.tsx +335 -112
- package/src/Bracket/index.tsx +280 -410
|
@@ -12,9 +12,7 @@ var _reactNative = require("react-native");
|
|
|
12
12
|
var _BracketHeader = _interopRequireDefault(require("./components/BracketHeader"));
|
|
13
13
|
var _RoomHome = _interopRequireDefault(require("./components/RoomHome"));
|
|
14
14
|
var _BracketCompetitionActions = _interopRequireDefault(require("./components/BracketCompetitionActions"));
|
|
15
|
-
var _EditPlayerBracket = _interopRequireDefault(require("./components/EditPlayerBracket"));
|
|
16
15
|
var _useColors = require("../constants/useColors");
|
|
17
|
-
var _PlayerBrackets = _interopRequireDefault(require("./components/PlayerBrackets"));
|
|
18
16
|
var _Components = require("../Components");
|
|
19
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -40,7 +38,16 @@ const BracketRoom = ({
|
|
|
40
38
|
const [show_competition_actions, setShowCompetitionActions] = (0, _react.useState)(false);
|
|
41
39
|
let mode = width < 600 ? 'small' : width < 1500 ? 'medium' : 'large';
|
|
42
40
|
let navigator_width = mode == 'large' ? 300 : mode == 'medium' ? 100 : 0;
|
|
41
|
+
const [play_data, setPlayData] = (0, _react.useState)({
|
|
42
|
+
competition_player_brackets: [],
|
|
43
|
+
player_brackets: []
|
|
44
|
+
});
|
|
45
|
+
const {
|
|
46
|
+
player_brackets,
|
|
47
|
+
competition_player_brackets
|
|
48
|
+
} = play_data;
|
|
43
49
|
const [local_balance, setLocalBalance] = (0, _react.useState)(player_balance);
|
|
50
|
+
const [player, setPlayer] = (0, _react.useState)(undefined);
|
|
44
51
|
const [static_data, setStaticData] = (0, _react.useState)({
|
|
45
52
|
static_loaded: false,
|
|
46
53
|
leagues: [],
|
|
@@ -51,90 +58,83 @@ const BracketRoom = ({
|
|
|
51
58
|
leagues,
|
|
52
59
|
static_loaded
|
|
53
60
|
} = static_data;
|
|
54
|
-
const [room_data, setRoomData] = (0, _react.useState)({
|
|
55
|
-
room_loaded: false,
|
|
56
|
-
public_competitions: [],
|
|
57
|
-
active_brackets: []
|
|
58
|
-
});
|
|
59
|
-
const {
|
|
60
|
-
room_loaded,
|
|
61
|
-
public_competitions,
|
|
62
|
-
active_brackets
|
|
63
|
-
} = room_data;
|
|
64
|
-
const [show_pb_selector, setShowPBSelector] = (0, _react.useState)(false);
|
|
65
|
-
const [editing_player_bracket, setEditingPlayerBracket] = (0, _react.useState)(undefined);
|
|
66
61
|
const [nav_data, setNavData] = (0, _react.useState)({
|
|
67
62
|
active_nav: 'home'
|
|
68
63
|
});
|
|
69
64
|
const {
|
|
70
65
|
active_nav,
|
|
71
66
|
active_bracket_id,
|
|
72
|
-
|
|
67
|
+
active_competition,
|
|
73
68
|
active_player_bracket_id
|
|
74
69
|
} = nav_data;
|
|
75
70
|
let comp_action_width = mode != 'small' && active_bracket_id ? 300 : 0;
|
|
76
71
|
let section_width = width - navigator_width - comp_action_width > MAX_WIDTH ? MAX_WIDTH : width - navigator_width - comp_action_width;
|
|
77
|
-
|
|
78
|
-
teams: [],
|
|
79
|
-
athletes: [],
|
|
80
|
-
player_brackets: [],
|
|
81
|
-
brackets: [],
|
|
82
|
-
bracket_competitions: [],
|
|
83
|
-
competition_player_brackets: []
|
|
84
|
-
});
|
|
85
|
-
const {
|
|
86
|
-
teams,
|
|
87
|
-
athletes,
|
|
88
|
-
brackets,
|
|
89
|
-
bracket_competitions,
|
|
90
|
-
player_brackets,
|
|
91
|
-
competition_player_brackets,
|
|
92
|
-
player
|
|
93
|
-
} = my_data;
|
|
94
|
-
const [my_admin_data, setMyAdminData] = (0, _react.useState)({
|
|
95
|
-
admin_offset: 0,
|
|
96
|
-
admin_competitions: []
|
|
97
|
-
});
|
|
98
|
-
const {
|
|
99
|
-
admin_competitions,
|
|
100
|
-
admin_offset
|
|
101
|
-
} = my_admin_data;
|
|
102
|
-
const active_player_bracket = player_brackets.filter(pb => pb.status != 'deleted').find(pb => pb.player_bracket_id == active_player_bracket_id);
|
|
103
|
-
const active_bracket = brackets.find(b => b.bracket_id == active_bracket_id);
|
|
104
|
-
const active_competition = public_competitions.find(bc => bc.bracket_competition_id == active_competition_id);
|
|
72
|
+
|
|
105
73
|
//Very First Time we Launch - do this
|
|
106
74
|
(0, _react.useEffect)(() => {
|
|
107
75
|
_api.BracketApi.setEnvironment();
|
|
108
|
-
|
|
109
|
-
}, [
|
|
110
|
-
|
|
111
|
-
//DATA LOADING FUNCTIONS
|
|
112
|
-
const loadData = async (bracket_id, bracket_competition_id) => {
|
|
113
|
-
let pbs = [];
|
|
76
|
+
getStaticData();
|
|
77
|
+
}, []);
|
|
78
|
+
(0, _react.useEffect)(() => {
|
|
114
79
|
if (!static_loaded) {
|
|
115
|
-
|
|
116
|
-
await getStaticData();
|
|
80
|
+
return;
|
|
117
81
|
}
|
|
118
|
-
if (player_id) {
|
|
119
|
-
|
|
120
|
-
const my_response = await getMyData(player_id, bracket_id, bracket_competition_id);
|
|
121
|
-
pbs = my_response?.player_brackets ?? [];
|
|
82
|
+
if (!player_id) {
|
|
83
|
+
return;
|
|
122
84
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
85
|
+
getMyData();
|
|
86
|
+
}, [static_loaded, player_id]);
|
|
87
|
+
(0, _react.useEffect)(() => {
|
|
88
|
+
if (!bracket_id && !bracket_competition_id) {
|
|
89
|
+
return;
|
|
126
90
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
91
|
+
if (!static_loaded) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
setUpInitData(bracket_id, bracket_competition_id);
|
|
95
|
+
}, [static_loaded, player_id, bracket_id, bracket_competition_id]);
|
|
96
|
+
const setUpInitData = async (bracket_id, bracket_competition_id) => {
|
|
97
|
+
let init_bracket_id = bracket_id;
|
|
98
|
+
let bc = undefined;
|
|
99
|
+
let active_pb_id = undefined;
|
|
100
|
+
if (bracket_competition_id) {
|
|
101
|
+
let resp = await _api.BracketComeptitionApi.getBracketCompetitionById(bracket_competition_id);
|
|
102
|
+
bc = resp?.bracket_competition;
|
|
103
|
+
if (bc) {
|
|
104
|
+
init_bracket_id = bc.bracket_id;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (player_id && init_bracket_id) {
|
|
108
|
+
//Get the play data for whaat is provided!!
|
|
109
|
+
const my_data = await _api.BracketComeptitionApi.getMyPlayerBrackets(init_bracket_id);
|
|
110
|
+
//Try to find an already entered bracket
|
|
111
|
+
active_pb_id = my_data.competition_player_brackets.find(cpb => cpb.bracket_competition_id == bracket_competition_id)?.player_bracket_id;
|
|
112
|
+
if (!active_pb_id) {
|
|
113
|
+
//Pick a random one
|
|
114
|
+
active_pb_id = my_data.player_brackets[0]?.player_bracket_id;
|
|
115
|
+
}
|
|
116
|
+
setPlayData({
|
|
117
|
+
...play_data,
|
|
118
|
+
player_brackets: my_data.player_brackets,
|
|
119
|
+
competition_player_brackets: my_data.competition_player_brackets
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
setNavData({
|
|
123
|
+
...nav_data,
|
|
124
|
+
active_nav: 'bracket',
|
|
125
|
+
active_player_bracket_id: active_pb_id,
|
|
126
|
+
active_bracket_id: init_bracket_id,
|
|
127
|
+
active_competition: bc
|
|
134
128
|
});
|
|
135
129
|
};
|
|
130
|
+
const getMyData = async () => {
|
|
131
|
+
const pb = await _api.BracketComeptitionApi.getMyBalance();
|
|
132
|
+
const pl = await _api.BracketComeptitionApi.getMyDetails();
|
|
133
|
+
setLocalBalance(pb);
|
|
134
|
+
setPlayer(pl);
|
|
135
|
+
};
|
|
136
136
|
const getStaticData = async () => {
|
|
137
|
-
setLoading('
|
|
137
|
+
setLoading('Setting Up Bracket');
|
|
138
138
|
const comp_options = await _api.BracketComeptitionApi.getCompetitionOptions();
|
|
139
139
|
const lgs = await _api.BracketApi.getLeagues();
|
|
140
140
|
setStaticData({
|
|
@@ -143,83 +143,22 @@ const BracketRoom = ({
|
|
|
143
143
|
leagues: lgs,
|
|
144
144
|
competition_result_types: comp_options.competition_result_types
|
|
145
145
|
});
|
|
146
|
+
setTimeout(() => setLoading(undefined), 500);
|
|
146
147
|
};
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
let pb = local_pbs.find(pb => pb.status != 'deleted' && pb.bracket_id == bc.bracket_competition.bracket_id);
|
|
156
|
-
pub_competitions = pub_competitions.filter(pc => pc.bracket_competition_id != bc.bracket_competition.bracket_competition_id).concat(bc.bracket_competition);
|
|
157
|
-
setNavData({
|
|
158
|
-
...nav_data,
|
|
159
|
-
active_bracket_id: bc.bracket_competition.bracket_id,
|
|
160
|
-
active_competition_id: bracket_competition_id,
|
|
161
|
-
active_player_bracket_id: pb?.player_bracket_id,
|
|
162
|
-
active_nav: 'bracket'
|
|
163
|
-
});
|
|
164
|
-
setRoomData({
|
|
165
|
-
...room_data,
|
|
166
|
-
room_loaded: true,
|
|
167
|
-
active_brackets: pub_brackets,
|
|
168
|
-
public_competitions: pub_competitions.filter(pc => pc.status == 'scheduled')
|
|
169
|
-
});
|
|
170
|
-
if (mode == 'small') {
|
|
171
|
-
return setShowCompetitionActions(true);
|
|
172
|
-
}
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (bracket_id) {
|
|
176
|
-
let pb = player_brackets.find(pb => pb.status != 'deleted' && pb.bracket_id == bracket_id);
|
|
177
|
-
setNavData({
|
|
178
|
-
...nav_data,
|
|
179
|
-
active_bracket_id: bracket_id,
|
|
180
|
-
active_competition_id: undefined,
|
|
181
|
-
active_player_bracket_id: pb?.player_bracket_id,
|
|
182
|
-
active_nav: 'bracket'
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
setRoomData({
|
|
186
|
-
...room_data,
|
|
187
|
-
room_loaded: true,
|
|
188
|
-
active_brackets: pub_brackets,
|
|
189
|
-
public_competitions: pub_competitions.filter(pc => pc.status == 'scheduled')
|
|
148
|
+
const handleView = async (bracket_id, player_bracket_id, bracket_competition) => {
|
|
149
|
+
setNavData({
|
|
150
|
+
...nav_data,
|
|
151
|
+
active_nav: 'bracket',
|
|
152
|
+
active_player_bracket_id: player_bracket_id,
|
|
153
|
+
active_bracket_id: bracket_id,
|
|
154
|
+
active_competition: bracket_competition
|
|
190
155
|
});
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
let p = await _api.BracketComeptitionApi.getMyDetails();
|
|
197
|
-
let pb = await _api.BracketComeptitionApi.getMyBalance();
|
|
198
|
-
await getAdminData(0);
|
|
199
|
-
setLocalBalance(pb);
|
|
200
|
-
let my_resp = await _api.BracketComeptitionApi.getMyPlayerBrackets();
|
|
201
|
-
let champ_team_ids = my_resp.player_brackets.filter(pb => pb.champion_id_type == 'team').map(b => b.champion_id ?? '');
|
|
202
|
-
const champ_teams = await _api.BracketApi.getTeamsByIds(champ_team_ids);
|
|
203
|
-
let champ_athlete_ids = my_resp.player_brackets.filter(pb => pb.champion_id_type == 'athlete').map(b => b.champion_id ?? '');
|
|
204
|
-
const champ_athletes = await _api.BracketApi.getAthletesByIds(champ_athlete_ids);
|
|
205
|
-
//Now get more if there is a bracket_id or competition_id
|
|
206
|
-
if (bracket_id || bracket_competition_id) {
|
|
207
|
-
let bracket_pbs = await _api.BracketComeptitionApi.getMyPlayerBrackets(bracket_id, bracket_competition_id);
|
|
208
|
-
my_resp = _api.BracketCompetitionHelpers.combinePlayerBrackets(my_resp, bracket_pbs);
|
|
209
|
-
}
|
|
210
|
-
//Get brackets
|
|
211
|
-
let bks = await _api.BracketApi.getBracketsByIds(my_resp.player_brackets.map(pb => pb.bracket_id));
|
|
212
|
-
setMyData({
|
|
213
|
-
...my_data,
|
|
214
|
-
athletes: champ_athletes,
|
|
215
|
-
teams: champ_teams,
|
|
216
|
-
brackets: bks,
|
|
217
|
-
player: p,
|
|
218
|
-
player_brackets: my_resp.player_brackets.filter(pb => pb.status != 'deleted'),
|
|
219
|
-
bracket_competitions: my_resp.bracket_competitions,
|
|
220
|
-
competition_player_brackets: my_resp.competition_player_brackets
|
|
156
|
+
const my_data = await _api.BracketComeptitionApi.getMyPlayerBrackets(bracket_id);
|
|
157
|
+
setPlayData({
|
|
158
|
+
...play_data,
|
|
159
|
+
player_brackets: my_data.player_brackets,
|
|
160
|
+
competition_player_brackets: my_data.competition_player_brackets
|
|
221
161
|
});
|
|
222
|
-
return my_resp;
|
|
223
162
|
};
|
|
224
163
|
const renderSections = data => {
|
|
225
164
|
switch (data.item) {
|
|
@@ -227,53 +166,29 @@ const BracketRoom = ({
|
|
|
227
166
|
return /*#__PURE__*/_react.default.createElement(_BracketHeader.default, {
|
|
228
167
|
view_mode: view_mode,
|
|
229
168
|
active_nav: active_nav,
|
|
230
|
-
bracket:
|
|
231
|
-
bracket_competition:
|
|
169
|
+
bracket: undefined,
|
|
170
|
+
bracket_competition: undefined,
|
|
232
171
|
onGoHome: () => setNavData({
|
|
233
172
|
...nav_data,
|
|
234
173
|
active_bracket_id: undefined,
|
|
235
174
|
active_nav: 'home',
|
|
236
|
-
|
|
175
|
+
active_competition: undefined,
|
|
237
176
|
active_player_bracket_id: undefined
|
|
238
177
|
})
|
|
239
178
|
});
|
|
240
179
|
case 'home':
|
|
180
|
+
if (!static_loaded) {
|
|
181
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
182
|
+
}
|
|
241
183
|
return /*#__PURE__*/_react.default.createElement(_RoomHome.default, {
|
|
242
184
|
player: player,
|
|
185
|
+
visible: active_nav == 'home' ? true : false,
|
|
243
186
|
width: section_width,
|
|
244
|
-
admin_competitions: admin_competitions,
|
|
245
|
-
onMoreAdmin: offset => getAdminData(offset),
|
|
246
|
-
admin_offset: admin_offset,
|
|
247
|
-
brackets: brackets,
|
|
248
187
|
onManageCompetition: onManageCompetition,
|
|
249
|
-
onUpdatePlayerBracket: new_pb => {
|
|
250
|
-
setMyData({
|
|
251
|
-
...my_data,
|
|
252
|
-
player_brackets: player_brackets.filter(pb => pb.player_bracket_id != new_pb.player_bracket_id).concat(new_pb)
|
|
253
|
-
});
|
|
254
|
-
},
|
|
255
188
|
onCreateNewCompetition: onCreateNewCompetition,
|
|
256
|
-
visible: active_nav == 'home' ? true : false,
|
|
257
|
-
active_brackets: active_brackets,
|
|
258
189
|
view_mode: view_mode,
|
|
259
|
-
competition_result_types: competition_result_types,
|
|
260
190
|
leagues: leagues,
|
|
261
|
-
|
|
262
|
-
onView: (bracket_id, player_bracket_id, bracket_competition_id) => {
|
|
263
|
-
setNavData({
|
|
264
|
-
...nav_data,
|
|
265
|
-
active_nav: 'bracket',
|
|
266
|
-
active_player_bracket_id: player_bracket_id,
|
|
267
|
-
active_bracket_id: bracket_id,
|
|
268
|
-
active_competition_id: bracket_competition_id
|
|
269
|
-
});
|
|
270
|
-
},
|
|
271
|
-
player_brackets: player_brackets.filter(pb => pb.status != 'deleted'),
|
|
272
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.status != 'deleted'),
|
|
273
|
-
public_competitions: public_competitions,
|
|
274
|
-
bracket_competitions: bracket_competitions,
|
|
275
|
-
athletes: athletes,
|
|
276
|
-
teams: teams
|
|
191
|
+
onView: handleView
|
|
277
192
|
});
|
|
278
193
|
case 'bracket':
|
|
279
194
|
if (active_nav != 'bracket') {
|
|
@@ -283,19 +198,21 @@ const BracketRoom = ({
|
|
|
283
198
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
284
199
|
}
|
|
285
200
|
return /*#__PURE__*/_react.default.createElement(_BracketPlay.default, {
|
|
286
|
-
width: section_width
|
|
287
|
-
|
|
288
|
-
,
|
|
201
|
+
width: section_width,
|
|
202
|
+
player: player,
|
|
289
203
|
onRequestAuthenticate: () => onRequestAuthenticate(active_competition?.auth_strategy_id),
|
|
290
|
-
onEditPlayerBracket: pb => {
|
|
291
|
-
setEditingPlayerBracket(pb);
|
|
292
|
-
},
|
|
293
204
|
onChangePlayerBracket: () => {
|
|
294
|
-
|
|
205
|
+
setNavData({
|
|
206
|
+
...nav_data,
|
|
207
|
+
active_nav: 'home',
|
|
208
|
+
active_bracket_id: undefined,
|
|
209
|
+
active_competition: undefined,
|
|
210
|
+
active_player_bracket_id: undefined
|
|
211
|
+
});
|
|
295
212
|
},
|
|
296
213
|
onPlayerBracketUpdate: (newpb, ncpbs) => {
|
|
297
|
-
|
|
298
|
-
...
|
|
214
|
+
setPlayData({
|
|
215
|
+
...play_data,
|
|
299
216
|
player_brackets: player_brackets.filter(pb => pb.player_bracket_id != newpb.player_bracket_id).concat(newpb),
|
|
300
217
|
competition_player_brackets: competition_player_brackets.filter(cpb => !ncpbs.find(ncpb => ncpb.competition_player_bracket_id == cpb.competition_player_bracket_id)).concat(ncpbs)
|
|
301
218
|
});
|
|
@@ -330,24 +247,37 @@ const BracketRoom = ({
|
|
|
330
247
|
data: sections,
|
|
331
248
|
keyExtractor: item => item,
|
|
332
249
|
refreshing: loading ? true : false,
|
|
333
|
-
onRefresh: () => loadData(),
|
|
334
250
|
key: 'bracket_sections',
|
|
335
251
|
renderItem: renderSections
|
|
336
|
-
})),
|
|
337
|
-
|
|
252
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
|
|
253
|
+
visible: show_competition_actions,
|
|
254
|
+
transparent: true,
|
|
338
255
|
style: {
|
|
339
|
-
|
|
340
|
-
backgroundColor: Colors.text.action,
|
|
341
|
-
borderBottomRightRadius: 0,
|
|
342
|
-
borderBottomLeftRadius: 0
|
|
256
|
+
flex: 1
|
|
343
257
|
},
|
|
344
|
-
|
|
258
|
+
animationType: 'slide'
|
|
259
|
+
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
260
|
+
type: "blur",
|
|
261
|
+
style: {
|
|
262
|
+
flex: 1,
|
|
263
|
+
justifyContent: 'flex-end',
|
|
264
|
+
padding: 10,
|
|
265
|
+
paddingBottom: (insets?.bottom ?? 0) + 10
|
|
266
|
+
}
|
|
267
|
+
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
268
|
+
float: true,
|
|
269
|
+
style: {
|
|
270
|
+
maxHeight: 700
|
|
271
|
+
}
|
|
345
272
|
}, active_competition ? /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
346
273
|
transparent: true,
|
|
347
274
|
style: {
|
|
275
|
+
backgroundColor: Colors.text.action,
|
|
348
276
|
flexDirection: 'row',
|
|
349
277
|
alignItems: 'center',
|
|
350
|
-
padding: 10
|
|
278
|
+
padding: 10,
|
|
279
|
+
borderTopRightRadius: 8,
|
|
280
|
+
borderTopLeftRadius: 8
|
|
351
281
|
}
|
|
352
282
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
353
283
|
source: {
|
|
@@ -374,128 +304,116 @@ const BracketRoom = ({
|
|
|
374
304
|
theme: "description",
|
|
375
305
|
color: Colors.text.white
|
|
376
306
|
}, active_competition.competition_name)), /*#__PURE__*/_react.default.createElement(_Themed.Button, {
|
|
307
|
+
type: "text",
|
|
377
308
|
float: true,
|
|
378
|
-
disabled: true,
|
|
379
|
-
type: "action",
|
|
380
|
-
title: "VIEW",
|
|
381
|
-
onPress: () => console.log('')
|
|
382
|
-
})) : /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
383
|
-
transparent: true,
|
|
384
309
|
style: {
|
|
310
|
+
padding: 10,
|
|
385
311
|
flexDirection: 'row',
|
|
386
|
-
alignItems: 'center'
|
|
387
|
-
padding: 10
|
|
388
|
-
}
|
|
389
|
-
}, /*#__PURE__*/_react.default.createElement(_Components.Icons.BracketIcon, {
|
|
390
|
-
size: 20,
|
|
391
|
-
color: Colors.text.white
|
|
392
|
-
}), /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
393
|
-
transparent: true,
|
|
394
|
-
style: {
|
|
395
|
-
flex: 1,
|
|
396
|
-
marginLeft: 10
|
|
397
|
-
}
|
|
398
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.Text, {
|
|
399
|
-
theme: "h2",
|
|
400
|
-
color: Colors.text.white
|
|
401
|
-
}, "Available Competitions"), /*#__PURE__*/_react.default.createElement(_Themed.Text, {
|
|
402
|
-
style: {
|
|
403
|
-
marginTop: 3
|
|
312
|
+
alignItems: 'center'
|
|
404
313
|
},
|
|
405
|
-
|
|
314
|
+
onPress: () => {
|
|
315
|
+
setShowCompetitionActions(false);
|
|
316
|
+
setTimeout(() => {
|
|
317
|
+
onShareCompetition(active_competition);
|
|
318
|
+
}, 500);
|
|
319
|
+
}
|
|
320
|
+
}, /*#__PURE__*/_react.default.createElement(_Components.Icons.ShareIcon, {
|
|
321
|
+
size: 14,
|
|
406
322
|
color: Colors.text.white
|
|
407
|
-
}
|
|
408
|
-
float: true,
|
|
409
|
-
disabled: true,
|
|
410
|
-
type: "action",
|
|
411
|
-
title: "VIEW",
|
|
412
|
-
onPress: () => console.log('')
|
|
413
|
-
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)), mode != 'small' && active_bracket_id ? /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
414
|
-
type: "header",
|
|
323
|
+
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
415
324
|
style: {
|
|
416
|
-
|
|
325
|
+
flexGrow: 1
|
|
417
326
|
}
|
|
418
|
-
}, /*#__PURE__*/_react.default.createElement(_BracketCompetitionActions.default, {
|
|
327
|
+
}, active_bracket_id ? /*#__PURE__*/_react.default.createElement(_BracketCompetitionActions.default, {
|
|
419
328
|
view_mode: view_mode,
|
|
329
|
+
onRequestAuthenticate: () => onRequestAuthenticate(active_competition?.auth_strategy_id),
|
|
420
330
|
player: player,
|
|
331
|
+
hide_image: true,
|
|
421
332
|
onManage: onManageCompetition,
|
|
333
|
+
onCreateNewCompetition: bracket_id => {
|
|
334
|
+
if (!onCreateNewCompetition) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
setShowCompetitionActions(false);
|
|
338
|
+
setTimeout(() => {
|
|
339
|
+
onCreateNewCompetition(bracket_id);
|
|
340
|
+
}, 500);
|
|
341
|
+
},
|
|
422
342
|
insets: insets,
|
|
423
|
-
|
|
424
|
-
onRequestAuthenticate: () => onRequestAuthenticate(active_competition?.auth_strategy_id),
|
|
425
|
-
onSelectCompetition: bc => {
|
|
343
|
+
onFoundCompetition: bc => {
|
|
426
344
|
setNavData({
|
|
427
345
|
...nav_data,
|
|
428
|
-
|
|
346
|
+
active_competition: bc,
|
|
347
|
+
active_bracket_id: bc.bracket_id
|
|
429
348
|
});
|
|
430
349
|
},
|
|
431
|
-
|
|
432
|
-
setRoomData({
|
|
433
|
-
...room_data,
|
|
434
|
-
public_competitions: public_competitions.filter(pc => pc.bracket_competition_id != bc.bracket_competition_id).concat(bc)
|
|
435
|
-
});
|
|
350
|
+
onSelectCompetition: async bc => {
|
|
436
351
|
setNavData({
|
|
437
352
|
...nav_data,
|
|
438
|
-
active_competition_id: bc.bracket_competition_id,
|
|
439
353
|
active_bracket_id: bc.bracket_id,
|
|
440
|
-
|
|
354
|
+
active_competition: bc
|
|
441
355
|
});
|
|
442
356
|
},
|
|
443
357
|
onFocusPosition: onFocusPosition,
|
|
444
358
|
player_brackets: player_brackets,
|
|
445
359
|
onEnterCompetition: (new_bc, new_cpb, new_pb) => {
|
|
446
|
-
setMyData({
|
|
447
|
-
...my_data,
|
|
448
|
-
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
449
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb),
|
|
450
|
-
player_brackets: !new_pb ? player_brackets : player_brackets.filter(pb => pb.player_bracket_id != new_pb.player_bracket_id).concat(new_pb)
|
|
451
|
-
});
|
|
452
360
|
if (new_pb) {
|
|
453
361
|
setNavData({
|
|
454
362
|
...nav_data,
|
|
455
|
-
active_player_bracket_id: new_pb
|
|
363
|
+
active_player_bracket_id: new_pb?.player_bracket_id,
|
|
364
|
+
active_competition: new_bc
|
|
456
365
|
});
|
|
457
366
|
}
|
|
367
|
+
setPlayData({
|
|
368
|
+
...play_data,
|
|
369
|
+
player_brackets: new_pb ? player_brackets.concat(new_pb) : player_brackets,
|
|
370
|
+
competition_player_brackets: competition_player_brackets.concat(new_cpb)
|
|
371
|
+
});
|
|
372
|
+
},
|
|
373
|
+
competition_id: active_competition?.bracket_competition_id,
|
|
374
|
+
onLeaveCompetition: (bc, rem_cpb) => {
|
|
375
|
+
setNavData({
|
|
376
|
+
...nav_data,
|
|
377
|
+
active_competition: bc
|
|
378
|
+
});
|
|
379
|
+
setPlayData({
|
|
380
|
+
...play_data,
|
|
381
|
+
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != rem_cpb.competition_player_bracket_id)
|
|
382
|
+
});
|
|
458
383
|
},
|
|
459
|
-
competition_id: active_competition_id,
|
|
460
|
-
onLeaveCompetition: (new_bc, new_cpb) => setMyData({
|
|
461
|
-
...my_data,
|
|
462
|
-
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
463
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb)
|
|
464
|
-
}),
|
|
465
384
|
competition_result_types: competition_result_types,
|
|
466
385
|
bracket_id: active_bracket_id,
|
|
467
386
|
player_balance: local_balance,
|
|
468
|
-
player_bracket:
|
|
387
|
+
player_bracket: player_brackets.find(pb => pb.player_bracket_id == active_player_bracket_id),
|
|
469
388
|
competition_player_brackets: competition_player_brackets
|
|
470
|
-
})
|
|
471
|
-
|
|
472
|
-
|
|
389
|
+
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)), /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
390
|
+
type: "footer",
|
|
391
|
+
style: {
|
|
392
|
+
flexDirection: 'row',
|
|
393
|
+
padding: 10
|
|
394
|
+
}
|
|
395
|
+
}, /*#__PURE__*/_react.default.createElement(_Themed.Button, {
|
|
473
396
|
style: {
|
|
474
397
|
flex: 1
|
|
475
398
|
},
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
flex: 1,
|
|
481
|
-
justifyContent: 'flex-end',
|
|
482
|
-
padding: 10,
|
|
483
|
-
paddingBottom: (insets?.bottom ?? 0) + 10
|
|
484
|
-
}
|
|
485
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
399
|
+
title: "CLOSE",
|
|
400
|
+
type: "close",
|
|
401
|
+
onPress: () => setShowCompetitionActions(false)
|
|
402
|
+
}))))), mode == 'small' && active_bracket_id ? /*#__PURE__*/_react.default.createElement(_Themed.Button, {
|
|
486
403
|
float: true,
|
|
487
404
|
style: {
|
|
488
|
-
|
|
489
|
-
|
|
405
|
+
padding: 0,
|
|
406
|
+
backgroundColor: Colors.text.action,
|
|
407
|
+
borderBottomRightRadius: 0,
|
|
408
|
+
borderBottomLeftRadius: 0
|
|
409
|
+
},
|
|
410
|
+
onPress: () => setShowCompetitionActions(true)
|
|
490
411
|
}, active_competition ? /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
491
412
|
transparent: true,
|
|
492
413
|
style: {
|
|
493
|
-
backgroundColor: Colors.text.action,
|
|
494
414
|
flexDirection: 'row',
|
|
495
415
|
alignItems: 'center',
|
|
496
|
-
padding: 10
|
|
497
|
-
borderTopRightRadius: 8,
|
|
498
|
-
borderTopLeftRadius: 8
|
|
416
|
+
padding: 10
|
|
499
417
|
}
|
|
500
418
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
501
419
|
source: {
|
|
@@ -522,27 +440,48 @@ const BracketRoom = ({
|
|
|
522
440
|
theme: "description",
|
|
523
441
|
color: Colors.text.white
|
|
524
442
|
}, active_competition.competition_name)), /*#__PURE__*/_react.default.createElement(_Themed.Button, {
|
|
525
|
-
type: "text",
|
|
526
443
|
float: true,
|
|
444
|
+
disabled: true,
|
|
445
|
+
type: "action",
|
|
446
|
+
title: "VIEW",
|
|
447
|
+
onPress: () => console.log('')
|
|
448
|
+
})) : /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
449
|
+
transparent: true,
|
|
527
450
|
style: {
|
|
528
|
-
padding: 10,
|
|
529
451
|
flexDirection: 'row',
|
|
530
|
-
alignItems: 'center'
|
|
531
|
-
|
|
532
|
-
onPress: () => {
|
|
533
|
-
setShowCompetitionActions(false);
|
|
534
|
-
setTimeout(() => {
|
|
535
|
-
onShareCompetition(active_competition);
|
|
536
|
-
}, 500);
|
|
452
|
+
alignItems: 'center',
|
|
453
|
+
padding: 10
|
|
537
454
|
}
|
|
538
|
-
}, /*#__PURE__*/_react.default.createElement(_Components.Icons.
|
|
539
|
-
size:
|
|
455
|
+
}, /*#__PURE__*/_react.default.createElement(_Components.Icons.TrophyIcon, {
|
|
456
|
+
size: 20,
|
|
540
457
|
color: Colors.text.white
|
|
541
|
-
})
|
|
458
|
+
}), /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
459
|
+
transparent: true,
|
|
542
460
|
style: {
|
|
543
|
-
|
|
461
|
+
flex: 1,
|
|
462
|
+
marginLeft: 10
|
|
544
463
|
}
|
|
545
|
-
},
|
|
464
|
+
}, /*#__PURE__*/_react.default.createElement(_Themed.Text, {
|
|
465
|
+
theme: "h2",
|
|
466
|
+
color: Colors.text.white
|
|
467
|
+
}, "Available Competitions"), /*#__PURE__*/_react.default.createElement(_Themed.Text, {
|
|
468
|
+
style: {
|
|
469
|
+
marginTop: 3
|
|
470
|
+
},
|
|
471
|
+
theme: "description",
|
|
472
|
+
color: Colors.text.white
|
|
473
|
+
}, "Press here to see eligible competitions to join!")), /*#__PURE__*/_react.default.createElement(_Themed.Button, {
|
|
474
|
+
float: true,
|
|
475
|
+
disabled: true,
|
|
476
|
+
type: "action",
|
|
477
|
+
title: "VIEW",
|
|
478
|
+
onPress: () => console.log('')
|
|
479
|
+
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)), mode != 'small' && active_bracket_id ? /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
480
|
+
type: "header",
|
|
481
|
+
style: {
|
|
482
|
+
width: 300
|
|
483
|
+
}
|
|
484
|
+
}, /*#__PURE__*/_react.default.createElement(_BracketCompetitionActions.default, {
|
|
546
485
|
view_mode: view_mode,
|
|
547
486
|
onRequestAuthenticate: () => onRequestAuthenticate(active_competition?.auth_strategy_id),
|
|
548
487
|
player: player,
|
|
@@ -559,165 +498,52 @@ const BracketRoom = ({
|
|
|
559
498
|
},
|
|
560
499
|
insets: insets,
|
|
561
500
|
onFoundCompetition: bc => {
|
|
562
|
-
setRoomData({
|
|
563
|
-
...room_data,
|
|
564
|
-
public_competitions: public_competitions.filter(pc => pc.bracket_competition_id != bc.bracket_competition_id).concat(bc)
|
|
565
|
-
});
|
|
566
501
|
setNavData({
|
|
567
502
|
...nav_data,
|
|
568
|
-
|
|
569
|
-
active_bracket_id: bc.bracket_id
|
|
570
|
-
active_player_bracket_id: active_player_bracket?.bracket_id == bc.bracket_id ? active_player_bracket_id : player_brackets.find(pb => pb.status != 'deleted' && pb.bracket_id == bc.bracket_id)?.player_bracket_id
|
|
503
|
+
active_competition: bc,
|
|
504
|
+
active_bracket_id: bc.bracket_id
|
|
571
505
|
});
|
|
572
506
|
},
|
|
573
|
-
onSelectCompetition: bc => {
|
|
507
|
+
onSelectCompetition: async bc => {
|
|
574
508
|
setNavData({
|
|
575
509
|
...nav_data,
|
|
576
|
-
|
|
510
|
+
active_bracket_id: bc.bracket_id,
|
|
511
|
+
active_competition: bc
|
|
577
512
|
});
|
|
578
513
|
},
|
|
579
514
|
onFocusPosition: onFocusPosition,
|
|
580
515
|
player_brackets: player_brackets,
|
|
581
516
|
onEnterCompetition: (new_bc, new_cpb, new_pb) => {
|
|
582
|
-
setMyData({
|
|
583
|
-
...my_data,
|
|
584
|
-
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
585
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb),
|
|
586
|
-
player_brackets: !new_pb ? player_brackets : player_brackets.filter(pb => pb.player_bracket_id != new_pb.player_bracket_id).concat(new_pb)
|
|
587
|
-
});
|
|
588
517
|
if (new_pb) {
|
|
589
518
|
setNavData({
|
|
590
519
|
...nav_data,
|
|
591
|
-
active_player_bracket_id: new_pb
|
|
520
|
+
active_player_bracket_id: new_pb?.player_bracket_id,
|
|
521
|
+
active_competition: new_bc
|
|
592
522
|
});
|
|
593
523
|
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
599
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb)
|
|
600
|
-
}),
|
|
601
|
-
competition_result_types: competition_result_types,
|
|
602
|
-
bracket_id: active_bracket_id,
|
|
603
|
-
player_balance: local_balance,
|
|
604
|
-
player_bracket: active_player_bracket,
|
|
605
|
-
competition_player_brackets: competition_player_brackets
|
|
606
|
-
}) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)), /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
607
|
-
type: "footer",
|
|
608
|
-
style: {
|
|
609
|
-
flexDirection: 'row',
|
|
610
|
-
padding: 10
|
|
611
|
-
}
|
|
612
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.Button, {
|
|
613
|
-
style: {
|
|
614
|
-
flex: 1
|
|
615
|
-
},
|
|
616
|
-
title: "CLOSE",
|
|
617
|
-
type: "close",
|
|
618
|
-
onPress: () => setShowCompetitionActions(false)
|
|
619
|
-
}))))), /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
|
|
620
|
-
visible: show_pb_selector,
|
|
621
|
-
style: {
|
|
622
|
-
flex: 1
|
|
623
|
-
},
|
|
624
|
-
transparent: true,
|
|
625
|
-
animationType: view_mode == 'desktop' ? 'fade' : 'slide'
|
|
626
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
627
|
-
type: "blur",
|
|
628
|
-
style: view_mode == 'desktop' ? {
|
|
629
|
-
flex: 1,
|
|
630
|
-
justifyContent: 'center',
|
|
631
|
-
alignItems: 'center'
|
|
632
|
-
} : {
|
|
633
|
-
flex: 1,
|
|
634
|
-
justifyContent: 'flex-end',
|
|
635
|
-
paddingBottom: insets?.bottom ?? 0
|
|
636
|
-
}
|
|
637
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
638
|
-
float: true,
|
|
639
|
-
style: view_mode == 'desktop' ? {
|
|
640
|
-
width: 500
|
|
641
|
-
} : {
|
|
642
|
-
margin: 10
|
|
643
|
-
}
|
|
644
|
-
}, /*#__PURE__*/_react.default.createElement(_PlayerBrackets.default, {
|
|
645
|
-
player_brackets: player_brackets.filter(pb => pb.bracket_id == active_bracket_id && pb.status != 'deleted'),
|
|
646
|
-
brackets: brackets,
|
|
647
|
-
leagues: leagues,
|
|
648
|
-
bracket_id: active_bracket_id,
|
|
649
|
-
onCreateNew: newpb => {
|
|
650
|
-
setShowPBSelector(false);
|
|
651
|
-
setNavData({
|
|
652
|
-
...nav_data,
|
|
653
|
-
active_player_bracket_id: newpb.player_bracket_id
|
|
654
|
-
});
|
|
655
|
-
setMyData({
|
|
656
|
-
...my_data,
|
|
657
|
-
player_brackets: player_brackets.filter(pb => pb.player_bracket_id != newpb.player_bracket_id).concat(newpb)
|
|
524
|
+
setPlayData({
|
|
525
|
+
...play_data,
|
|
526
|
+
player_brackets: new_pb ? player_brackets.concat(new_pb) : player_brackets,
|
|
527
|
+
competition_player_brackets: competition_player_brackets.concat(new_cpb)
|
|
658
528
|
});
|
|
659
529
|
},
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
bracket_competitions: bracket_competitions,
|
|
663
|
-
competition_player_brackets: competition_player_brackets,
|
|
664
|
-
onClose: () => setShowPBSelector(false),
|
|
665
|
-
onSelect: pb => {
|
|
666
|
-
setShowPBSelector(false);
|
|
530
|
+
competition_id: active_competition?.bracket_competition_id,
|
|
531
|
+
onLeaveCompetition: (bc, rem_cpb) => {
|
|
667
532
|
setNavData({
|
|
668
533
|
...nav_data,
|
|
669
|
-
|
|
534
|
+
active_competition: bc
|
|
670
535
|
});
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
style: {
|
|
675
|
-
flex: 1
|
|
676
|
-
},
|
|
677
|
-
transparent: true,
|
|
678
|
-
animationType: view_mode == 'desktop' ? 'fade' : 'slide'
|
|
679
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
680
|
-
type: "blur",
|
|
681
|
-
style: view_mode == 'desktop' ? {
|
|
682
|
-
flex: 1,
|
|
683
|
-
justifyContent: 'center',
|
|
684
|
-
alignItems: 'center'
|
|
685
|
-
} : {
|
|
686
|
-
flex: 1,
|
|
687
|
-
justifyContent: 'flex-end',
|
|
688
|
-
paddingBottom: insets?.bottom ?? 0
|
|
689
|
-
}
|
|
690
|
-
}, /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
691
|
-
float: true,
|
|
692
|
-
style: view_mode == 'desktop' ? {
|
|
693
|
-
width: 500
|
|
694
|
-
} : {
|
|
695
|
-
margin: 10
|
|
696
|
-
}
|
|
697
|
-
}, /*#__PURE__*/_react.default.createElement(_EditPlayerBracket.default, {
|
|
698
|
-
player_bracket: editing_player_bracket,
|
|
699
|
-
onClose: () => setEditingPlayerBracket(undefined),
|
|
700
|
-
onFocusPosition: onFocusPosition,
|
|
701
|
-
onUpdatePlayerBracket: new_pb => {
|
|
702
|
-
setNavData({
|
|
703
|
-
...nav_data,
|
|
704
|
-
active_player_bracket_id: undefined
|
|
536
|
+
setPlayData({
|
|
537
|
+
...play_data,
|
|
538
|
+
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != rem_cpb.competition_player_bracket_id)
|
|
705
539
|
});
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
...nav_data,
|
|
714
|
-
active_player_bracket_id: new_pb.player_bracket_id
|
|
715
|
-
});
|
|
716
|
-
}, 200);
|
|
717
|
-
}
|
|
718
|
-
setEditingPlayerBracket(undefined);
|
|
719
|
-
}
|
|
720
|
-
})))), loading ? /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
540
|
+
},
|
|
541
|
+
competition_result_types: competition_result_types,
|
|
542
|
+
bracket_id: active_bracket_id,
|
|
543
|
+
player_balance: local_balance,
|
|
544
|
+
player_bracket: player_brackets.find(pb => pb.player_bracket_id == active_player_bracket_id),
|
|
545
|
+
competition_player_brackets: competition_player_brackets
|
|
546
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)), loading ? /*#__PURE__*/_react.default.createElement(_Themed.View, {
|
|
721
547
|
type: "blur",
|
|
722
548
|
style: {
|
|
723
549
|
position: 'absolute',
|