be-components 4.9.9 → 5.0.1
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/Authenticator/index.js +6 -4
- package/lib/commonjs/Authenticator/index.js.map +1 -1
- package/lib/commonjs/Bracket/api/index.js +110 -53
- package/lib/commonjs/Bracket/api/index.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js +5 -1
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js +21 -2
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.js +315 -9
- package/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/index.js +301 -5
- package/lib/commonjs/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/commonjs/Bracket/index.js +25 -10
- package/lib/commonjs/Bracket/index.js.map +1 -1
- package/lib/commonjs/Share/index.js +9 -8
- package/lib/commonjs/Share/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/Contacts/useContacts.js +10 -0
- package/lib/commonjs/SocialComponents/Contacts/useContacts.js.map +1 -1
- package/lib/module/Authenticator/index.js +6 -4
- package/lib/module/Authenticator/index.js.map +1 -1
- package/lib/module/Bracket/api/index.js +110 -53
- package/lib/module/Bracket/api/index.js.map +1 -1
- package/lib/module/Bracket/components/BracketCompetitionActions.js +5 -1
- package/lib/module/Bracket/components/BracketCompetitionActions.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js +22 -3
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/RoundEvent.js +315 -9
- package/lib/module/Bracket/components/BracketPlay/RoundEvent.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/index.js +303 -7
- package/lib/module/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/module/Bracket/index.js +25 -10
- package/lib/module/Bracket/index.js.map +1 -1
- package/lib/module/Share/index.js +9 -8
- package/lib/module/Share/index.js.map +1 -1
- package/lib/module/SocialComponents/Contacts/useContacts.js +10 -0
- package/lib/module/SocialComponents/Contacts/useContacts.js.map +1 -1
- package/lib/typescript/dist/embeds/bracket.bundle.d.ts +1 -0
- package/lib/typescript/dist/embeds/bracket.bundle.d.ts.map +1 -0
- package/lib/typescript/dist/embeds/common.bundle.d.ts +1 -0
- package/lib/typescript/dist/embeds/common.bundle.d.ts.map +1 -0
- package/lib/typescript/dist/embeds/main.bundle.d.ts +1 -0
- package/lib/typescript/dist/embeds/main.bundle.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Authenticator/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/api/index.d.ts +16 -10
- package/lib/typescript/lib/commonjs/Bracket/api/index.d.ts.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/BracketPlay/BracketRound.d.ts +4 -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.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Share/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/Contacts/useContacts.d.ts +1 -0
- package/lib/typescript/lib/commonjs/SocialComponents/Contacts/useContacts.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/index.d.ts +1 -0
- package/lib/typescript/lib/module/Authenticator/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/api/index.d.ts +16 -10
- package/lib/typescript/lib/module/Bracket/api/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/BracketPlay/BracketRound.d.ts +4 -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.map +1 -1
- package/lib/typescript/lib/module/Bracket/index.d.ts +3 -1
- package/lib/typescript/lib/module/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Spring.d.ts +93 -93
- package/lib/typescript/lib/module/Share/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/Contacts/useContacts.d.ts +1 -0
- package/lib/typescript/lib/module/SocialComponents/Contacts/useContacts.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/api/index.d.ts +15 -3
- package/lib/typescript/src/Bracket/api/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/BracketPlay/BracketRound.d.ts +3 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/RoundEvent.d.ts +3 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/RoundEvent.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/index.d.ts +4 -2
- package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/api/index.d.ts +1 -1
- package/lib/typescript/src/SocialComponents/Contacts/useContacts.d.ts +1 -0
- package/lib/typescript/src/SocialComponents/Contacts/useContacts.d.ts.map +1 -1
- package/package.json +5 -2
- package/src/Authenticator/index.tsx +4 -4
- package/src/Bracket/api/index.ts +84 -52
- package/src/Bracket/components/BracketCompetitionActions.tsx +4 -2
- package/src/Bracket/components/BracketPlay/BracketRound.tsx +16 -5
- package/src/Bracket/components/BracketPlay/RoundEvent.tsx +149 -5
- package/src/Bracket/components/BracketPlay/index.tsx +182 -12
- package/src/Bracket/index.tsx +43 -36
- package/src/Share/index.tsx +3 -3
- package/src/SocialComponents/Contacts/useContacts.tsx +11 -1
- package/src/types.d.ts +7 -1
|
@@ -137,7 +137,7 @@ declare const MarketMaketHelpers: {
|
|
|
137
137
|
calcPotentialWinnings: (amt: number, odds: number) => number;
|
|
138
138
|
calcProbabilityFromOdds: (odds: number) => number;
|
|
139
139
|
getAvailableSideIds: (my_orders: OrderProps[], available_orders: BestAvailableOrderProps[], prices: ExternalPriceProps[], market: MarketProps) => {
|
|
140
|
-
side_type: "
|
|
140
|
+
side_type: "athlete" | "team" | "event" | "exotic" | "h2h";
|
|
141
141
|
unique_side_ids: string[];
|
|
142
142
|
default_side_id: string;
|
|
143
143
|
};
|
|
@@ -9,6 +9,7 @@ declare const useContacts: ({ referral_code }: UseContactProps) => {
|
|
|
9
9
|
permission_checked: boolean;
|
|
10
10
|
permission: Contacts.PermissionResponse | undefined;
|
|
11
11
|
contact_loading: boolean;
|
|
12
|
+
getContacts: () => Promise<Contacts.ContactResponse | undefined>;
|
|
12
13
|
checkPermissions: () => Promise<Contacts.PermissionResponse | undefined>;
|
|
13
14
|
checkAvailable: () => Promise<boolean>;
|
|
14
15
|
requestPermissions: () => Promise<Contacts.PermissionResponse | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContacts.d.ts","sourceRoot":"","sources":["../../../../../src/SocialComponents/Contacts/useContacts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,KAAK,eAAe,GAAG;IACnB,aAAa,CAAC,EAAC,MAAM,CAAA;CACxB,CAAA;AAED,QAAA,MAAM,WAAW,sBAAsB,eAAe;;;;;;
|
|
1
|
+
{"version":3,"file":"useContacts.d.ts","sourceRoot":"","sources":["../../../../../src/SocialComponents/Contacts/useContacts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,KAAK,eAAe,GAAG;IACnB,aAAa,CAAC,EAAC,MAAM,CAAA;CACxB,CAAA;AAED,QAAA,MAAM,WAAW,sBAAsB,eAAe;;;;;;uBAuEtB,OAAO,CAAC,QAAQ,CAAC,eAAe,GAAG,SAAS,CAAC;4BA3BxC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,GAAG,SAAS,CAAC;0BAdlD,OAAO,CAAC,OAAO,CAAC;8BA4BZ,OAAO,CAAC,QAAQ,CAAC,kBAAkB,GAAG,SAAS,CAAC;sBAuBxD,OAAO,CAAC;QAAE,MAAM,EAAC,iBAAiB,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAwC9F,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "be-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Components for BettorEdge Apps",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
29
|
"example": "yarn workspace be-components-example",
|
|
30
|
+
"web-build": "yarn workspace be-components-example expo export -p web",
|
|
30
31
|
"test": "jest",
|
|
31
32
|
"typecheck": "tsc --noEmit",
|
|
32
33
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
"eslint": "^8.51.0",
|
|
70
71
|
"eslint-config-prettier": "^9.0.0",
|
|
71
72
|
"eslint-plugin-prettier": "^5.0.1",
|
|
73
|
+
"html-webpack-plugin": "^5.6.3",
|
|
72
74
|
"jest": "^29.7.0",
|
|
73
75
|
"prettier": "^3.0.3",
|
|
74
76
|
"react": "18.3.1",
|
|
@@ -170,7 +172,7 @@
|
|
|
170
172
|
"axios": "^1.6.8",
|
|
171
173
|
"buffer": "^6.0.3",
|
|
172
174
|
"draft-js": "^0.11.7",
|
|
173
|
-
"expo": "
|
|
175
|
+
"expo": "^52.0.38",
|
|
174
176
|
"expo-asset": "^11.0.1",
|
|
175
177
|
"expo-av": "^15.0.2",
|
|
176
178
|
"expo-camera": "^16.0.9",
|
|
@@ -192,6 +194,7 @@
|
|
|
192
194
|
"moment-mini": "^2.29.4",
|
|
193
195
|
"react-datetime-picker": "^6.0.1",
|
|
194
196
|
"react-device-detect": "^2.2.3",
|
|
197
|
+
"react-dom": "18.3.1",
|
|
195
198
|
"react-native-base64": "^0.2.1",
|
|
196
199
|
"react-native-svg": "15.8.0",
|
|
197
200
|
"react-native-uuid": "^2.0.3",
|
|
@@ -85,9 +85,9 @@ const Authenticator = ({ show_referral, auth_strategy_id, onFocusPosition, defau
|
|
|
85
85
|
case 'header':
|
|
86
86
|
if(!company){ return <></> }
|
|
87
87
|
return (
|
|
88
|
-
<View type='header' style={{ padding:20, flexDirection:'row', alignItems:'center', borderTopRightRadius:
|
|
88
|
+
<View type='header' style={{ padding:20, flexDirection:'row', alignItems:'center', borderTopRightRadius:8, borderTopLeftRadius:8, borderBottomWidth:1, borderColor:C.borders.light }}>
|
|
89
89
|
<View transparent style={{ flex:1, marginRight:10 }}>
|
|
90
|
-
<Text size={28}
|
|
90
|
+
<Text size={28} theme='h1' color={C.text.h1}>{active_view == 'login' ? 'Log In!': 'Welcome!'}</Text>
|
|
91
91
|
<Text theme='h2'>{active_view == 'login' ? 'Continue to login with':'Complete the form below to participate with'} {company?.company_name ?? 'Bettoredge'}</Text>
|
|
92
92
|
</View>
|
|
93
93
|
<View float style={{ borderRadius:100, padding:10, backgroundColor:C.text.white }}>
|
|
@@ -96,7 +96,7 @@ const Authenticator = ({ show_referral, auth_strategy_id, onFocusPosition, defau
|
|
|
96
96
|
style={{ width: 50, height: 50, borderRadius:8 }}
|
|
97
97
|
resizeMode='cover'
|
|
98
98
|
/>
|
|
99
|
-
</View>
|
|
99
|
+
</View>
|
|
100
100
|
</View>
|
|
101
101
|
)
|
|
102
102
|
case 'strategy':
|
|
@@ -143,7 +143,7 @@ const Authenticator = ({ show_referral, auth_strategy_id, onFocusPosition, defau
|
|
|
143
143
|
renderItem={renderSections}
|
|
144
144
|
/>
|
|
145
145
|
</View>
|
|
146
|
-
<View type='footer' style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
146
|
+
<View type='footer' style={{ padding:10, flexDirection:'row', alignItems:'center', borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
147
147
|
<Button
|
|
148
148
|
title='CLOSE'
|
|
149
149
|
title_color={C.text.error}
|
package/src/Bracket/api/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from "axios"
|
|
2
|
-
import type { AthleteProps, BracketCompetitionProps, BracketCompetitionScoringRuleProps, BracketGroupProps, BracketProps, BracketRoundProps, CompetitionPayoutTypeProps, CompetitionPlayerBracketProps, CompetitionResultTypeProps, CompetitionTypeProps, EventProps, LeagueProps, MyPlayerProps, PlayerBalanceProps, PlayerBracketPickProps, PlayerBracketProps, PublicPlayerProps, RoundEventProps, TeamProps } from "../../types";
|
|
2
|
+
import type { AthleteProps, BracketCompetitionProps, BracketCompetitionScoringRuleProps, BracketGroupProps, BracketPickStatProps, BracketProps, BracketRoundProps, CompetitionPayoutTypeProps, CompetitionPlayerBracketProps, CompetitionResultTypeProps, CompetitionTypeProps, EventProps, LeagueProps, MyPlayerProps, PlayerBalanceProps, PlayerBracketPickProps, PlayerBracketProps, PublicPlayerProps, RoundEventProps, TeamProps } from "../../types";
|
|
3
3
|
import { APIOverrides } from "../../ApiOverrides";
|
|
4
4
|
import moment from "moment-mini";
|
|
5
5
|
export { BracketApi, BracketComeptitionApi, BracketCompetitionHelpers }
|
|
@@ -84,6 +84,15 @@ const BracketComeptitionApi = {
|
|
|
84
84
|
return []
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
+
getBracketPickStatsByBracket: async(bracket_id:string):Promise<BracketPickStatProps[]> => {
|
|
88
|
+
try {
|
|
89
|
+
const resp = await axios.get(`${TP_SVC_API}/v1/brackets/bracket/stats/${bracket_id}`)
|
|
90
|
+
return resp.data.bracket_pick_stats
|
|
91
|
+
} catch (e) {
|
|
92
|
+
console.log(e);
|
|
93
|
+
return []
|
|
94
|
+
}
|
|
95
|
+
},
|
|
87
96
|
createBracketCompetition: async(bracket_competition:BracketCompetitionProps, bracket_competition_scoring_rules:BracketCompetitionScoringRuleProps[]):Promise<{bracket_competition:BracketCompetitionProps, bracket_competition_scoring_rules:BracketCompetitionScoringRuleProps[]}> => {
|
|
88
97
|
const resp = await axios.post(`${TP_SVC_API}/v1/brackets/competition/create`, { bracket_competition, bracket_competition_scoring_rules })
|
|
89
98
|
return resp.data
|
|
@@ -136,6 +145,7 @@ const BracketComeptitionApi = {
|
|
|
136
145
|
},
|
|
137
146
|
getBracketCompetitionById: async(bracket_competition_id:string):Promise<undefined|{bracket_competition:BracketCompetitionProps, competition_player_brackets:CompetitionPlayerBracketProps[], player_brackets:PlayerBracketProps[], bracket_competition_scoring_rules:BracketCompetitionScoringRuleProps[]}> => {
|
|
138
147
|
try {
|
|
148
|
+
|
|
139
149
|
const resp = await axios.get(`${TP_SVC_API}/v1/brackets/competition/${bracket_competition_id}`)
|
|
140
150
|
return resp.data
|
|
141
151
|
} catch (e) {
|
|
@@ -217,14 +227,13 @@ const BracketCompetitionHelpers = {
|
|
|
217
227
|
if(moment().isBefore(moment(bc.scheduled_datetime))){ return true }
|
|
218
228
|
return false
|
|
219
229
|
},
|
|
220
|
-
calcRoundWidth: (width:number, round_number:number, margin:number) => {
|
|
221
|
-
const min_width = 200;
|
|
230
|
+
calcRoundWidth: (width:number, round_number:number, margin:number, compact?:boolean) => {
|
|
231
|
+
const min_width = compact ? 100 : 200;
|
|
222
232
|
const max_width = 500;
|
|
223
233
|
if(round_number == 0){ return min_width }
|
|
224
234
|
//Check how many we can do in the fitted screen
|
|
225
235
|
let total_cards = Math.floor(width / min_width);
|
|
226
236
|
if(total_cards <= 2){
|
|
227
|
-
console.log('in here!!')
|
|
228
237
|
return (width / 2) - (margin * 4)
|
|
229
238
|
}
|
|
230
239
|
let total_margin = margin * round_number
|
|
@@ -234,6 +243,58 @@ const BracketCompetitionHelpers = {
|
|
|
234
243
|
return initial_test
|
|
235
244
|
|
|
236
245
|
},
|
|
246
|
+
calcFullBracketSize: ( round_width:number, rounds:number, margin:number ) => {
|
|
247
|
+
let full_length = (round_width * rounds * 2) + (margin * 2 * rounds) + 100 //Double since the groups are horizontal
|
|
248
|
+
return full_length
|
|
249
|
+
},
|
|
250
|
+
getNonGroupGames: (round_events:RoundEventProps[], bracket_groups:BracketGroupProps[], player_bracket_picks:PlayerBracketPickProps[]):NonGroupEventProps[] => {
|
|
251
|
+
let non_group_events:NonGroupEventProps[] = []
|
|
252
|
+
let non_group_games = round_events.filter(re => re.bracket_group_id == '0')
|
|
253
|
+
if(non_group_games.length == 0){ return [] }
|
|
254
|
+
let championship_game = round_events.sort((a,b) => b.event_number - a.event_number)[0]
|
|
255
|
+
if(championship_game){
|
|
256
|
+
const champ_pick = player_bracket_picks.find(pbp => pbp.round_event_id == championship_game.round_event_id && pbp.status != 'deleted')
|
|
257
|
+
const away_champ_pick = player_bracket_picks.find(pbp => pbp.round_event_id == championship_game.away_placeholder && pbp.status != 'deleted')
|
|
258
|
+
const home_champ_pick = player_bracket_picks.find(pbp => pbp.round_event_id == championship_game.home_placeholder && pbp.status != 'deleted')
|
|
259
|
+
|
|
260
|
+
non_group_events.push({
|
|
261
|
+
round_event_id: championship_game.round_event_id,
|
|
262
|
+
event_number: championship_game.event_number,
|
|
263
|
+
round_event: championship_game,
|
|
264
|
+
championship: true,
|
|
265
|
+
away_placeholder_pick: away_champ_pick,
|
|
266
|
+
home_placeholder_pick: home_champ_pick,
|
|
267
|
+
player_bracket_pick: champ_pick
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
//Find the side of the bracket the game needs to be on
|
|
271
|
+
non_group_games.map(ngg => {
|
|
272
|
+
if(championship_game?.round_event_id == ngg.round_event_id){ return }
|
|
273
|
+
let away_placeholder_game = round_events.find(re => re.round_event_id == ngg.away_placeholder);
|
|
274
|
+
let away_group = bracket_groups.find(bg => bg.bracket_group_id == away_placeholder_game?.bracket_group_id)
|
|
275
|
+
//let home_placeholder_game = round_events.find(re => re.round_event_id == ngg.home_placeholder);
|
|
276
|
+
//let home_group = bracket_groups.find(bg => bg.bracket_group_id == home_placeholder_game?.bracket_group_id)
|
|
277
|
+
let orientation:'left'|'right' = 'left'
|
|
278
|
+
if(away_group?.orientation != 'left'){ orientation = 'right' }
|
|
279
|
+
let pbp = player_bracket_picks.find(pbp => pbp.round_event_id == ngg.round_event_id && pbp.status != 'deleted')
|
|
280
|
+
const away_ff_pick = player_bracket_picks.find(pbp => pbp.round_event_id == ngg.away_placeholder && pbp.status != 'deleted')
|
|
281
|
+
const home_ff_pick = player_bracket_picks.find(pbp => pbp.round_event_id == ngg.home_placeholder && pbp.status != 'deleted')
|
|
282
|
+
|
|
283
|
+
non_group_events.push({
|
|
284
|
+
round_event_id: ngg.round_event_id,
|
|
285
|
+
championship: false,
|
|
286
|
+
orientation,
|
|
287
|
+
player_bracket_pick: pbp,
|
|
288
|
+
round_event: ngg,
|
|
289
|
+
away_placeholder_pick: away_ff_pick,
|
|
290
|
+
home_placeholder_pick: home_ff_pick,
|
|
291
|
+
event_number: ngg.event_number
|
|
292
|
+
})
|
|
293
|
+
|
|
294
|
+
})
|
|
295
|
+
|
|
296
|
+
return non_group_events
|
|
297
|
+
},
|
|
237
298
|
getToggleOptions: () => {
|
|
238
299
|
let options = [
|
|
239
300
|
{ key: 'my_brackets', label:'My Brackets' },
|
|
@@ -249,6 +310,7 @@ const BracketCompetitionHelpers = {
|
|
|
249
310
|
},
|
|
250
311
|
canMakePick: (bracket?:BracketProps) => {
|
|
251
312
|
if(!bracket){ return false }
|
|
313
|
+
if(!bracket.picks_allowed){ return false }
|
|
252
314
|
if(moment().isAfter(moment(bracket.scheduled_datetime))){ return false }
|
|
253
315
|
return true
|
|
254
316
|
},
|
|
@@ -364,6 +426,24 @@ const BracketCompetitionHelpers = {
|
|
|
364
426
|
if(!init_failed){ return rules }
|
|
365
427
|
return BracketCompetitionHelpers.getDefaultScoringRules(bracket_competition_id, bracket_rounds);
|
|
366
428
|
},
|
|
429
|
+
getPlayerBracketStatus: (bracket_rounds:BracketRoundProps[], bracket_groups:BracketGroupProps[], round_events:RoundEventProps[], player_bracket_picks:PlayerBracketPickProps[]) => {
|
|
430
|
+
let round_statuses:{ bracket_round_id:string, status: 'complete'|'incomplete' }[] = []
|
|
431
|
+
let group_statuses:{ bracket_group_id:string, status: 'complete'|'incomplete' }[] = []
|
|
432
|
+
bracket_rounds.map(r => {
|
|
433
|
+
if(r.carry_through){ return round_statuses.push({ bracket_round_id:r.bracket_round_id, status: 'complete' }) }
|
|
434
|
+
let round_evs = round_events.filter(re => re.bracket_round_id == r.bracket_round_id);
|
|
435
|
+
let round_picks = player_bracket_picks.filter(pbp => round_evs.map(ev => ev.round_event_id.toString()).includes(pbp.round_event_id.toString()));
|
|
436
|
+
if(round_picks.length == round_evs.length){ return round_statuses.push({ bracket_round_id: r.bracket_round_id, status:'complete' }) }
|
|
437
|
+
return round_statuses.push({ bracket_round_id: r.bracket_round_id, status:'incomplete' })
|
|
438
|
+
});
|
|
439
|
+
bracket_groups.map(r => {
|
|
440
|
+
let group_evs = round_events.filter(re => !re.no_pick && re.bracket_group_id == r.bracket_group_id);
|
|
441
|
+
let group_picks = player_bracket_picks.filter(pbp => group_evs.map(ev => ev.round_event_id.toString()).includes(pbp.round_event_id.toString()));
|
|
442
|
+
if(group_picks.length == group_evs.length){ return group_statuses.push({ bracket_group_id: r.bracket_group_id, status:'complete' }) }
|
|
443
|
+
return group_statuses.push({ bracket_group_id: r.bracket_group_id, status:'incomplete' })
|
|
444
|
+
});
|
|
445
|
+
return { round_statuses, group_statuses }
|
|
446
|
+
},
|
|
367
447
|
getDefaultScoringRules : (bracket_competition_id:string, bracket_rounds:BracketRoundProps[]):BracketCompetitionScoringRuleProps[] => {
|
|
368
448
|
let rules:BracketCompetitionScoringRuleProps[] = []
|
|
369
449
|
let next_points = 1;
|
|
@@ -436,54 +516,6 @@ const BracketCompetitionHelpers = {
|
|
|
436
516
|
|
|
437
517
|
return { round_status, group_status }
|
|
438
518
|
},
|
|
439
|
-
getNonGroupGames : (round_events:RoundEventProps[], bracket_groups:BracketGroupProps[], player_bracket_picks:PlayerBracketPickProps[]):NonGroupEventProps[] => {
|
|
440
|
-
let non_group_events:NonGroupEventProps[] = []
|
|
441
|
-
let non_group_games = round_events.filter(re => re.bracket_group_id == '0')
|
|
442
|
-
if(non_group_games.length == 0){ return [] }
|
|
443
|
-
let championship_game = round_events.sort((a,b) => b.event_number - a.event_number)[0]
|
|
444
|
-
if(championship_game){
|
|
445
|
-
const champ_pick = player_bracket_picks.find(pbp => pbp.round_event_id == championship_game.round_event_id && pbp.status != 'deleted')
|
|
446
|
-
const away_champ_pick = player_bracket_picks.find(pbp => pbp.round_event_id == championship_game.away_placeholder && pbp.status != 'deleted')
|
|
447
|
-
const home_champ_pick = player_bracket_picks.find(pbp => pbp.round_event_id == championship_game.home_placeholder && pbp.status != 'deleted')
|
|
448
|
-
|
|
449
|
-
non_group_events.push({
|
|
450
|
-
round_event_id: championship_game.round_event_id,
|
|
451
|
-
event_number: championship_game.event_number,
|
|
452
|
-
round_event: championship_game,
|
|
453
|
-
championship: true,
|
|
454
|
-
away_placeholder_pick: away_champ_pick,
|
|
455
|
-
home_placeholder_pick: home_champ_pick,
|
|
456
|
-
player_bracket_pick: champ_pick
|
|
457
|
-
})
|
|
458
|
-
}
|
|
459
|
-
//Find the side of the bracket the game needs to be on
|
|
460
|
-
non_group_games.map(ngg => {
|
|
461
|
-
if(championship_game?.round_event_id == ngg.round_event_id){ return }
|
|
462
|
-
let away_placeholder_game = round_events.find(re => re.round_event_id == ngg.away_placeholder);
|
|
463
|
-
let away_group = bracket_groups.find(bg => bg.bracket_group_id == away_placeholder_game?.bracket_group_id)
|
|
464
|
-
//let home_placeholder_game = round_events.find(re => re.round_event_id == ngg.home_placeholder);
|
|
465
|
-
//let home_group = bracket_groups.find(bg => bg.bracket_group_id == home_placeholder_game?.bracket_group_id)
|
|
466
|
-
let orientation:'left'|'right' = 'left'
|
|
467
|
-
if(away_group?.orientation != 'left'){ orientation = 'right' }
|
|
468
|
-
let pbp = player_bracket_picks.find(pbp => pbp.round_event_id == ngg.round_event_id && pbp.status != 'deleted')
|
|
469
|
-
const away_ff_pick = player_bracket_picks.find(pbp => pbp.round_event_id == ngg.away_placeholder && pbp.status != 'deleted')
|
|
470
|
-
const home_ff_pick = player_bracket_picks.find(pbp => pbp.round_event_id == ngg.home_placeholder && pbp.status != 'deleted')
|
|
471
|
-
|
|
472
|
-
non_group_events.push({
|
|
473
|
-
round_event_id: ngg.round_event_id,
|
|
474
|
-
championship: false,
|
|
475
|
-
orientation,
|
|
476
|
-
player_bracket_pick: pbp,
|
|
477
|
-
round_event: ngg,
|
|
478
|
-
away_placeholder_pick: away_ff_pick,
|
|
479
|
-
home_placeholder_pick: home_ff_pick,
|
|
480
|
-
event_number: ngg.event_number
|
|
481
|
-
})
|
|
482
|
-
|
|
483
|
-
})
|
|
484
|
-
|
|
485
|
-
return non_group_events
|
|
486
|
-
},
|
|
487
519
|
generateCompetitionPlayerBracket : (bracket_competition_id:string, player_bracket_id:string, promo_balance?:boolean):CompetitionPlayerBracketProps => {
|
|
488
520
|
return {
|
|
489
521
|
competition_player_bracket_id: '',
|
|
@@ -26,6 +26,7 @@ type BracketCompetitionActionProps = {
|
|
|
26
26
|
player_bracket?:PlayerBracketProps,
|
|
27
27
|
onFocusPosition?:(data:{ x:number, y:number, height:number, width:number }) => void,
|
|
28
28
|
player_brackets:PlayerBracketProps[],
|
|
29
|
+
restrict_competition?:boolean,
|
|
29
30
|
competition_player_brackets:CompetitionPlayerBracketProps[],
|
|
30
31
|
onExpand?:() => void,
|
|
31
32
|
onRequestAuthenticate:() => void,
|
|
@@ -36,7 +37,7 @@ type BracketCompetitionActionProps = {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
const sections = ['active_competition', 'leaderboard', 'actions', 'competitions'];
|
|
39
|
-
const BracketCompetitionActions = ({ competition_id, hide_image, image_height, onShowLeaderboard, onCreateNewCompetition, onManage, image_width, player, player_brackets, insets, onRequestAuthenticate, onSelectCompetition, onFoundCompetition, onFocusPosition, onEnterCompetition, onLeaveCompetition, competition_result_types, player_balance, view_mode, bracket_id, player_bracket, competition_player_brackets }:BracketCompetitionActionProps) => {
|
|
40
|
+
const BracketCompetitionActions = ({ competition_id, hide_image, image_height, restrict_competition, onShowLeaderboard, onCreateNewCompetition, onManage, image_width, player, player_brackets, insets, onRequestAuthenticate, onSelectCompetition, onFoundCompetition, onFocusPosition, onEnterCompetition, onLeaveCompetition, competition_result_types, player_balance, view_mode, bracket_id, player_bracket, competition_player_brackets }:BracketCompetitionActionProps) => {
|
|
40
41
|
const Colors = useColors();
|
|
41
42
|
const [ search_data, setSearchData ] = useState<{
|
|
42
43
|
visible:boolean,
|
|
@@ -209,7 +210,7 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, o
|
|
|
209
210
|
style={{ padding:0, justifyContent:'flex-end' }}
|
|
210
211
|
onPress={() => onShowLeaderboard(player_brackets, entered_cpbs)}
|
|
211
212
|
>
|
|
212
|
-
<Text theme='h1' color={Colors.text.action} size={14}>View
|
|
213
|
+
<Text theme='h1' color={Colors.text.action} size={14}>View Leaderboard</Text>
|
|
213
214
|
</Button>
|
|
214
215
|
</View>
|
|
215
216
|
{active_competition?.prize_override ?
|
|
@@ -277,6 +278,7 @@ const BracketCompetitionActions = ({ competition_id, hide_image, image_height, o
|
|
|
277
278
|
</View>
|
|
278
279
|
)
|
|
279
280
|
case 'competitions':
|
|
281
|
+
if(restrict_competition){ return <></> }
|
|
280
282
|
return (
|
|
281
283
|
<View transparent>
|
|
282
284
|
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:18 }}>
|
|
@@ -3,7 +3,7 @@ import type { AthleteProps, BracketProps, BracketRoundProps, PlayerBracketPickPr
|
|
|
3
3
|
import RoundEventCard from './RoundEvent';
|
|
4
4
|
import { view_styles } from '../../../constants/styles';
|
|
5
5
|
import { Button, Text, View } from '../../../Components/Themed';
|
|
6
|
-
import { Checkbox } from '../../../Components';
|
|
6
|
+
import { Checkbox, Icons } from '../../../Components';
|
|
7
7
|
import { useColors } from '../../../constants/useColors';
|
|
8
8
|
|
|
9
9
|
type BracketRoundSectionProps = {
|
|
@@ -14,7 +14,9 @@ type BracketRoundSectionProps = {
|
|
|
14
14
|
selected?:boolean,
|
|
15
15
|
bracket?:BracketProps,
|
|
16
16
|
round_events:RoundEventProps[],
|
|
17
|
+
compact?:boolean,
|
|
17
18
|
teams:TeamProps[],
|
|
19
|
+
pick_status?:'complete'|'incomplete'
|
|
18
20
|
athletes:AthleteProps[],
|
|
19
21
|
hide_titles?:boolean,
|
|
20
22
|
width:number,
|
|
@@ -27,7 +29,7 @@ type BracketRoundSectionProps = {
|
|
|
27
29
|
right_bar?:boolean
|
|
28
30
|
}
|
|
29
31
|
|
|
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) => {
|
|
32
|
+
const BracketRoundSection = ({ bracket_round, compact, orientation, selected, pick_status, bracket, round_event_loading, teams, round_events, width, hide_titles, player_bracket_picks, active_bracket_group_id, onSelectContest, onSelectRound, onPick }:BracketRoundSectionProps) => {
|
|
31
33
|
const Colors = useColors();
|
|
32
34
|
if(active_bracket_group_id){
|
|
33
35
|
round_events = round_events.filter(re => re.bracket_group_id == active_bracket_group_id)
|
|
@@ -52,6 +54,8 @@ const BracketRoundSection = ({ bracket_round, selected, bracket, round_event_loa
|
|
|
52
54
|
round_events={round_events}
|
|
53
55
|
away_team={away_team}
|
|
54
56
|
bracket={bracket}
|
|
57
|
+
compact={compact}
|
|
58
|
+
orientation={orientation}
|
|
55
59
|
home_team={home_team}
|
|
56
60
|
away_placeholder_team={away_placeholder_team}
|
|
57
61
|
home_placeholder_team={home_placeholder_team}
|
|
@@ -73,12 +77,19 @@ const BracketRoundSection = ({ bracket_round, selected, bracket, round_event_loa
|
|
|
73
77
|
|
|
74
78
|
|
|
75
79
|
return (
|
|
76
|
-
<View key={`${bracket_round.bracket_id}_${bracket_round.bracket_round_id}`} transparent style={{ }}>
|
|
80
|
+
<View key={`${bracket_round.bracket_id}_${bracket_round.bracket_round_id}`} transparent style={{ minWidth: width }}>
|
|
77
81
|
{!hide_titles ?
|
|
78
82
|
<View transparent style={{ borderBottomWidth:selected?2:1, borderColor:selected?Colors.text.action:Colors.borders.light, margin:3 }}>
|
|
79
83
|
<Button type='text' style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => onSelectRound(bracket_round)}>
|
|
80
|
-
<
|
|
81
|
-
|
|
84
|
+
<View style={{ flexDirection:'row', alignItems:'center', flex:1 }}>
|
|
85
|
+
<Checkbox checked={selected} color={Colors.text.action} disabled size={18} style={{ borderRadius:100 }} fill_style={{ borderRadius:100 }} onSelect={() => console.log('')} />
|
|
86
|
+
<Text style={{ marginLeft:10 }} size={14} theme='h1' textAlign="center">{bracket_round.round_name}</Text>
|
|
87
|
+
</View>
|
|
88
|
+
{pick_status == 'complete' ?
|
|
89
|
+
<Icons.CheckCirlceIcon color={Colors.text.success} size={14} />
|
|
90
|
+
:
|
|
91
|
+
<Icons.AlertIcon color={Colors.text.warning} size={14} />
|
|
92
|
+
}
|
|
82
93
|
</Button>
|
|
83
94
|
</View>
|
|
84
95
|
:<></>}
|
|
@@ -19,6 +19,8 @@ type RoundEventCardProps = {
|
|
|
19
19
|
away_athlete?:AthleteProps,
|
|
20
20
|
bracket?:BracketProps,
|
|
21
21
|
home_athlete?:AthleteProps,
|
|
22
|
+
compact?:boolean,
|
|
23
|
+
orientation?:'left'|'right',
|
|
22
24
|
loading?:boolean,
|
|
23
25
|
width:number,
|
|
24
26
|
no_pick?:boolean,
|
|
@@ -28,7 +30,7 @@ type RoundEventCardProps = {
|
|
|
28
30
|
onSelectContest?:(round_event:RoundEventProps, player_bracket_pick?:PlayerBracketPickProps, away_placeholder_pick?:PlayerBracketPickProps, home_placeholder_pick?:PlayerBracketPickProps) => void
|
|
29
31
|
}
|
|
30
32
|
|
|
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) => {
|
|
33
|
+
const RoundEventCard = ({ event, loading, orientation, compact, 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) => {
|
|
32
34
|
//AWAY PLACEHOLDER
|
|
33
35
|
const round_width = width//width > 600 ? undefined : width / 2
|
|
34
36
|
const Colors = useColors();
|
|
@@ -135,13 +137,133 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
135
137
|
else { return event.home_team_score }
|
|
136
138
|
}
|
|
137
139
|
|
|
140
|
+
const renderLeftSide = (side:'away'|'home') => {
|
|
141
|
+
switch(side){
|
|
142
|
+
case 'away':
|
|
143
|
+
return (
|
|
144
|
+
<View transparent>
|
|
145
|
+
{round_event?.away_side_id && away_placeholder_pick && away_placeholder_team ?
|
|
146
|
+
<View transparent style={{ padding:7, borderTopRightRadius:8, borderTopLeftRadius:8, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
|
|
147
|
+
<Text size={10} theme='h2' color={away_placeholder_pick.result_ind=='win'?Colors.text.success:Colors.text.error}>{away_placeholder_team.market_name} {away_placeholder_team.name}</Text>
|
|
148
|
+
</View>
|
|
149
|
+
:<></>}
|
|
150
|
+
<View style={{ flexDirection:'row', alignItems:'center', padding:12, borderTopRightRadius:!round_event?.away_side_id || !round_event.away_placeholder?8:0, borderTopLeftRadius:!round_event?.away_side_id || !round_event.away_placeholder?8:0 }}>
|
|
151
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center', borderRightWidth:1, borderRightColor:Colors.borders.light }}>
|
|
152
|
+
<View transparent style={{ marginLeft:5 }}>
|
|
153
|
+
{renderButton('away')}
|
|
154
|
+
</View>
|
|
155
|
+
{round_event.event_id ?
|
|
156
|
+
<Text style={{ margin:5}} size={10} theme='h2'>{getScore(away_team?.team_id)}</Text>
|
|
157
|
+
:<></>}
|
|
158
|
+
</View>
|
|
159
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:0 }}>
|
|
160
|
+
{round_event.away_side_id && away_team ?
|
|
161
|
+
<View style={{ flexGrow:1, flexDirection:'row', alignItems:'center' }}>
|
|
162
|
+
<Image
|
|
163
|
+
source={{ uri: away_team.image?.url }}
|
|
164
|
+
style={{ height:20, width:20, marginLeft:2 }}
|
|
165
|
+
resizeMode="cover"
|
|
166
|
+
/>
|
|
167
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?round_event.away_seed:''}</Text>
|
|
168
|
+
{compact ?
|
|
169
|
+
<Text style={{ flex:1 }} size={10} color={getPickColor('away', player_bracket_pick)} theme='h2'>{away_team.abbr}</Text>
|
|
170
|
+
:
|
|
171
|
+
<Text style={{ flex:1 }} size={10} color={getPickColor('away', player_bracket_pick)} theme='h2'>{away_team.market_name} {away_team.name}</Text>
|
|
172
|
+
}
|
|
173
|
+
</View>
|
|
174
|
+
:
|
|
175
|
+
<View transparent>
|
|
176
|
+
{away_placeholder_pick && away_placeholder_team ?
|
|
177
|
+
<View transparent style={{ flexGrow:1, flexDirection:'row', alignItems:'center' }}>
|
|
178
|
+
<Image
|
|
179
|
+
source={{ uri: away_placeholder_team.image?.url }}
|
|
180
|
+
style={{ height:20, width:20, marginLeft:2 }}
|
|
181
|
+
resizeMode="cover"
|
|
182
|
+
/>
|
|
183
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?away_placeholder_pick.pick_seed:''}</Text>
|
|
184
|
+
{compact ?
|
|
185
|
+
<Text style={{ flex:1 }} size={10} theme='h1'>{away_placeholder_team.abbr}</Text>
|
|
186
|
+
:
|
|
187
|
+
<Text style={{ flex:1 }} size={10} theme='h1'>{away_placeholder_team.market_name} {away_placeholder_team.name}</Text>
|
|
188
|
+
}
|
|
189
|
+
</View>
|
|
190
|
+
:
|
|
191
|
+
<Text color='transparent'>select</Text>
|
|
192
|
+
}
|
|
193
|
+
</View>
|
|
194
|
+
}
|
|
195
|
+
</View>
|
|
196
|
+
|
|
197
|
+
</View>
|
|
198
|
+
</View>
|
|
199
|
+
)
|
|
200
|
+
case 'home':
|
|
201
|
+
return (
|
|
202
|
+
<View transparent>
|
|
203
|
+
<View style={{ flexDirection:'row', alignItems:'center', padding:12, borderBottomRightRadius:!round_event?.home_side_id || !round_event.home_placeholder?8:0, borderBottomLeftRadius:!round_event?.home_side_id || !round_event.home_placeholder?8:0 }}>
|
|
204
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center', borderRightWidth:1, borderRightColor:Colors.borders.light }}>
|
|
205
|
+
<View transparent style={{ marginLeft:5 }}>
|
|
206
|
+
{renderButton('home')}
|
|
207
|
+
</View>
|
|
208
|
+
{round_event.event_id ?
|
|
209
|
+
<Text style={{ margin:5}} size={10} theme='h2'>{getScore(home_team?.team_id)}</Text>
|
|
210
|
+
:<></>}
|
|
211
|
+
</View>
|
|
212
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
213
|
+
{round_event.home_side_id && home_team ?
|
|
214
|
+
<View transparent style={{ flexGrow:1, flexDirection:'row', alignItems:'center' }}>
|
|
215
|
+
<Image
|
|
216
|
+
source={{ uri: home_team.image?.url }}
|
|
217
|
+
style={{ height:20, width:20, marginLeft:2 }}
|
|
218
|
+
resizeMode="cover"
|
|
219
|
+
/>
|
|
220
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?round_event.home_seed:''}</Text>
|
|
221
|
+
{compact ?
|
|
222
|
+
<Text style={{ flex:1 }} size={10} color={getPickColor('home', player_bracket_pick)} theme='h2'>{home_team.abbr}</Text>
|
|
223
|
+
:
|
|
224
|
+
<Text style={{ flex:1 }} size={10} color={getPickColor('home', player_bracket_pick)} theme='h2'>{home_team.market_name} {home_team.name}</Text>
|
|
225
|
+
}
|
|
226
|
+
</View>
|
|
227
|
+
:
|
|
228
|
+
<View transparent>
|
|
229
|
+
{home_placeholder_pick && home_placeholder_team ?
|
|
230
|
+
<View style={{ flexGrow:1, flexDirection:'row', alignItems:'center' }}>
|
|
231
|
+
<Image
|
|
232
|
+
source={{ uri: home_placeholder_team.image?.url }}
|
|
233
|
+
style={{ height:20, width:20, marginLeft:2 }}
|
|
234
|
+
resizeMode="cover"
|
|
235
|
+
/>
|
|
236
|
+
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='action'>{!bracket?.hide_seeds?home_placeholder_pick.pick_seed:''}</Text>
|
|
237
|
+
{compact ?
|
|
238
|
+
<Text style={{ flex:1 }} size={10} theme='h2'>{home_placeholder_team.abbr}</Text>
|
|
239
|
+
:
|
|
240
|
+
<Text style={{ flex:1 }} size={10} theme='h2'>{home_placeholder_team.market_name} {home_placeholder_team.name}</Text>
|
|
241
|
+
}
|
|
242
|
+
</View>
|
|
243
|
+
:
|
|
244
|
+
<Text color='transparent'>select</Text>
|
|
245
|
+
}
|
|
246
|
+
</View>
|
|
247
|
+
}
|
|
248
|
+
</View>
|
|
249
|
+
</View>
|
|
250
|
+
{round_event?.home_side_id && home_placeholder_pick && home_placeholder_team?
|
|
251
|
+
<View transparent style={{ padding:7, borderBottomRightRadius:4, borderBottomLeftRadius:4, borderTopWidth:1, borderTopColor:Colors.borders.light }}>
|
|
252
|
+
<Text size={10} theme='h2' color={home_placeholder_pick.result_ind=='win'?Colors.text.success:Colors.text.error}>{home_placeholder_team.market_name} {home_placeholder_team.name}</Text>
|
|
253
|
+
</View>
|
|
254
|
+
:<></>}
|
|
255
|
+
</View>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
138
260
|
/*
|
|
139
261
|
let winning_side:string | undefined = undefined
|
|
140
262
|
if(round_event.status == 'closed'){
|
|
141
263
|
winning_side = round_event.winning_side_id == round_event.away_side_id ? 'away' : 'home'
|
|
142
264
|
}
|
|
143
265
|
*/
|
|
144
|
-
const
|
|
266
|
+
const renderRightSide = (side:'away'|'home') => {
|
|
145
267
|
switch(side){
|
|
146
268
|
case 'away':
|
|
147
269
|
return (
|
|
@@ -161,7 +283,11 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
161
283
|
resizeMode="cover"
|
|
162
284
|
/>
|
|
163
285
|
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?round_event.away_seed:''}</Text>
|
|
286
|
+
{compact ?
|
|
287
|
+
<Text style={{ flex:1 }} size={10} color={getPickColor('away', player_bracket_pick)} theme='h2'>{away_team.abbr}</Text>
|
|
288
|
+
:
|
|
164
289
|
<Text style={{ flex:1 }} size={10} color={getPickColor('away', player_bracket_pick)} theme='h2'>{away_team.market_name} {away_team.name}</Text>
|
|
290
|
+
}
|
|
165
291
|
</View>
|
|
166
292
|
:
|
|
167
293
|
<View transparent>
|
|
@@ -173,7 +299,11 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
173
299
|
resizeMode="cover"
|
|
174
300
|
/>
|
|
175
301
|
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?away_placeholder_pick.pick_seed:''}</Text>
|
|
302
|
+
{compact ?
|
|
303
|
+
<Text style={{ flex:1 }} size={10} theme='h1'>{away_placeholder_team.abbr}</Text>
|
|
304
|
+
:
|
|
176
305
|
<Text style={{ flex:1 }} size={10} theme='h1'>{away_placeholder_team.market_name} {away_placeholder_team.name}</Text>
|
|
306
|
+
}
|
|
177
307
|
</View>
|
|
178
308
|
:
|
|
179
309
|
<Text color='transparent'>select</Text>
|
|
@@ -206,7 +336,11 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
206
336
|
resizeMode="cover"
|
|
207
337
|
/>
|
|
208
338
|
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='description'>{!bracket?.hide_seeds?round_event.home_seed:''}</Text>
|
|
339
|
+
{compact ?
|
|
340
|
+
<Text style={{ flex:1 }} size={10} color={getPickColor('home', player_bracket_pick)} theme='h2'>{home_team.abbr}</Text>
|
|
341
|
+
:
|
|
209
342
|
<Text style={{ flex:1 }} size={10} color={getPickColor('home', player_bracket_pick)} theme='h2'>{home_team.market_name} {home_team.name}</Text>
|
|
343
|
+
}
|
|
210
344
|
</View>
|
|
211
345
|
:
|
|
212
346
|
<View transparent>
|
|
@@ -218,7 +352,11 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
218
352
|
resizeMode="cover"
|
|
219
353
|
/>
|
|
220
354
|
<Text style={{ paddingRight: 5, borderRightWidth:1, borderColor:Colors.borders.light }} size={10} theme='action'>{!bracket?.hide_seeds?home_placeholder_pick.pick_seed:''}</Text>
|
|
355
|
+
{compact ?
|
|
356
|
+
<Text style={{ flex:1 }} size={10} theme='h2'>{home_placeholder_team.abbr}</Text>
|
|
357
|
+
:
|
|
221
358
|
<Text style={{ flex:1 }} size={10} theme='h2'>{home_placeholder_team.market_name} {home_placeholder_team.name}</Text>
|
|
359
|
+
}
|
|
222
360
|
</View>
|
|
223
361
|
:
|
|
224
362
|
<Text color='transparent'>select</Text>
|
|
@@ -248,7 +386,7 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
248
386
|
|
|
249
387
|
return (
|
|
250
388
|
<View transparent float style={{ flexDirection:'row', borderRadius:8, minWidth:125, width:round_width }}>
|
|
251
|
-
{onSelectContest ?
|
|
389
|
+
{!compact && orientation != 'left' && onSelectContest ?
|
|
252
390
|
<Button style={{ padding:10, justifyContent:'center', alignItems:'center', borderRightWidth:1, borderColor:Colors.borders.light, borderRadius:0, borderTopLeftRadius:8, borderBottomLeftRadius:8 }}
|
|
253
391
|
onPress={() => onSelectContest(round_event, player_bracket_pick, away_placeholder_pick, home_placeholder_pick)}>
|
|
254
392
|
<Icons.AlertIcon size={16} color={Colors.text.action} />
|
|
@@ -256,10 +394,10 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
256
394
|
:<></>}
|
|
257
395
|
<View transparent style={{ flex:1 }}>
|
|
258
396
|
<Button transparent style={{ padding:0, borderBottomWidth:1, borderColor:Colors.borders.light}} onPress={() => handleSelectAway()}>
|
|
259
|
-
{
|
|
397
|
+
{orientation == 'left' ? renderLeftSide('away') : renderRightSide('away')}
|
|
260
398
|
</Button>
|
|
261
399
|
<Button transparent style={{ padding:0 }} onPress={() => handleSelectHome()}>
|
|
262
|
-
{
|
|
400
|
+
{orientation == 'left' ? renderLeftSide('home') : renderRightSide('home')}
|
|
263
401
|
</Button>
|
|
264
402
|
{loading ?
|
|
265
403
|
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, borderRadius:8, justifyContent:'center', alignItems:'center' }}>
|
|
@@ -270,6 +408,12 @@ const RoundEventCard = ({ event, loading, bracket, away_team, away_placeholder_t
|
|
|
270
408
|
</View>
|
|
271
409
|
:<></>}
|
|
272
410
|
</View>
|
|
411
|
+
{!compact && orientation == 'left' && onSelectContest ?
|
|
412
|
+
<Button style={{ padding:10, justifyContent:'center', alignItems:'center', borderLeftWidth:1, borderColor:Colors.borders.light, borderRadius:0, borderTopRightRadius:8, borderBottomRightRadius:8 }}
|
|
413
|
+
onPress={() => onSelectContest(round_event, player_bracket_pick, away_placeholder_pick, home_placeholder_pick)}>
|
|
414
|
+
<Icons.AlertIcon size={16} color={Colors.text.action} />
|
|
415
|
+
</Button>
|
|
416
|
+
:<></>}
|
|
273
417
|
</View>
|
|
274
418
|
|
|
275
419
|
)
|