be-components 4.6.2 → 4.6.4
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/BracketPlay/BracketRound.js +5 -1
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.js +32 -7
- package/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/index.js +6 -0
- package/lib/commonjs/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/commonjs/Bracket/index.js +4 -1
- package/lib/commonjs/Bracket/index.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js +5 -1
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/RoundEvent.js +32 -7
- package/lib/module/Bracket/components/BracketPlay/RoundEvent.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/index.js +6 -0
- package/lib/module/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/module/Bracket/index.js +4 -1
- package/lib/module/Bracket/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/BracketRound.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.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/BracketPlay/BracketRound.d.ts +3 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/RoundEvent.d.ts +3 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/RoundEvent.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts +2 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.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/BracketPlay/BracketRound.d.ts +4 -2
- package/lib/typescript/src/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/RoundEvent.d.ts +4 -2
- package/lib/typescript/src/Bracket/components/BracketPlay/RoundEvent.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts +3 -2
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/index.d.ts +3 -2
- package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Bracket/components/BracketPlay/BracketRound.tsx +6 -2
- package/src/Bracket/components/BracketPlay/RoundEvent.tsx +32 -20
- package/src/Bracket/components/BracketPlay/index.tsx +5 -1
- package/src/Bracket/index.tsx +5 -3
- package/src/types.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BracketRound.d.ts","sourceRoot":"","sources":["../../../../../../src/Bracket/components/BracketPlay/BracketRound.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"BracketRound.d.ts","sourceRoot":"","sources":["../../../../../../src/Bracket/components/BracketPlay/BracketRound.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOxI,KAAK,wBAAwB,GAAG;IAC5B,iBAAiB,CAAC,EAAC,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAC,MAAM,CAAC;IAC5B,oBAAoB,EAAE,sBAAsB,EAAE,CAAC;IAC/C,aAAa,EAAC,iBAAiB,CAAC;IAChC,QAAQ,CAAC,EAAC,OAAO,CAAC;IAClB,OAAO,CAAC,EAAC,YAAY,CAAC;IACtB,YAAY,EAAC,eAAe,EAAE,CAAC;IAC/B,KAAK,EAAC,SAAS,EAAE,CAAC;IAClB,QAAQ,EAAC,YAAY,EAAE,CAAC;IACxB,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,KAAK,EAAC,MAAM,CAAC;IACb,WAAW,EAAC,MAAM,GAAC,OAAO,CAAC;IAC3B,aAAa,EAAC,CAAC,aAAa,EAAC,iBAAiB,KAAK,IAAI,CAAC;IACxD,eAAe,CAAC,EAAC,CAAC,WAAW,EAAC,eAAe,KAAK,IAAI,CAAA;IACtD,uBAAuB,CAAC,EAAC,MAAM,CAAC;IAChC,MAAM,EAAE,CAAC,mBAAmB,EAAC,sBAAsB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,EAAC,OAAO,CAAC;IAClB,SAAS,CAAC,EAAC,OAAO,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,mBAAmB,8LAA8L,wBAAwB,sBA8D9O,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AthleteProps, EventProps, PlayerBracketPickProps, RoundEventProps, TeamProps } from "../../../types";
|
|
2
|
+
import type { AthleteProps, BracketProps, EventProps, PlayerBracketPickProps, RoundEventProps, TeamProps } from "../../../types";
|
|
3
3
|
type RoundEventCardProps = {
|
|
4
4
|
round_event: RoundEventProps;
|
|
5
5
|
round_events: RoundEventProps[];
|
|
@@ -10,6 +10,7 @@ type RoundEventCardProps = {
|
|
|
10
10
|
away_placeholder_team?: TeamProps;
|
|
11
11
|
home_placeholder_team?: TeamProps;
|
|
12
12
|
away_athlete?: AthleteProps;
|
|
13
|
+
bracket?: BracketProps;
|
|
13
14
|
home_athlete?: AthleteProps;
|
|
14
15
|
loading?: boolean;
|
|
15
16
|
width: number;
|
|
@@ -17,7 +18,8 @@ type RoundEventCardProps = {
|
|
|
17
18
|
away_placeholder_pick?: PlayerBracketPickProps;
|
|
18
19
|
home_placeholder_pick?: PlayerBracketPickProps;
|
|
19
20
|
onPick: (player_bracket_pick: PlayerBracketPickProps) => void;
|
|
21
|
+
onSelectContest?: (round_event: RoundEventProps) => void;
|
|
20
22
|
};
|
|
21
|
-
declare const RoundEventCard: ({ event, loading, away_team, away_placeholder_team, home_placeholder_team, home_team, width, no_pick, round_event, player_bracket_pick, away_placeholder_pick, home_placeholder_pick, onPick }: RoundEventCardProps) => React.JSX.Element;
|
|
23
|
+
declare const RoundEventCard: ({ event, loading, bracket, away_team, away_placeholder_team, home_placeholder_team, home_team, width, no_pick, round_event, player_bracket_pick, away_placeholder_pick, home_placeholder_pick, onPick, onSelectContest }: RoundEventCardProps) => React.JSX.Element;
|
|
22
24
|
export default RoundEventCard;
|
|
23
25
|
//# sourceMappingURL=RoundEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoundEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/Bracket/components/BracketPlay/RoundEvent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"RoundEvent.d.ts","sourceRoot":"","sources":["../../../../../../src/Bracket/components/BracketPlay/RoundEvent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAOhI,KAAK,mBAAmB,GAAG;IACvB,WAAW,EAAC,eAAe,CAAC;IAC5B,YAAY,EAAC,eAAe,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAC,UAAU,CAAC;IAClB,mBAAmB,CAAC,EAAC,sBAAsB,CAAC;IAC5C,SAAS,CAAC,EAAC,SAAS,CAAC;IACrB,SAAS,CAAC,EAAC,SAAS,CAAC;IACrB,qBAAqB,CAAC,EAAC,SAAS,CAAC;IACjC,qBAAqB,CAAC,EAAC,SAAS,CAAC;IACjC,YAAY,CAAC,EAAC,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAC,YAAY,CAAC;IACtB,YAAY,CAAC,EAAC,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAC,OAAO,CAAC;IACjB,KAAK,EAAC,MAAM,CAAC;IACb,OAAO,CAAC,EAAC,OAAO,CAAC;IACjB,qBAAqB,CAAC,EAAC,sBAAsB,CAAC;IAC9C,qBAAqB,CAAC,EAAC,sBAAsB,CAAC;IAC9C,MAAM,EAAC,CAAC,mBAAmB,EAAC,sBAAsB,KAAK,IAAI,CAAC;IAC5D,eAAe,CAAC,EAAC,CAAC,WAAW,EAAC,eAAe,KAAK,IAAI,CAAA;CACzD,CAAA;AAED,QAAA,MAAM,cAAc,6NAA6N,mBAAmB,sBAqPnQ,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CompetitionPlayerBracketProps, MyPlayerProps, PlayerBracketProps } from '../../../types';
|
|
2
|
+
import type { BracketProps, CompetitionPlayerBracketProps, MyPlayerProps, PlayerBracketProps, RoundEventProps } from '../../../types';
|
|
3
3
|
type BracketPlayProps = {
|
|
4
4
|
player?: MyPlayerProps;
|
|
5
5
|
view_mode?: 'desktop' | 'mobile';
|
|
@@ -13,9 +13,10 @@ type BracketPlayProps = {
|
|
|
13
13
|
bracket_id?: string;
|
|
14
14
|
width: number;
|
|
15
15
|
onRequestAuthenticate: () => void;
|
|
16
|
+
onSelectContest?: (round_event: RoundEventProps, bracket: BracketProps) => void;
|
|
16
17
|
onChangePlayerBracket: (bracket_id: string) => void;
|
|
17
18
|
onPlayerBracketUpdate: (pb: PlayerBracketProps, cpbs: CompetitionPlayerBracketProps[]) => void;
|
|
18
19
|
};
|
|
19
|
-
declare const BracketPlay: ({ player, view_mode, width, bracket_id, player_bracket_id, insets, onPlayerBracketUpdate, onChangePlayerBracket, onRequestAuthenticate }: BracketPlayProps) => React.JSX.Element;
|
|
20
|
+
declare const BracketPlay: ({ player, view_mode, width, bracket_id, onSelectContest, player_bracket_id, insets, onPlayerBracketUpdate, onChangePlayerBracket, onRequestAuthenticate }: BracketPlayProps) => React.JSX.Element;
|
|
20
21
|
export default BracketPlay;
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Bracket/components/BracketPlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Bracket/components/BracketPlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAmC,YAAY,EAAqB,6BAA6B,EAAc,aAAa,EAA0B,kBAAkB,EAAE,eAAe,EAAa,MAAM,gBAAgB,CAAC;AAQzO,KAAK,gBAAgB,GAAG;IACpB,MAAM,CAAC,EAAC,aAAa,CAAA;IACrB,SAAS,CAAC,EAAC,SAAS,GAAC,QAAQ,CAAC;IAC9B,MAAM,CAAC,EAAC;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAA;KAAE,CAAC;IACjE,iBAAiB,CAAC,EAAC,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAC,MAAM,CAAC;IACnB,KAAK,EAAC,MAAM,CAAC;IACb,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,eAAe,CAAC,EAAC,CAAC,WAAW,EAAC,eAAe,EAAE,OAAO,EAAC,YAAY,KAAK,IAAI,CAAA;IAC5E,qBAAqB,EAAE,CAAC,UAAU,EAAC,MAAM,KAAK,IAAI,CAAC;IACnD,qBAAqB,EAAE,CAAC,EAAE,EAAC,kBAAkB,EAAE,IAAI,EAAC,6BAA6B,EAAE,KAAK,IAAI,CAAC;CAChG,CAAA;AAED,QAAA,MAAM,WAAW,8JAA8J,gBAAgB,sBA+O9L,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { BracketCompetitionProps, PlayerBalanceProps } from '../types';
|
|
2
|
+
import type { BracketCompetitionProps, BracketProps, PlayerBalanceProps, RoundEventProps } from '../types';
|
|
3
3
|
type BracketRoomProps = {
|
|
4
4
|
player_id?: string;
|
|
5
5
|
view_mode: 'mobile' | 'desktop';
|
|
@@ -25,9 +25,10 @@ type BracketRoomProps = {
|
|
|
25
25
|
onNotEnoughBalance: (data: {
|
|
26
26
|
bracket_competition: BracketCompetitionProps;
|
|
27
27
|
}) => void;
|
|
28
|
+
onSelectContest?: (round_event: RoundEventProps, bracket: BracketProps) => void;
|
|
28
29
|
onClose?: () => void;
|
|
29
30
|
onCreateNewCompetition?: (bracket_id?: string) => void;
|
|
30
31
|
};
|
|
31
|
-
declare const BracketRoom: ({ player_id, width, view_mode, bracket_id, insets, onCreateNewCompetition, onManageCompetition, bracket_competition_id, player_balance, onRequestAuthenticate, onFocusPosition, onShareCompetition }: BracketRoomProps) => React.JSX.Element;
|
|
32
|
+
declare const BracketRoom: ({ player_id, width, view_mode, bracket_id, insets, onSelectContest, onCreateNewCompetition, onManageCompetition, bracket_competition_id, player_balance, onRequestAuthenticate, onFocusPosition, onShareCompetition }: BracketRoomProps) => React.JSX.Element;
|
|
32
33
|
export default BracketRoom;
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Bracket/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,uBAAuB,EAAyF,kBAAkB,EAAsB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Bracket/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAyF,kBAAkB,EAAsB,eAAe,EAAE,MAAM,UAAU,CAAC;AAWtN,KAAK,gBAAgB,GAAG;IACpB,SAAS,CAAC,EAAC,MAAM,CAAC;IAClB,SAAS,EAAC,QAAQ,GAAC,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAC,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAA;KAAE,CAAC;IAClE,KAAK,EAAC,MAAM,CAAC;IACb,cAAc,CAAC,EAAC,kBAAkB,CAAC;IACnC,sBAAsB,CAAC,EAAC,MAAM,CAAC;IAC/B,mBAAmB,EAAC,CAAC,sBAAsB,EAAC,MAAM,KAAK,IAAI,CAAC;IAC5D,eAAe,CAAC,EAAC,CAAC,IAAI,EAAC;QAAE,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACpF,kBAAkB,EAAC,CAAC,mBAAmB,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACzE,qBAAqB,EAAE,CAAC,gBAAgB,CAAC,EAAC,MAAM,KAAK,IAAI,CAAC;IAC1D,kBAAkB,EAAC,CAAC,IAAI,EAAC;QAAE,mBAAmB,EAAC,uBAAuB,CAAA;KAAE,KAAK,IAAI,CAAC;IAClF,eAAe,CAAC,EAAC,CAAC,WAAW,EAAC,eAAe,EAAE,OAAO,EAAC,YAAY,KAAK,IAAI,CAAC;IAC7E,OAAO,CAAC,EAAC,MAAM,IAAI,CAAC;IACpB,sBAAsB,CAAC,EAAC,CAAC,UAAU,CAAC,EAAC,MAAM,KAAK,IAAI,CAAA;CACvD,CAAA;AAID,QAAA,MAAM,WAAW,0NAA0N,gBAAgB,sBAggB1P,CAAA;AAED,eAAe,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AthleteProps, BracketRoundProps, PlayerBracketPickProps, RoundEventProps, TeamProps } from '../../../types';
|
|
2
|
+
import type { AthleteProps, BracketProps, BracketRoundProps, PlayerBracketPickProps, RoundEventProps, TeamProps } from '../../../types';
|
|
3
3
|
import RoundEventCard from './RoundEvent';
|
|
4
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
5
|
import { Button, Text, View } from '../../../Components/Themed';
|
|
@@ -12,6 +12,7 @@ type BracketRoundSectionProps = {
|
|
|
12
12
|
player_bracket_picks: PlayerBracketPickProps[],
|
|
13
13
|
bracket_round:BracketRoundProps,
|
|
14
14
|
selected?:boolean,
|
|
15
|
+
bracket?:BracketProps,
|
|
15
16
|
round_events:RoundEventProps[],
|
|
16
17
|
teams:TeamProps[],
|
|
17
18
|
athletes:AthleteProps[],
|
|
@@ -19,13 +20,14 @@ type BracketRoundSectionProps = {
|
|
|
19
20
|
width:number,
|
|
20
21
|
orientation:'left'|'right',
|
|
21
22
|
onSelectRound:(bracket_round:BracketRoundProps) => void,
|
|
23
|
+
onSelectContest?:(round_event:RoundEventProps) => void
|
|
22
24
|
active_bracket_group_id?:string,
|
|
23
25
|
onPick: (player_bracket_pick:PlayerBracketPickProps) => void,
|
|
24
26
|
left_bar?:boolean,
|
|
25
27
|
right_bar?:boolean
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
const BracketRoundSection = ({ bracket_round, selected, round_event_loading, teams, round_events, width, hide_titles, player_bracket_picks, active_bracket_group_id, onSelectRound, onPick }:BracketRoundSectionProps) => {
|
|
30
|
+
const BracketRoundSection = ({ bracket_round, selected, bracket, round_event_loading, teams, round_events, width, hide_titles, player_bracket_picks, active_bracket_group_id, onSelectContest, onSelectRound, onPick }:BracketRoundSectionProps) => {
|
|
29
31
|
const Colors = useColors();
|
|
30
32
|
if(active_bracket_group_id){
|
|
31
33
|
round_events = round_events.filter(re => re.bracket_group_id == active_bracket_group_id)
|
|
@@ -49,6 +51,7 @@ const BracketRoundSection = ({ bracket_round, selected, round_event_loading, tea
|
|
|
49
51
|
loading={loading}
|
|
50
52
|
round_events={round_events}
|
|
51
53
|
away_team={away_team}
|
|
54
|
+
bracket={bracket}
|
|
52
55
|
home_team={home_team}
|
|
53
56
|
away_placeholder_team={away_placeholder_team}
|
|
54
57
|
home_placeholder_team={home_placeholder_team}
|
|
@@ -61,6 +64,7 @@ const BracketRoundSection = ({ bracket_round, selected, round_event_loading, tea
|
|
|
61
64
|
if(bracket_round.carry_through){ return alert('Event is not eligible for picks') }
|
|
62
65
|
onPick(player_bracket_pick)
|
|
63
66
|
}}
|
|
67
|
+
onSelectContest={onSelectContest}
|
|
64
68
|
/>
|
|
65
69
|
</View>
|
|
66
70
|
</View>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Image, ActivityIndicator } from "react-native"
|
|
3
|
-
import type { AthleteProps, EventProps, PlayerBracketPickProps, RoundEventProps, TeamProps } from "../../../types"
|
|
3
|
+
import type { AthleteProps, BracketProps, EventProps, PlayerBracketPickProps, RoundEventProps, TeamProps } from "../../../types"
|
|
4
4
|
import { BracketCompetitionHelpers } from '../../api';
|
|
5
5
|
import { useColors } from '../../../constants/useColors';
|
|
6
6
|
import { Button, Text, View } from '../../../Components/Themed';
|
|
7
|
+
import { Icons } from '../../../Components';
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
type RoundEventCardProps = {
|
|
@@ -16,16 +17,18 @@ type RoundEventCardProps = {
|
|
|
16
17
|
away_placeholder_team?:TeamProps,
|
|
17
18
|
home_placeholder_team?:TeamProps,
|
|
18
19
|
away_athlete?:AthleteProps,
|
|
20
|
+
bracket?:BracketProps,
|
|
19
21
|
home_athlete?:AthleteProps,
|
|
20
22
|
loading?:boolean,
|
|
21
23
|
width:number,
|
|
22
24
|
no_pick?:boolean,
|
|
23
25
|
away_placeholder_pick?:PlayerBracketPickProps,
|
|
24
26
|
home_placeholder_pick?:PlayerBracketPickProps,
|
|
25
|
-
onPick:(player_bracket_pick:PlayerBracketPickProps) => void
|
|
27
|
+
onPick:(player_bracket_pick:PlayerBracketPickProps) => void,
|
|
28
|
+
onSelectContest?:(round_event:RoundEventProps) => void
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
const RoundEventCard = ({ event, loading, away_team, away_placeholder_team, home_placeholder_team, home_team, width, no_pick, round_event, player_bracket_pick, away_placeholder_pick, home_placeholder_pick, onPick }:RoundEventCardProps) => {
|
|
31
|
+
const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_team, home_placeholder_team, home_team, width, no_pick, round_event, player_bracket_pick, away_placeholder_pick, home_placeholder_pick, onPick, onSelectContest }:RoundEventCardProps) => {
|
|
29
32
|
//AWAY PLACEHOLDER
|
|
30
33
|
const round_width = width//width > 600 ? undefined : width / 2
|
|
31
34
|
const Colors = useColors();
|
|
@@ -157,7 +160,7 @@ const RoundEventCard = ({ event, loading, away_team, away_placeholder_team, home
|
|
|
157
160
|
style={{ height:20, width:20, marginRight:2 }}
|
|
158
161
|
resizeMode="cover"
|
|
159
162
|
/>
|
|
160
|
-
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{round_event.away_seed}</Text>
|
|
163
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?round_event.away_seed:''}</Text>
|
|
161
164
|
<Text style={{ flex:1 }} size={10} color={getPickColor('away', player_bracket_pick)} theme='h2'>{away_team.market_name} {away_team.name}</Text>
|
|
162
165
|
</View>
|
|
163
166
|
:
|
|
@@ -169,7 +172,7 @@ const RoundEventCard = ({ event, loading, away_team, away_placeholder_team, home
|
|
|
169
172
|
style={{ height:20, width:20, marginRight:2 }}
|
|
170
173
|
resizeMode="cover"
|
|
171
174
|
/>
|
|
172
|
-
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{away_placeholder_pick.pick_seed}</Text>
|
|
175
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?away_placeholder_pick.pick_seed:''}</Text>
|
|
173
176
|
<Text style={{ flex:1 }} size={10} theme='h1'>{away_placeholder_team.market_name} {away_placeholder_team.name}</Text>
|
|
174
177
|
</View>
|
|
175
178
|
:
|
|
@@ -202,7 +205,7 @@ const RoundEventCard = ({ event, loading, away_team, away_placeholder_team, home
|
|
|
202
205
|
style={{ height:20, width:20, marginRight:2 }}
|
|
203
206
|
resizeMode="cover"
|
|
204
207
|
/>
|
|
205
|
-
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{round_event.home_seed}</Text>
|
|
208
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?round_event.home_seed:''}</Text>
|
|
206
209
|
<Text style={{ flex:1 }} size={10} color={getPickColor('home', player_bracket_pick)} theme='h2'>{home_team.market_name} {home_team.name}</Text>
|
|
207
210
|
</View>
|
|
208
211
|
:
|
|
@@ -214,7 +217,7 @@ const RoundEventCard = ({ event, loading, away_team, away_placeholder_team, home
|
|
|
214
217
|
style={{ height:20, width:20, marginRight:2 }}
|
|
215
218
|
resizeMode="cover"
|
|
216
219
|
/>
|
|
217
|
-
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='action'>{home_placeholder_pick.pick_seed}</Text>
|
|
220
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='action'>{!bracket?.hide_seeds?home_placeholder_pick.pick_seed:''}</Text>
|
|
218
221
|
<Text style={{ flex:1 }} size={10} theme='h2'>{home_placeholder_team.market_name} {home_placeholder_team.name}</Text>
|
|
219
222
|
</View>
|
|
220
223
|
:
|
|
@@ -244,22 +247,31 @@ const RoundEventCard = ({ event, loading, away_team, away_placeholder_team, home
|
|
|
244
247
|
|
|
245
248
|
|
|
246
249
|
return (
|
|
247
|
-
<View float
|
|
248
|
-
|
|
249
|
-
|
|
250
|
+
<View transparent float style={{ flexDirection:'row', borderRadius:8 }}>
|
|
251
|
+
{round_event.event_id && onSelectContest ?
|
|
252
|
+
<Button style={{ padding:10, justifyContent:'center', alignItems:'center', borderRightWidth:1, borderColor:Colors.borders.light, borderRadius:0, borderTopLeftRadius:8, borderBottomLeftRadius:8 }}
|
|
253
|
+
onPress={() => onSelectContest(round_event)}>
|
|
254
|
+
<Icons.AlertIcon size={16} color={Colors.text.action} />
|
|
250
255
|
</Button>
|
|
251
|
-
<Button transparent style={{ padding:0 }} onPress={() => handleSelectHome()}>
|
|
252
|
-
{renderSide('home')}
|
|
253
|
-
</Button>
|
|
254
|
-
{loading ?
|
|
255
|
-
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, borderRadius:8, justifyContent:'center', alignItems:'center' }}>
|
|
256
|
-
<ActivityIndicator
|
|
257
|
-
size='large'
|
|
258
|
-
color={Colors.text.h1}
|
|
259
|
-
/>
|
|
260
|
-
</View>
|
|
261
256
|
:<></>}
|
|
257
|
+
<View transparent style={{ flex:1, minWidth:125, width:round_width }}>
|
|
258
|
+
<Button transparent style={{ padding:0, borderBottomWidth:1, borderColor:Colors.borders.light}} onPress={() => handleSelectAway()}>
|
|
259
|
+
{renderSide('away')}
|
|
260
|
+
</Button>
|
|
261
|
+
<Button transparent style={{ padding:0 }} onPress={() => handleSelectHome()}>
|
|
262
|
+
{renderSide('home')}
|
|
263
|
+
</Button>
|
|
264
|
+
{loading ?
|
|
265
|
+
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, borderRadius:8, justifyContent:'center', alignItems:'center' }}>
|
|
266
|
+
<ActivityIndicator
|
|
267
|
+
size='large'
|
|
268
|
+
color={Colors.text.h1}
|
|
269
|
+
/>
|
|
270
|
+
</View>
|
|
271
|
+
:<></>}
|
|
272
|
+
</View>
|
|
262
273
|
</View>
|
|
274
|
+
|
|
263
275
|
)
|
|
264
276
|
}
|
|
265
277
|
|
|
@@ -16,11 +16,12 @@ type BracketPlayProps = {
|
|
|
16
16
|
bracket_id?:string,
|
|
17
17
|
width:number,
|
|
18
18
|
onRequestAuthenticate: () => void,
|
|
19
|
+
onSelectContest?:(round_event:RoundEventProps, bracket:BracketProps) => void
|
|
19
20
|
onChangePlayerBracket: (bracket_id:string) => void,
|
|
20
21
|
onPlayerBracketUpdate: (pb:PlayerBracketProps, cpbs:CompetitionPlayerBracketProps[]) => void,
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
const BracketPlay = ({ player, view_mode, width, bracket_id, player_bracket_id, insets, onPlayerBracketUpdate, onChangePlayerBracket, onRequestAuthenticate }:BracketPlayProps) => {
|
|
24
|
+
const BracketPlay = ({ player, view_mode, width, bracket_id, onSelectContest, player_bracket_id, insets, onPlayerBracketUpdate, onChangePlayerBracket, onRequestAuthenticate }:BracketPlayProps) => {
|
|
24
25
|
const Colors = useColors();
|
|
25
26
|
const [ round_event_loading, setRoundEventLoading ] = useState<string|undefined>(undefined);
|
|
26
27
|
const [ show_filter, setShowFilter ] = useState(false);
|
|
@@ -149,13 +150,16 @@ const BracketPlay = ({ player, view_mode, width, bracket_id, player_bracket_id,
|
|
|
149
150
|
|
|
150
151
|
const renderBracketRounds = (data: { item:BracketRoundProps, index:number }) => {
|
|
151
152
|
const selected = selected_round?.bracket_round_id == data.item.bracket_round_id ? true : false
|
|
153
|
+
if(!bracket){ return <></> }
|
|
152
154
|
return (
|
|
153
155
|
<BracketRoundSection
|
|
154
156
|
round_event_loading={round_event_loading}
|
|
155
157
|
bracket_round={data.item}
|
|
156
158
|
round_events={round_events}
|
|
157
159
|
selected={selected}
|
|
160
|
+
bracket={bracket}
|
|
158
161
|
teams={teams}
|
|
162
|
+
onSelectContest={(round_event) => onSelectContest ? onSelectContest(round_event, bracket):undefined}
|
|
159
163
|
athletes={athletes}
|
|
160
164
|
player_bracket_picks={player_bracket_picks}
|
|
161
165
|
width={round_width}
|
package/src/Bracket/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { BracketApi, BracketComeptitionApi } from './api';
|
|
3
|
-
import type { BracketCompetitionProps, CompetitionPlayerBracketProps, CompetitionResultTypeProps, LeagueProps, MyPlayerProps, PlayerBalanceProps, PlayerBracketProps } from '../types';
|
|
3
|
+
import type { BracketCompetitionProps, BracketProps, CompetitionPlayerBracketProps, CompetitionResultTypeProps, LeagueProps, MyPlayerProps, PlayerBalanceProps, PlayerBracketProps, RoundEventProps } from '../types';
|
|
4
4
|
import BracketPlay from './components/BracketPlay';
|
|
5
5
|
import { Button, Text, View } from '../Components/Themed';
|
|
6
6
|
import { ActivityIndicator, FlatList, Image, Modal } from 'react-native';
|
|
@@ -24,13 +24,14 @@ type BracketRoomProps = {
|
|
|
24
24
|
onShareCompetition:(bracket_competition:BracketCompetitionProps) => void,
|
|
25
25
|
onRequestAuthenticate: (auth_strategy_id?:string) => void,
|
|
26
26
|
onNotEnoughBalance:(data:{ bracket_competition:BracketCompetitionProps }) => void,
|
|
27
|
+
onSelectContest?:(round_event:RoundEventProps, bracket:BracketProps) => void,
|
|
27
28
|
onClose?:() => void,
|
|
28
29
|
onCreateNewCompetition?:(bracket_id?:string) => void
|
|
29
30
|
}
|
|
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, onManageCompetition, bracket_competition_id, player_balance, onRequestAuthenticate, onFocusPosition, onShareCompetition }:BracketRoomProps) => {
|
|
34
|
+
const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onSelectContest, 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);
|
|
@@ -212,6 +213,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
212
213
|
width={section_width}
|
|
213
214
|
view_mode={view_mode}
|
|
214
215
|
player={player}
|
|
216
|
+
onSelectContest={onSelectContest}
|
|
215
217
|
insets={insets}
|
|
216
218
|
onRequestAuthenticate={() => onRequestAuthenticate(active_competition?.auth_strategy_id)}
|
|
217
219
|
|
|
@@ -431,7 +433,7 @@ const BracketRoom = ({ player_id, width, view_mode, bracket_id, insets, onCreate
|
|
|
431
433
|
:<></>}
|
|
432
434
|
</View>
|
|
433
435
|
{mode != 'small' && active_bracket_id ?
|
|
434
|
-
<View type='header' style={{ width:300 }}>
|
|
436
|
+
<View type='header' style={{ width:300, height:500 }}>
|
|
435
437
|
{active_competition ?
|
|
436
438
|
<View transparent>
|
|
437
439
|
<Image
|