be-components 4.5.0 → 4.5.2
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/components/BracketCompetitionActions.js +16 -2
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js.map +1 -1
- package/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.js +28 -5
- package/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.js.map +1 -1
- package/lib/commonjs/Bracket/index.js +12 -5
- package/lib/commonjs/Bracket/index.js.map +1 -1
- package/lib/module/Bracket/components/BracketCompetitionActions.js +16 -2
- package/lib/module/Bracket/components/BracketCompetitionActions.js.map +1 -1
- package/lib/module/Bracket/components/ManageBracketCompetitionForm.js +28 -5
- package/lib/module/Bracket/components/ManageBracketCompetitionForm.js.map +1 -1
- package/lib/module/Bracket/index.js +12 -5
- package/lib/module/Bracket/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/ManageBracketCompetitionForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts +2 -1
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/ManageBracketCompetitionForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/index.d.ts +2 -1
- package/lib/typescript/lib/module/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts +2 -1
- package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/ManageBracketCompetitionForm.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/index.d.ts +2 -1
- package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Bracket/components/BracketCompetitionActions.tsx +13 -2
- package/src/Bracket/components/ManageBracketCompetitionForm.tsx +20 -10
- package/src/Bracket/index.tsx +65 -61
package/src/Bracket/index.tsx
CHANGED
|
@@ -20,6 +20,7 @@ type BracketRoomProps = {
|
|
|
20
20
|
width:number,
|
|
21
21
|
player_balance?:PlayerBalanceProps,
|
|
22
22
|
bracket_competition_id?:string,
|
|
23
|
+
onManageCompetition:(bracket_competition_id:string) => void,
|
|
23
24
|
onFocusPosition?:(data:{ x:number, y:number, height:number, width:number }) => void,
|
|
24
25
|
onShareCompetition:(bracket_competition:BracketCompetitionProps) => void,
|
|
25
26
|
onRequestAuthenticate: (auth_strategy_id?:string) => void,
|
|
@@ -30,7 +31,7 @@ type BracketRoomProps = {
|
|
|
30
31
|
const sections = ['header', 'home', 'bracket_selector', 'bracket']
|
|
31
32
|
const MAX_WIDTH = 1200
|
|
32
33
|
|
|
33
|
-
const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreateNewCompetition, bracket_competition_id, player_balance, onRequestAuthenticate, onFocusPosition, onShareCompetition }:BracketRoomProps) => {
|
|
34
|
+
const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreateNewCompetition, onManageCompetition, bracket_competition_id, player_balance, onRequestAuthenticate, onFocusPosition, onShareCompetition }:BracketRoomProps) => {
|
|
34
35
|
const Colors = useColors();
|
|
35
36
|
const [ loading, setLoading ] = useState<string|undefined>(undefined);
|
|
36
37
|
const [ show_competition_actions, setShowCompetitionActions ] = useState(false);
|
|
@@ -147,7 +148,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
147
148
|
...room_data,
|
|
148
149
|
room_loaded: true,
|
|
149
150
|
active_brackets: pub_brackets,
|
|
150
|
-
public_competitions: pub_competitions
|
|
151
|
+
public_competitions: pub_competitions.filter(pc => pc.status == 'scheduled')
|
|
151
152
|
});
|
|
152
153
|
if(mode == 'small'){ return setShowCompetitionActions(true) }
|
|
153
154
|
return
|
|
@@ -166,7 +167,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
166
167
|
...room_data,
|
|
167
168
|
room_loaded: true,
|
|
168
169
|
active_brackets: pub_brackets,
|
|
169
|
-
public_competitions: pub_competitions
|
|
170
|
+
public_competitions: pub_competitions.filter(pc => pc.status == 'scheduled')
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -345,6 +346,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
345
346
|
<BracketCompetitionActions
|
|
346
347
|
view_mode={view_mode}
|
|
347
348
|
player={player}
|
|
349
|
+
onManage={onManageCompetition}
|
|
348
350
|
insets={insets}
|
|
349
351
|
onCreateNewCompetition={onCreateNewCompetition}
|
|
350
352
|
onRequestAuthenticate={() => onRequestAuthenticate(active_competition?.auth_strategy_id)}
|
|
@@ -401,7 +403,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
401
403
|
animationType={'slide'}
|
|
402
404
|
>
|
|
403
405
|
<View type='blur' style={{ flex:1, justifyContent:'flex-end', padding:10, paddingBottom:(insets?.bottom ?? 0)+10 }}>
|
|
404
|
-
<View float style={{ maxHeight:
|
|
406
|
+
<View float style={{ maxHeight:700 }}>
|
|
405
407
|
{active_competition ?
|
|
406
408
|
<View transparent style={{ backgroundColor:Colors.text.action, flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
407
409
|
<Image
|
|
@@ -429,64 +431,67 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
429
431
|
</Button>
|
|
430
432
|
</View>
|
|
431
433
|
:<></>}
|
|
432
|
-
{
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
434
|
+
<View style={{ flex:1 }}>
|
|
435
|
+
{active_bracket_id ?
|
|
436
|
+
<BracketCompetitionActions
|
|
437
|
+
view_mode={view_mode}
|
|
438
|
+
onRequestAuthenticate={() => onRequestAuthenticate(active_competition?.auth_strategy_id)}
|
|
439
|
+
player={player}
|
|
440
|
+
hide_image
|
|
441
|
+
onManage={onManageCompetition}
|
|
442
|
+
onCreateNewCompetition={(bracket_id) => {
|
|
443
|
+
if(!onCreateNewCompetition){ return }
|
|
444
|
+
setShowCompetitionActions(false);
|
|
445
|
+
setTimeout(() => {
|
|
446
|
+
onCreateNewCompetition(bracket_id);
|
|
447
|
+
}, 500);
|
|
448
|
+
}}
|
|
449
|
+
insets={insets}
|
|
450
|
+
onFoundCompetition={(bc) => {
|
|
451
|
+
setRoomData({
|
|
452
|
+
...room_data,
|
|
453
|
+
public_competitions: public_competitions.filter(pc => pc.bracket_competition_id != bc.bracket_competition_id).concat(bc)
|
|
454
|
+
});
|
|
455
|
+
setNavData({
|
|
456
|
+
...nav_data,
|
|
457
|
+
active_competition_id: bc.bracket_competition_id,
|
|
458
|
+
active_bracket_id: bc.bracket_id,
|
|
459
|
+
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
|
|
460
|
+
})
|
|
461
|
+
}}
|
|
462
|
+
onSelectCompetition={(bc) => {
|
|
463
|
+
setNavData({
|
|
464
|
+
...nav_data,
|
|
465
|
+
active_competition_id: bc.bracket_competition_id
|
|
466
|
+
})
|
|
467
|
+
}}
|
|
468
|
+
onFocusPosition={onFocusPosition}
|
|
469
|
+
player_brackets={player_brackets}
|
|
470
|
+
onEnterCompetition={(new_bc, new_cpb, new_pb) => {
|
|
471
|
+
setMyData({
|
|
472
|
+
...my_data,
|
|
473
|
+
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
474
|
+
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb),
|
|
475
|
+
player_brackets: !new_pb ? player_brackets : player_brackets.filter(pb => pb.player_bracket_id != new_pb.player_bracket_id).concat(new_pb)
|
|
476
|
+
});
|
|
477
|
+
if(new_pb){
|
|
478
|
+
setNavData({ ...nav_data, active_player_bracket_id: new_pb.player_bracket_id })
|
|
479
|
+
}
|
|
480
|
+
}}
|
|
481
|
+
competition_id={active_competition_id}
|
|
482
|
+
onLeaveCompetition={(new_bc, new_cpb) => setMyData({
|
|
468
483
|
...my_data,
|
|
469
484
|
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
470
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb)
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
bracket_competitions: bracket_competitions.filter(bc => bc.bracket_competition_id != new_bc.bracket_competition_id).concat(new_bc),
|
|
481
|
-
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb)
|
|
482
|
-
})}
|
|
483
|
-
competition_result_types={competition_result_types}
|
|
484
|
-
bracket_id={active_bracket_id}
|
|
485
|
-
player_balance={local_balance}
|
|
486
|
-
player_bracket={active_player_bracket}
|
|
487
|
-
competition_player_brackets={competition_player_brackets}
|
|
488
|
-
/>
|
|
489
|
-
:<></>}
|
|
485
|
+
competition_player_brackets: competition_player_brackets.filter(cpb => cpb.competition_player_bracket_id != new_cpb.competition_player_bracket_id).concat(new_cpb)
|
|
486
|
+
})}
|
|
487
|
+
competition_result_types={competition_result_types}
|
|
488
|
+
bracket_id={active_bracket_id}
|
|
489
|
+
player_balance={local_balance}
|
|
490
|
+
player_bracket={active_player_bracket}
|
|
491
|
+
competition_player_brackets={competition_player_brackets}
|
|
492
|
+
/>
|
|
493
|
+
:<></>}
|
|
494
|
+
</View>
|
|
490
495
|
<View type='footer' style={{ flexDirection:'row', padding:10 }}>
|
|
491
496
|
<Button
|
|
492
497
|
style={{ flex:1 }}
|
|
@@ -565,7 +570,6 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
565
570
|
</View>
|
|
566
571
|
</View>
|
|
567
572
|
</Modal>
|
|
568
|
-
|
|
569
573
|
{loading ?
|
|
570
574
|
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
|
|
571
575
|
<View float style={{ width:300, height:300 }}>
|