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
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BracketCompetitionProps, LeagueProps, MyPlayerProps } from '../../types';
|
|
3
3
|
type RoomHomeProps = {
|
|
4
4
|
player?: MyPlayerProps;
|
|
5
|
-
visible
|
|
6
|
-
player_brackets: PlayerBracketProps[];
|
|
7
|
-
bracket_competitions: BracketCompetitionProps[];
|
|
8
|
-
competition_player_brackets: CompetitionPlayerBracketProps[];
|
|
9
|
-
brackets: BracketProps[];
|
|
5
|
+
visible: boolean;
|
|
10
6
|
onManageCompetition: (bracket_competition_id: string) => void;
|
|
11
|
-
onMoreAdmin: (offset: number) => void;
|
|
12
|
-
admin_offset: number;
|
|
13
|
-
admin_competitions: BracketCompetitionProps[];
|
|
14
7
|
onFocusPosition?: (pos: {
|
|
15
8
|
x: number;
|
|
16
9
|
y: number;
|
|
@@ -18,18 +11,17 @@ type RoomHomeProps = {
|
|
|
18
11
|
width: number;
|
|
19
12
|
}) => void;
|
|
20
13
|
width: number;
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
insets?: {
|
|
15
|
+
top: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
right: number;
|
|
18
|
+
left: number;
|
|
19
|
+
};
|
|
23
20
|
view_mode: 'mobile' | 'desktop';
|
|
24
|
-
competition_result_types: CompetitionResultTypeProps[];
|
|
25
21
|
leagues: LeagueProps[];
|
|
26
22
|
onCreateNewCompetition?: (bracket_id?: string) => void;
|
|
27
|
-
|
|
28
|
-
onUpdatePlayerBracket: (player_bracket: PlayerBracketProps) => void;
|
|
29
|
-
onEditPlayerBracket: (player_bracket: PlayerBracketProps) => void;
|
|
30
|
-
onView: (bracket_id: string, player_bracket_id?: string, bracket_competition_id?: string) => void;
|
|
31
|
-
teams: TeamProps[];
|
|
23
|
+
onView: (bracket_id: string, player_bracket_id?: string, bracket_competition?: BracketCompetitionProps) => void;
|
|
32
24
|
};
|
|
33
|
-
declare const RoomHome: ({ visible, width, player, leagues,
|
|
25
|
+
declare const RoomHome: ({ view_mode, visible, width, player, leagues, insets, onManageCompetition, onCreateNewCompetition, onView, onFocusPosition }: RoomHomeProps) => React.JSX.Element;
|
|
34
26
|
export default RoomHome;
|
|
35
27
|
//# sourceMappingURL=RoomHome.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoomHome.d.ts","sourceRoot":"","sources":["../../../../../src/Bracket/components/RoomHome.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RoomHome.d.ts","sourceRoot":"","sources":["../../../../../src/Bracket/components/RoomHome.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAgB,uBAAuB,EAA+C,WAAW,EAAE,aAAa,EAAiC,MAAM,aAAa,CAAC;AAWjL,KAAK,aAAa,GAAG;IACjB,MAAM,CAAC,EAAC,aAAa,CAAC;IACtB,OAAO,EAAC,OAAO,CAAC;IAChB,mBAAmB,EAAC,CAAC,sBAAsB,EAAC,MAAM,KAAK,IAAI,CAAC;IAC5D,eAAe,CAAC,EAAC,CAAC,GAAG,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;IACnF,KAAK,EAAC,MAAM,CAAC;IACb,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,SAAS,EAAC,QAAQ,GAAC,SAAS,CAAA;IAC5B,OAAO,EAAC,WAAW,EAAE,CAAC;IACtB,sBAAsB,CAAC,EAAC,CAAC,UAAU,CAAC,EAAC,MAAM,KAAK,IAAI,CAAC;IACrD,MAAM,EAAE,CAAC,UAAU,EAAC,MAAM,EAAE,iBAAiB,CAAC,EAAC,MAAM,EAAE,mBAAmB,CAAC,EAAC,uBAAuB,KAAK,IAAI,CAAC;CAChH,CAAA;AAcD,QAAA,MAAM,QAAQ,iIAAgI,aAAa,sBAyxB1J,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -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,
|
|
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;AAUvL,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,OAAO,CAAC,EAAC,MAAM,IAAI,CAAC;IACpB,sBAAsB,CAAC,EAAC,CAAC,UAAU,CAAC,EAAC,MAAM,KAAK,IAAI,CAAA;CACvD,CAAA;AAID,QAAA,MAAM,WAAW,yMAAyM,gBAAgB,sBAgczO,CAAA;AAED,eAAe,WAAW,CAAA"}
|
package/package.json
CHANGED
package/src/Bracket/api/index.ts
CHANGED
|
@@ -98,9 +98,7 @@ const BracketComeptitionApi = {
|
|
|
98
98
|
},
|
|
99
99
|
getBracketCompetitionsByBracketId: async(bracket_id:string):Promise<BracketCompetitionProps[]> => {
|
|
100
100
|
try {
|
|
101
|
-
console.log('getting it')
|
|
102
101
|
const resp = await axios.get(`${TP_SVC_API}/v1/brackets/competitions/bracket/${bracket_id}`)
|
|
103
|
-
console.log(resp.data)
|
|
104
102
|
return resp.data.bracket_competitions
|
|
105
103
|
} catch (e) {
|
|
106
104
|
console.log(e)
|
|
@@ -60,9 +60,8 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, o
|
|
|
60
60
|
});
|
|
61
61
|
const { show_enter, show_leaders, active_competition_id, bracket_competitions } = action_data;
|
|
62
62
|
const [ action_loading, setActionLoading ] = useState(false);
|
|
63
|
-
const active_competition = bracket_competitions.find(bc => bc.bracket_competition_id == active_competition_id
|
|
63
|
+
const active_competition = bracket_competitions.find(bc => bc.bracket_competition_id == active_competition_id);
|
|
64
64
|
const competition_player_bracket = competition_player_brackets.find(cpb => cpb.status == 'active' && cpb.player_bracket_id == player_bracket?.player_bracket_id && cpb.bracket_competition_id == active_competition_id);
|
|
65
|
-
|
|
66
65
|
const entered_cpbs = competition_player_brackets.filter(cpb => cpb.status == 'active' && cpb.bracket_competition_id == active_competition_id);
|
|
67
66
|
const visible_pbs = player_brackets.filter(pb => pb.bracket_id == bracket_id)
|
|
68
67
|
const allow_enter = BracketCompetitionHelpers.canEnter(active_competition) && !BracketCompetitionHelpers.isEntered(competition_player_bracket);
|
|
@@ -79,7 +78,9 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, o
|
|
|
79
78
|
setActionData({ ...action_data, loading:true });
|
|
80
79
|
const bcs = await BracketComeptitionApi.getBracketCompetitionsByBracketId(id);
|
|
81
80
|
let active_comp = comp_id
|
|
82
|
-
if(!active_comp){
|
|
81
|
+
//if(!active_comp){
|
|
82
|
+
// active_comp = bcs[0]?.bracket_competition_id
|
|
83
|
+
//}
|
|
83
84
|
setActionData({
|
|
84
85
|
...action_data,
|
|
85
86
|
bracket_competitions: bcs.filter(bc => bc.status != 'pending'),
|
|
@@ -229,14 +230,14 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, o
|
|
|
229
230
|
{active_competition.admin_id == player?.player_id ?
|
|
230
231
|
<Button
|
|
231
232
|
type='action'
|
|
232
|
-
style={{ flex:
|
|
233
|
+
style={{ flex:1, marginRight:5 }}
|
|
233
234
|
title='MANAGE'
|
|
234
235
|
onPress={() => onManage(active_competition.bracket_competition_id)}
|
|
235
236
|
/>
|
|
236
237
|
:<></>}
|
|
237
238
|
{allow_enter ?
|
|
238
239
|
<Button
|
|
239
|
-
style={{ flex:
|
|
240
|
+
style={{ flex:2, opacity: action_loading? 0.5: 1 }}
|
|
240
241
|
type='success'
|
|
241
242
|
loading={action_loading}
|
|
242
243
|
title='Enter Competition'
|
|
@@ -303,7 +304,7 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, o
|
|
|
303
304
|
:<></>}
|
|
304
305
|
<View transparent>
|
|
305
306
|
<FlatList
|
|
306
|
-
data={bracket_competitions.sort((a,b) => parseInt(a.bracket_competition_id) - parseInt(b.bracket_competition_id))}
|
|
307
|
+
data={bracket_competitions.filter(bc => !bc.invite_only).sort((a,b) => parseInt(a.bracket_competition_id) - parseInt(b.bracket_competition_id))}
|
|
307
308
|
renderItem={renderCompetitions}
|
|
308
309
|
key={'bracket_competition_options'}
|
|
309
310
|
keyExtractor={(item) => item.bracket_competition_id.toString()}
|
|
@@ -37,7 +37,7 @@ const BracketRoundSection = ({ bracket_round, round_event_loading, teams, round_
|
|
|
37
37
|
const away_team = teams.find(t => t.team_id == data.item.away_side_id);
|
|
38
38
|
const loading = round_event_loading == data.item.round_event_id ? true : false
|
|
39
39
|
return (
|
|
40
|
-
<View transparent style={{ margin:2, flex:1, flexGrow:1, justifyContent:'center' }}>
|
|
40
|
+
<View key={`${data.item.bracket_id}_${data.item.round_event_id}`} transparent style={{ margin:2, flex:1, flexGrow:1, justifyContent:'center' }}>
|
|
41
41
|
<View transparent style={{ margin:1, ...view_styles.float }}>
|
|
42
42
|
<RoundEventCard
|
|
43
43
|
round_event={data.item}
|
|
@@ -64,7 +64,7 @@ const BracketRoundSection = ({ bracket_round, round_event_loading, teams, round_
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
return (
|
|
67
|
-
<View transparent style={{ }}>
|
|
67
|
+
<View key={`${bracket_round.bracket_id}_${bracket_round.bracket_round_id}`} transparent style={{ }}>
|
|
68
68
|
{!hide_titles ?
|
|
69
69
|
<View transparent style={{ padding:10 }}>
|
|
70
70
|
<Text size={14} theme='h1' textAlign="center">{bracket_round.round_name}</Text>
|
|
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { ActivityIndicator, ScrollView, Image } from "react-native";
|
|
3
3
|
import type { AthleteProps, BracketGroupProps, BracketProps, BracketRoundProps, CompetitionPlayerBracketProps, EventProps, MyPlayerProps, PlayerBracketPickProps, PlayerBracketProps, RoundEventProps, TeamProps } from '../../../types';
|
|
4
4
|
import { BracketApi, BracketComeptitionApi, BracketCompetitionHelpers } from '../../api';
|
|
5
|
-
import { Icons } from '../../../Components';
|
|
6
5
|
import BracketRoundSection from './BracketRound';
|
|
7
6
|
import { Button, Text, View } from '../../../Components/Themed';
|
|
8
7
|
import { useColors } from '../../../constants/useColors';
|
|
@@ -12,13 +11,12 @@ type BracketPlayProps = {
|
|
|
12
11
|
player_bracket_id?:string,
|
|
13
12
|
bracket_id?:string,
|
|
14
13
|
width:number,
|
|
15
|
-
onEditPlayerBracket: (pb:PlayerBracketProps) => void,
|
|
16
14
|
onRequestAuthenticate: () => void,
|
|
17
15
|
onChangePlayerBracket: (bracket_id:string) => void,
|
|
18
16
|
onPlayerBracketUpdate: (pb:PlayerBracketProps, cpbs:CompetitionPlayerBracketProps[]) => void,
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
const BracketPlay = ({ player, width, bracket_id, player_bracket_id,
|
|
19
|
+
const BracketPlay = ({ player, width, bracket_id, player_bracket_id, onPlayerBracketUpdate, onChangePlayerBracket, onRequestAuthenticate }:BracketPlayProps) => {
|
|
22
20
|
const Colors = useColors();
|
|
23
21
|
const [ round_event_loading, setRoundEventLoading ] = useState<string|undefined>(undefined);
|
|
24
22
|
const [ play_data, setPlayData ] = useState<{
|
|
@@ -146,18 +144,18 @@ const BracketPlay = ({ player, width, bracket_id, player_bracket_id, onEditPlaye
|
|
|
146
144
|
|
|
147
145
|
const renderBracketRounds = (data: { item:BracketRoundProps, index:number }) => {
|
|
148
146
|
return (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
147
|
+
<BracketRoundSection
|
|
148
|
+
round_event_loading={round_event_loading}
|
|
149
|
+
bracket_round={data.item}
|
|
150
|
+
round_events={round_events}
|
|
151
|
+
teams={teams}
|
|
152
|
+
athletes={athletes}
|
|
153
|
+
player_bracket_picks={player_bracket_picks}
|
|
154
|
+
width={round_width}
|
|
155
|
+
orientation='right'
|
|
156
|
+
onPick={(pick) => handlePick(pick)}
|
|
157
|
+
|
|
158
|
+
/>
|
|
161
159
|
)
|
|
162
160
|
}
|
|
163
161
|
|
|
@@ -195,9 +193,6 @@ const BracketPlay = ({ player, width, bracket_id, player_bracket_id, onEditPlaye
|
|
|
195
193
|
<Text size={14} theme='h1'>{player_bracket.bracket_name}</Text>
|
|
196
194
|
<Text style={{ marginTop:3 }} size={12} theme='description'>{(player_bracket.completion_pct*100).toFixed(2)}% Complete</Text>
|
|
197
195
|
</View>
|
|
198
|
-
<Button transparent onPress={() => onEditPlayerBracket(player_bracket)}>
|
|
199
|
-
<Icons.EditIcon size={14} color={Colors.text.action} />
|
|
200
|
-
</Button>
|
|
201
196
|
<Button
|
|
202
197
|
title='Change'
|
|
203
198
|
style={{ padding:10 }}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Button, Text, TextInput, View } from "../../Components/Themed"
|
|
3
3
|
import type { PlayerBracketProps } from "../../types"
|
|
4
4
|
import { BracketComeptitionApi } from '../api';
|
|
5
|
+
import { Modal } from 'react-native';
|
|
5
6
|
|
|
6
7
|
type EditPlayerBracketProps = {
|
|
7
8
|
player_bracket?:PlayerBracketProps,
|
|
9
|
+
view_mode?:'desktop'|'mobile',
|
|
10
|
+
insets?:{ top:number, bottom:number, left:number, right:number },
|
|
8
11
|
onUpdatePlayerBracket:(pb:PlayerBracketProps) => void,
|
|
9
12
|
onFocusPosition?:(data:{ x:number, y:number, height:number, width:number }) => void,
|
|
10
13
|
onClose:() => void
|
|
11
14
|
}
|
|
12
|
-
const EditPlayerBracket = ({ player_bracket, onUpdatePlayerBracket, onFocusPosition, onClose }:EditPlayerBracketProps) => {
|
|
15
|
+
const EditPlayerBracket = ({ player_bracket, view_mode, onUpdatePlayerBracket, onFocusPosition, insets, onClose }:EditPlayerBracketProps) => {
|
|
13
16
|
const [ draft_pb, setDraftPb ] = useState(player_bracket);
|
|
14
17
|
const [ action_loading, setActionLoading ] = useState(false);
|
|
15
18
|
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setDraftPb(player_bracket)
|
|
21
|
+
},[player_bracket])
|
|
22
|
+
|
|
16
23
|
const is_changed = JSON.stringify(draft_pb) != JSON.stringify(player_bracket) ? true : false
|
|
17
24
|
|
|
18
25
|
const handleUpdate = async() => {
|
|
@@ -35,48 +42,57 @@ const EditPlayerBracket = ({ player_bracket, onUpdatePlayerBracket, onFocusPosit
|
|
|
35
42
|
if(!player_bracket || !draft_pb){ return <></> }
|
|
36
43
|
|
|
37
44
|
return (
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
type='
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
<Modal
|
|
46
|
+
visible={player_bracket ? true : false}
|
|
47
|
+
style={{ flex:1 }}
|
|
48
|
+
transparent
|
|
49
|
+
animationType={view_mode == 'desktop' ? 'fade' : 'slide'}
|
|
50
|
+
>
|
|
51
|
+
<View type='blur' style={view_mode == 'desktop' ? { flex:1, justifyContent:'center', alignItems:'center' } : { flex:1, justifyContent:'flex-end', paddingBottom:(insets?.bottom ?? 0)}}>
|
|
52
|
+
<View float style={view_mode == 'desktop' ? { width:500 }:{ margin:10 }}>
|
|
53
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
54
|
+
<View transparent style={{ flex:1 }}>
|
|
55
|
+
<Text theme='h1'>EDIT MY BRACKET</Text>
|
|
56
|
+
<Text style={{ marginTop:3 }} theme='description'>{player_bracket.bracket_name}</Text>
|
|
57
|
+
</View>
|
|
58
|
+
<Button
|
|
59
|
+
title='DELETE'
|
|
60
|
+
type='error'
|
|
61
|
+
loading={action_loading}
|
|
62
|
+
style={{ padding:10, opacity:action_loading?0.5:1 }}
|
|
63
|
+
disabled={action_loading}
|
|
64
|
+
onPress={() => handleDelete()}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
<View type='body' style={{ padding:10 }}>
|
|
68
|
+
<View>
|
|
69
|
+
<Text style={{ marginBottom:10 }} theme='h2'>Update Bracket Name</Text>
|
|
70
|
+
<TextInput
|
|
71
|
+
value={draft_pb?.bracket_name}
|
|
72
|
+
onFocusPosition={onFocusPosition}
|
|
73
|
+
onChangeText={(text) => setDraftPb({ ...draft_pb, bracket_name: text })}
|
|
74
|
+
/>
|
|
75
|
+
</View>
|
|
76
|
+
</View>
|
|
77
|
+
<View type='footer' style={{ flexDirection:'row', padding:10, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
|
|
78
|
+
<Button
|
|
79
|
+
style={{ flex:1 }}
|
|
80
|
+
title='CANCEL'
|
|
81
|
+
type='close'
|
|
82
|
+
onPress={() => onClose()}
|
|
83
|
+
/>
|
|
84
|
+
<Button
|
|
85
|
+
style={{ flex:2, marginLeft:5, opacity: is_changed?1:0.5 }}
|
|
86
|
+
title='UPDATE'
|
|
87
|
+
loading={action_loading}
|
|
88
|
+
type='success'
|
|
89
|
+
disabled={!is_changed || action_loading}
|
|
90
|
+
onPress={handleUpdate}
|
|
91
|
+
/>
|
|
92
|
+
</View>
|
|
61
93
|
</View>
|
|
62
94
|
</View>
|
|
63
|
-
|
|
64
|
-
<Button
|
|
65
|
-
style={{ flex:1 }}
|
|
66
|
-
title='CANCEL'
|
|
67
|
-
type='close'
|
|
68
|
-
onPress={() => onClose()}
|
|
69
|
-
/>
|
|
70
|
-
<Button
|
|
71
|
-
style={{ flex:2, marginLeft:5, opacity: is_changed?1:0.5 }}
|
|
72
|
-
title='UPDATE'
|
|
73
|
-
loading={action_loading}
|
|
74
|
-
type='success'
|
|
75
|
-
disabled={!is_changed || action_loading}
|
|
76
|
-
onPress={handleUpdate}
|
|
77
|
-
/>
|
|
78
|
-
</View>
|
|
79
|
-
</View>
|
|
95
|
+
</Modal>
|
|
80
96
|
)
|
|
81
97
|
}
|
|
82
98
|
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FlatList, Image, Modal } from "react-native"
|
|
3
|
+
import type { AthleteProps, BracketCompetitionProps, CompetitionPlayerBracketProps, PlayerBracketProps, TeamProps } from "../../types"
|
|
4
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
5
|
+
import { useColors } from '../../constants/useColors';
|
|
6
|
+
import { Icons } from '../../Components';
|
|
7
|
+
import { BracketCompetitionHelpers } from '../api';
|
|
8
|
+
|
|
9
|
+
type EnteredCompetitionsModalProps = {
|
|
10
|
+
view_mode: 'desktop'|'mobile',
|
|
11
|
+
player_bracket?:PlayerBracketProps,
|
|
12
|
+
insets?:{ top:number, bottom:number, left:number, right:number },
|
|
13
|
+
entered_competitions:BracketCompetitionProps[],
|
|
14
|
+
entered_brackets:CompetitionPlayerBracketProps[],
|
|
15
|
+
champion_team?:TeamProps,
|
|
16
|
+
champion_athlete?:AthleteProps,
|
|
17
|
+
onClose:() => void,
|
|
18
|
+
onSelectCompetition:(bracket_competition:BracketCompetitionProps) => void
|
|
19
|
+
}
|
|
20
|
+
const EnteredCompetitionsModal = ({ view_mode, champion_athlete, champion_team, player_bracket, insets, entered_brackets, entered_competitions, onClose, onSelectCompetition }:EnteredCompetitionsModalProps) => {
|
|
21
|
+
const Colors = useColors();
|
|
22
|
+
|
|
23
|
+
const renderCompetitions = (data:{item:BracketCompetitionProps, index:number}) => {
|
|
24
|
+
const cl = data.item.market_type == 'FOR_MONEY' ? "$" : 'E'
|
|
25
|
+
const cpb = entered_brackets.find(b => b.bracket_competition_id == data.item.bracket_competition_id && b.player_bracket_id == player_bracket?.player_bracket_id);
|
|
26
|
+
let pot = BracketCompetitionHelpers.getPayout(data.item)
|
|
27
|
+
return (
|
|
28
|
+
<Button style={{ flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.borders.light }} onPress={() => onSelectCompetition(data.item)}>
|
|
29
|
+
<Image
|
|
30
|
+
source={{ uri: data.item.image?.url }}
|
|
31
|
+
style={{ height:40, width:40 }}
|
|
32
|
+
resizeMode='cover'
|
|
33
|
+
/>
|
|
34
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
35
|
+
<Text theme='h2'>{data.item.competition_name}</Text>
|
|
36
|
+
{cpb ?
|
|
37
|
+
<Text style={{ marginTop:3 }}>{pot > 0 ? `Total Pot: ${cl}${pot.toFixed(2)}`:''}Place {cpb.place} / {data.item.tickets_sold}</Text>
|
|
38
|
+
:<></>}
|
|
39
|
+
</View>
|
|
40
|
+
{cpb ?
|
|
41
|
+
<View style={{ justifyContent:'center', alignItems:'center', marginRight:20, marginLeft:20 }}>
|
|
42
|
+
<Text theme='h2' color={Colors.text.success} textAlign='center'>{cl}{cpb.winnings.toFixed(2)}</Text>
|
|
43
|
+
<Text theme='description' color={Colors.text.success} textAlign='center'>winnings</Text>
|
|
44
|
+
</View>
|
|
45
|
+
:<></>}
|
|
46
|
+
<Icons.ChevronIcon direction='right' size={10} color={Colors.text.action} />
|
|
47
|
+
</Button>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Modal
|
|
53
|
+
visible={player_bracket?true : false}
|
|
54
|
+
style={{ flex:1 }}
|
|
55
|
+
transparent
|
|
56
|
+
animationType={view_mode == 'desktop' ? 'fade' : 'slide'}
|
|
57
|
+
>
|
|
58
|
+
<View type='blur' style={view_mode == 'desktop' ? { flex:1, justifyContent:'center', alignItems:'center' } : { flex:1, justifyContent:'flex-end', paddingBottom:(insets?.bottom ?? 0)}}>
|
|
59
|
+
<View float style={view_mode == 'desktop' ? { width:500 }:{ margin:10 }}>
|
|
60
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
61
|
+
<View transparent style={{ flex:1 }}>
|
|
62
|
+
<Text theme='h1'>{player_bracket?.bracket_name ?? ''}</Text>
|
|
63
|
+
<Text style={{ marginTop:3 }} theme='description'>Entered Competitions</Text>
|
|
64
|
+
</View>
|
|
65
|
+
{player_bracket?
|
|
66
|
+
<View transparent>
|
|
67
|
+
<Text theme='h1' color={Colors.text.h1}>{(player_bracket.completion_pct*100).toFixed(2)}%</Text>
|
|
68
|
+
</View>
|
|
69
|
+
:<></>}
|
|
70
|
+
{champion_team ?
|
|
71
|
+
<View transparent style={{ padding:5, justifyContent:'center', alignItems:'center' }}>
|
|
72
|
+
<Image
|
|
73
|
+
source={{ uri: champion_team.image?.url }}
|
|
74
|
+
style={{ height:30, width:30 }}
|
|
75
|
+
resizeMode='cover'
|
|
76
|
+
/>
|
|
77
|
+
<Text theme="description" textAlign="center">{champion_team.abbr}</Text>
|
|
78
|
+
</View>
|
|
79
|
+
:champion_athlete ?
|
|
80
|
+
<View transparent style={{ padding:5, justifyContent:'center', alignItems:'center' }}>
|
|
81
|
+
<Image
|
|
82
|
+
source={{ uri: champion_athlete.image?.url }}
|
|
83
|
+
style={{ height:30, width:30 }}
|
|
84
|
+
resizeMode='cover'
|
|
85
|
+
/>
|
|
86
|
+
<Text theme="description" textAlign="center">{champion_athlete.abbr_name}</Text>
|
|
87
|
+
</View>
|
|
88
|
+
:<></>}
|
|
89
|
+
</View>
|
|
90
|
+
<View type='body' style={{ flexGrow:1 }}>
|
|
91
|
+
<FlatList
|
|
92
|
+
key={'entered_comps'}
|
|
93
|
+
keyExtractor={(item) => item.bracket_competition_id}
|
|
94
|
+
data={entered_competitions}
|
|
95
|
+
renderItem={renderCompetitions}
|
|
96
|
+
/>
|
|
97
|
+
</View>
|
|
98
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
|
|
99
|
+
<Button
|
|
100
|
+
type='close'
|
|
101
|
+
title='CLOSE'
|
|
102
|
+
style={{ flex:1 }}
|
|
103
|
+
onPress={() => onClose()}
|
|
104
|
+
/>
|
|
105
|
+
</View>
|
|
106
|
+
</View>
|
|
107
|
+
</View>
|
|
108
|
+
|
|
109
|
+
</Modal>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export default EnteredCompetitionsModal
|
|
@@ -197,7 +197,7 @@ const ManageBracketCompetitionForm = ({ player_id, bracket_competition_id, onFai
|
|
|
197
197
|
</View>
|
|
198
198
|
</View>
|
|
199
199
|
<TextInput
|
|
200
|
-
value={scoring_rule.win_points as unknown as string}
|
|
200
|
+
value={scoring_rule.win_points.toString() as unknown as string}
|
|
201
201
|
editable={scoring}
|
|
202
202
|
style={{ textAlign:'center', width:80 }}
|
|
203
203
|
onChangeText={(text) => handleUpdateScoringRule({ ...scoring_rule, win_points: text as unknown as number })}
|
|
@@ -206,8 +206,8 @@ const ManageBracketCompetitionForm = ({ player_id, bracket_competition_id, onFai
|
|
|
206
206
|
<View transparent style={{ flexDirection:'row', alignItems:'center' }}>
|
|
207
207
|
<Text style={{ padding:4 }} theme='h1'>X</Text>
|
|
208
208
|
<TextInput
|
|
209
|
-
value={scoring_rule.underdog_multiplier
|
|
210
|
-
style={{ textAlign:'center', width:
|
|
209
|
+
value={scoring_rule.underdog_multiplier.toString() as unknown as string}
|
|
210
|
+
style={{ textAlign:'center', width:65 }}
|
|
211
211
|
editable={scoring}
|
|
212
212
|
onChangeText={(text) => handleUpdateScoringRule({ ...scoring_rule, underdog_multiplier: text as unknown as number })}
|
|
213
213
|
/>
|
|
@@ -11,17 +11,16 @@ type PlayerBracketCardProps = {
|
|
|
11
11
|
champion_team?:TeamProps,
|
|
12
12
|
champion_athlete?:AthleteProps,
|
|
13
13
|
onEdit: (player_bracket:PlayerBracketProps) => void,
|
|
14
|
-
|
|
14
|
+
onShowCompetitions:() => void,
|
|
15
|
+
onView: (bracket_id:string, player_bracket_id?:string, bracket_competition?:BracketCompetitionProps) => void,
|
|
15
16
|
bracket_competitions:BracketCompetitionProps[],
|
|
16
17
|
player_bracket:PlayerBracketProps,
|
|
17
18
|
competition_player_brackets:CompetitionPlayerBracketProps[]
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
const PlayerBracketCard = ({ onEdit, champion_team, onView, player_bracket, bracket }:PlayerBracketCardProps) => {
|
|
21
|
+
const PlayerBracketCard = ({ onEdit, champion_team, onView, player_bracket, bracket, competition_player_brackets, onShowCompetitions }:PlayerBracketCardProps) => {
|
|
21
22
|
const Colors = useColors();
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
//const cl = bracket_competition.market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
25
24
|
return (
|
|
26
25
|
<View type='row' style={{ flex:1 }}>
|
|
27
26
|
{player_bracket.champion_id ?
|
|
@@ -49,6 +48,12 @@ const PlayerBracketCard = ({ onEdit, champion_team, onView, player_bracket, brac
|
|
|
49
48
|
<Text theme="h1">{player_bracket.bracket_name}</Text>
|
|
50
49
|
<Text style={{ marginTop:4 }} theme="description">{(player_bracket.completion_pct * 100).toFixed(2)}%</Text>
|
|
51
50
|
</View>
|
|
51
|
+
{competition_player_brackets.length > 0 ?
|
|
52
|
+
<Button float style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => onShowCompetitions()}>
|
|
53
|
+
<Text style={{ marginRight:5 }} theme="h1" color={Colors.text.action}>{competition_player_brackets.length}</Text>
|
|
54
|
+
<Icons.TrophyIcon size={12} color={Colors.text.action} />
|
|
55
|
+
</Button>
|
|
56
|
+
:<></>}
|
|
52
57
|
{player_bracket.status != 'closed' ?
|
|
53
58
|
<Button
|
|
54
59
|
type='text'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { FlatList, Image } from "react-native"
|
|
2
|
+
import { FlatList, Image, Modal } from "react-native"
|
|
3
3
|
import type { AthleteProps, BracketCompetitionProps, BracketProps, CompetitionPlayerBracketProps, LeagueProps, PlayerBracketProps, TeamProps } from '../../types';
|
|
4
4
|
import moment from 'moment-mini';
|
|
5
5
|
import { Button, Text, View } from '../../Components/Themed';
|
|
@@ -9,8 +9,11 @@ import { BracketComeptitionApi, BracketCompetitionHelpers } from '../api';
|
|
|
9
9
|
type PlayerBracketSelectorProps = {
|
|
10
10
|
brackets:BracketProps[],
|
|
11
11
|
player_id?:string,
|
|
12
|
+
visible?:boolean,
|
|
13
|
+
view_mode?:'desktop'|'mobile',
|
|
12
14
|
bracket_id?:string,
|
|
13
15
|
leagues:LeagueProps[],
|
|
16
|
+
insets?:{ top:number, bottom:number, left:number, right:number },
|
|
14
17
|
teams:TeamProps[],
|
|
15
18
|
athletes:AthleteProps[],
|
|
16
19
|
player_brackets:PlayerBracketProps[],
|
|
@@ -21,7 +24,7 @@ type PlayerBracketSelectorProps = {
|
|
|
21
24
|
onSelect:(pb:PlayerBracketProps) => void,
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
const PlayerBracketSelector = ({ brackets, bracket_id, leagues, teams, athletes, player_brackets, onSelect, onClose, onCreateNew }:PlayerBracketSelectorProps) => {
|
|
27
|
+
const PlayerBracketSelector = ({ brackets, visible, view_mode, insets, bracket_id, leagues, teams, athletes, player_brackets, onSelect, onClose, onCreateNew }:PlayerBracketSelectorProps) => {
|
|
25
28
|
const Colors = useColors();
|
|
26
29
|
const [ action_loading, setActionLoading ] = useState(false);
|
|
27
30
|
const active_brackets = player_brackets.filter(pb => pb.status == 'active');
|
|
@@ -109,39 +112,48 @@ const PlayerBracketSelector = ({ brackets, bracket_id, leagues, teams, athletes,
|
|
|
109
112
|
|
|
110
113
|
|
|
111
114
|
return (
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
<Modal
|
|
116
|
+
visible={visible}
|
|
117
|
+
style={{ flex:1 }}
|
|
118
|
+
transparent
|
|
119
|
+
animationType={view_mode == 'desktop' ? 'fade' : 'slide'}
|
|
120
|
+
>
|
|
121
|
+
<View type='blur' style={view_mode == 'desktop' ? { flex:1, justifyContent:'center', alignItems:'center' } : { flex:1, justifyContent:'flex-end', paddingBottom:(insets?.bottom ?? 0) }}>
|
|
122
|
+
<View float style={view_mode == 'desktop' ? { width:500 }:{ margin:10 }}>
|
|
123
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
124
|
+
<View transparent style={{ flex:1 }}>
|
|
125
|
+
<Text theme='h1'>My Brackets</Text>
|
|
126
|
+
</View>
|
|
127
|
+
{bracket_id && onCreateNew ?
|
|
128
|
+
<Button
|
|
129
|
+
type='success'
|
|
130
|
+
disabled={action_loading}
|
|
131
|
+
loading={action_loading}
|
|
132
|
+
style={{ flexDirection:'row', alignItems:'center', padding:10, opacity: action_loading?0.5:1 }}
|
|
133
|
+
onPress={() => handleCreateNew()}
|
|
134
|
+
>
|
|
135
|
+
<Text size={14} color={Colors.text.white}>NEW</Text>
|
|
136
|
+
</Button>
|
|
137
|
+
:<></>}
|
|
138
|
+
</View>
|
|
139
|
+
<View transparent style={{ flexGrow:1, marginTop:1 }}>
|
|
140
|
+
<FlatList
|
|
141
|
+
data={unique_bracket_ids}
|
|
142
|
+
renderItem={renderBrackets}
|
|
143
|
+
keyExtractor={(item) => item.toString()}
|
|
144
|
+
/>
|
|
145
|
+
</View>
|
|
146
|
+
<View type='footer' style={{ flexDirection:'row', padding:10 }}>
|
|
147
|
+
<Button
|
|
148
|
+
type='close'
|
|
149
|
+
title='CLOSE'
|
|
150
|
+
style={{ flex:1 }}
|
|
151
|
+
onPress={() => onClose()}
|
|
152
|
+
/>
|
|
153
|
+
</View>
|
|
116
154
|
</View>
|
|
117
|
-
{bracket_id && onCreateNew ?
|
|
118
|
-
<Button
|
|
119
|
-
type='success'
|
|
120
|
-
disabled={action_loading}
|
|
121
|
-
loading={action_loading}
|
|
122
|
-
style={{ flexDirection:'row', alignItems:'center', padding:10, opacity: action_loading?0.5:1 }}
|
|
123
|
-
onPress={() => handleCreateNew()}
|
|
124
|
-
>
|
|
125
|
-
<Text size={14} color={Colors.text.white}>NEW</Text>
|
|
126
|
-
</Button>
|
|
127
|
-
:<></>}
|
|
128
|
-
</View>
|
|
129
|
-
<View transparent style={{ flexGrow:1, marginTop:1 }}>
|
|
130
|
-
<FlatList
|
|
131
|
-
data={unique_bracket_ids}
|
|
132
|
-
renderItem={renderBrackets}
|
|
133
|
-
keyExtractor={(item) => item.toString()}
|
|
134
|
-
/>
|
|
135
|
-
</View>
|
|
136
|
-
<View type='footer' style={{ flexDirection:'row', padding:10 }}>
|
|
137
|
-
<Button
|
|
138
|
-
type='close'
|
|
139
|
-
title='CLOSE'
|
|
140
|
-
style={{ flex:1 }}
|
|
141
|
-
onPress={() => onClose()}
|
|
142
|
-
/>
|
|
143
155
|
</View>
|
|
144
|
-
</
|
|
156
|
+
</Modal>
|
|
145
157
|
)
|
|
146
158
|
}
|
|
147
159
|
|