be-components 4.4.1 → 4.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Bracket/api/index.js +95 -3
- package/lib/commonjs/Bracket/api/index.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js +534 -0
- package/lib/commonjs/Bracket/components/BracketCompetitionActions.js.map +1 -0
- package/lib/commonjs/Bracket/components/BracketCompetitionCard.js +4 -2
- package/lib/commonjs/Bracket/components/BracketCompetitionCard.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketCompetitionSelector.js +50 -25
- package/lib/commonjs/Bracket/components/BracketCompetitionSelector.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketHeader.js +63 -0
- package/lib/commonjs/Bracket/components/BracketHeader.js.map +1 -0
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js +4 -0
- package/lib/commonjs/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.js +42 -21
- package/lib/commonjs/Bracket/components/BracketPlay/RoundEvent.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketPlay/index.js +76 -84
- package/lib/commonjs/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/commonjs/Bracket/components/BracketSelector.js +12 -44
- package/lib/commonjs/Bracket/components/BracketSelector.js.map +1 -1
- package/lib/commonjs/Bracket/components/CompetitionLeaderboard.js +14 -22
- package/lib/commonjs/Bracket/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/commonjs/Bracket/components/EditPlayerBracket.js +120 -0
- package/lib/commonjs/Bracket/components/EditPlayerBracket.js.map +1 -0
- package/lib/commonjs/Bracket/components/JoinCompetitionCard.js +61 -50
- package/lib/commonjs/Bracket/components/JoinCompetitionCard.js.map +1 -1
- package/lib/commonjs/Bracket/components/Navigator.js +102 -0
- package/lib/commonjs/Bracket/components/Navigator.js.map +1 -0
- package/lib/commonjs/Bracket/components/PlayerBalanceCard.js +16 -13
- package/lib/commonjs/Bracket/components/PlayerBalanceCard.js.map +1 -1
- package/lib/commonjs/Bracket/components/PlayerBracketCard.js +139 -0
- package/lib/commonjs/Bracket/components/PlayerBracketCard.js.map +1 -0
- package/lib/commonjs/Bracket/components/PlayerBrackets.js +65 -30
- package/lib/commonjs/Bracket/components/PlayerBrackets.js.map +1 -1
- package/lib/commonjs/Bracket/components/RoomHome.js +837 -0
- package/lib/commonjs/Bracket/components/RoomHome.js.map +1 -0
- package/lib/commonjs/Bracket/index.js +858 -281
- package/lib/commonjs/Bracket/index.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +51 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/SearchBox.js +2 -0
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/Engage/components/BracketCompetitionCard.js +2 -0
- package/lib/commonjs/Engage/components/BracketCompetitionCard.js.map +1 -1
- package/lib/module/Bracket/api/index.js +95 -3
- package/lib/module/Bracket/api/index.js.map +1 -1
- package/lib/module/Bracket/components/BracketCompetitionActions.js +525 -0
- package/lib/module/Bracket/components/BracketCompetitionActions.js.map +1 -0
- package/lib/module/Bracket/components/BracketCompetitionCard.js +4 -2
- package/lib/module/Bracket/components/BracketCompetitionCard.js.map +1 -1
- package/lib/module/Bracket/components/BracketCompetitionSelector.js +51 -26
- package/lib/module/Bracket/components/BracketCompetitionSelector.js.map +1 -1
- package/lib/module/Bracket/components/BracketHeader.js +56 -0
- package/lib/module/Bracket/components/BracketHeader.js.map +1 -0
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js +4 -0
- package/lib/module/Bracket/components/BracketPlay/BracketRound.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/RoundEvent.js +42 -21
- package/lib/module/Bracket/components/BracketPlay/RoundEvent.js.map +1 -1
- package/lib/module/Bracket/components/BracketPlay/index.js +77 -84
- package/lib/module/Bracket/components/BracketPlay/index.js.map +1 -1
- package/lib/module/Bracket/components/BracketSelector.js +11 -45
- package/lib/module/Bracket/components/BracketSelector.js.map +1 -1
- package/lib/module/Bracket/components/CompetitionLeaderboard.js +15 -23
- package/lib/module/Bracket/components/CompetitionLeaderboard.js.map +1 -1
- package/lib/module/Bracket/components/EditPlayerBracket.js +112 -0
- package/lib/module/Bracket/components/EditPlayerBracket.js.map +1 -0
- package/lib/module/Bracket/components/JoinCompetitionCard.js +54 -43
- package/lib/module/Bracket/components/JoinCompetitionCard.js.map +1 -1
- package/lib/module/Bracket/components/Navigator.js +95 -0
- package/lib/module/Bracket/components/Navigator.js.map +1 -0
- package/lib/module/Bracket/components/PlayerBalanceCard.js +13 -10
- package/lib/module/Bracket/components/PlayerBalanceCard.js.map +1 -1
- package/lib/module/Bracket/components/PlayerBracketCard.js +133 -0
- package/lib/module/Bracket/components/PlayerBracketCard.js.map +1 -0
- package/lib/module/Bracket/components/PlayerBrackets.js +64 -31
- package/lib/module/Bracket/components/PlayerBrackets.js.map +1 -1
- package/lib/module/Bracket/components/RoomHome.js +828 -0
- package/lib/module/Bracket/components/RoomHome.js.map +1 -0
- package/lib/module/Bracket/index.js +865 -283
- package/lib/module/Bracket/index.js.map +1 -1
- package/lib/module/Components/Icons.js +51 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/SearchBox.js +2 -0
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/Engage/components/BracketCompetitionCard.js +2 -0
- package/lib/module/Engage/components/BracketCompetitionCard.js.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/api/index.d.ts +11 -1
- package/lib/typescript/lib/commonjs/Bracket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts +24 -0
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionActions.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionSelector.d.ts +2 -2
- package/lib/typescript/lib/commonjs/Bracket/components/BracketCompetitionSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketHeader.d.ts +7 -0
- package/lib/typescript/lib/commonjs/Bracket/components/BracketHeader.d.ts.map +1 -0
- 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.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts +3 -4
- package/lib/typescript/lib/commonjs/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/BracketSelector.d.ts +1 -3
- package/lib/typescript/lib/commonjs/Bracket/components/BracketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/CompetitionLeaderboard.d.ts +3 -3
- package/lib/typescript/lib/commonjs/Bracket/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts +8 -0
- package/lib/typescript/lib/commonjs/Bracket/components/EditPlayerBracket.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Bracket/components/JoinCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/Navigator.d.ts +9 -0
- package/lib/typescript/lib/commonjs/Bracket/components/Navigator.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBalanceCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBracketCard.d.ts +4 -0
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBracketCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts +3 -2
- package/lib/typescript/lib/commonjs/Bracket/components/PlayerBrackets.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Bracket/components/RoomHome.d.ts +21 -0
- package/lib/typescript/lib/commonjs/Bracket/components/RoomHome.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts +5 -3
- package/lib/typescript/lib/commonjs/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +10 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/api/index.d.ts +11 -1
- package/lib/typescript/lib/module/Bracket/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts +24 -0
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionActions.d.ts.map +1 -0
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionSelector.d.ts +2 -2
- package/lib/typescript/lib/module/Bracket/components/BracketCompetitionSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketHeader.d.ts +7 -0
- package/lib/typescript/lib/module/Bracket/components/BracketHeader.d.ts.map +1 -0
- 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.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts +4 -7
- package/lib/typescript/lib/module/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/BracketSelector.d.ts +2 -6
- package/lib/typescript/lib/module/Bracket/components/BracketSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/CompetitionLeaderboard.d.ts +3 -3
- package/lib/typescript/lib/module/Bracket/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts +10 -0
- package/lib/typescript/lib/module/Bracket/components/EditPlayerBracket.d.ts.map +1 -0
- package/lib/typescript/lib/module/Bracket/components/JoinCompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Bracket/components/JoinCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/Navigator.d.ts +11 -0
- package/lib/typescript/lib/module/Bracket/components/Navigator.d.ts.map +1 -0
- package/lib/typescript/lib/module/Bracket/components/PlayerBalanceCard.d.ts +1 -2
- package/lib/typescript/lib/module/Bracket/components/PlayerBalanceCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/PlayerBracketCard.d.ts +10 -0
- package/lib/typescript/lib/module/Bracket/components/PlayerBracketCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts +4 -5
- package/lib/typescript/lib/module/Bracket/components/PlayerBrackets.d.ts.map +1 -1
- package/lib/typescript/lib/module/Bracket/components/RoomHome.d.ts +23 -0
- package/lib/typescript/lib/module/Bracket/components/RoomHome.d.ts.map +1 -0
- package/lib/typescript/lib/module/Bracket/index.d.ts +6 -4
- package/lib/typescript/lib/module/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Icons.d.ts +10 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts +2 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/api/index.d.ts +22 -3
- package/lib/typescript/src/Bracket/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts +37 -0
- package/lib/typescript/src/Bracket/components/BracketCompetitionActions.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketCompetitionSelector.d.ts +8 -2
- package/lib/typescript/src/Bracket/components/BracketCompetitionSelector.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketHeader.d.ts +15 -0
- package/lib/typescript/src/Bracket/components/BracketHeader.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/components/BracketPlay/BracketRound.d.ts +0 -4
- package/lib/typescript/src/Bracket/components/BracketPlay/BracketRound.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts +3 -7
- package/lib/typescript/src/Bracket/components/BracketPlay/index.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/BracketSelector.d.ts +1 -3
- package/lib/typescript/src/Bracket/components/BracketSelector.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/CompetitionLeaderboard.d.ts +4 -2
- package/lib/typescript/src/Bracket/components/CompetitionLeaderboard.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts +10 -0
- package/lib/typescript/src/Bracket/components/EditPlayerBracket.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/components/JoinCompetitionCard.d.ts +2 -2
- package/lib/typescript/src/Bracket/components/JoinCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/Navigator.d.ts +16 -0
- package/lib/typescript/src/Bracket/components/Navigator.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/components/PlayerBalanceCard.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/PlayerBracketCard.d.ts +16 -0
- package/lib/typescript/src/Bracket/components/PlayerBracketCard.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/components/PlayerBrackets.d.ts +4 -2
- package/lib/typescript/src/Bracket/components/PlayerBrackets.d.ts.map +1 -1
- package/lib/typescript/src/Bracket/components/RoomHome.d.ts +30 -0
- package/lib/typescript/src/Bracket/components/RoomHome.d.ts.map +1 -0
- package/lib/typescript/src/Bracket/index.d.ts +17 -3
- package/lib/typescript/src/Bracket/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +2 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/SearchBox.d.ts +7 -1
- package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Bracket/api/index.ts +83 -5
- package/src/Bracket/components/BracketCompetitionActions.tsx +360 -0
- package/src/Bracket/components/BracketCompetitionCard.tsx +4 -2
- package/src/Bracket/components/BracketCompetitionSelector.tsx +35 -15
- package/src/Bracket/components/BracketHeader.tsx +41 -0
- package/src/Bracket/components/BracketPlay/BracketRound.tsx +4 -5
- package/src/Bracket/components/BracketPlay/RoundEvent.tsx +21 -21
- package/src/Bracket/components/BracketPlay/index.tsx +57 -52
- package/src/Bracket/components/BracketSelector.tsx +16 -21
- package/src/Bracket/components/CompetitionLeaderboard.tsx +19 -22
- package/src/Bracket/components/EditPlayerBracket.tsx +81 -0
- package/src/Bracket/components/JoinCompetitionCard.tsx +46 -33
- package/src/Bracket/components/Navigator.tsx +57 -0
- package/src/Bracket/components/PlayerBalanceCard.tsx +9 -10
- package/src/Bracket/components/PlayerBracketCard.tsx +105 -0
- package/src/Bracket/components/PlayerBrackets.tsx +46 -18
- package/src/Bracket/components/RoomHome.tsx +543 -0
- package/src/Bracket/index.tsx +659 -127
- package/src/Components/Icons.tsx +30 -0
- package/src/Components/SearchBox.tsx +3 -1
- package/src/Engage/components/BracketCompetitionCard.tsx +2 -2
- package/src/types.d.ts +1 -0
- package/lib/commonjs/Bracket/components/RoomMenu.js +0 -120
- package/lib/commonjs/Bracket/components/RoomMenu.js.map +0 -1
- package/lib/module/Bracket/components/RoomMenu.js +0 -113
- package/lib/module/Bracket/components/RoomMenu.js.map +0 -1
- package/lib/typescript/lib/commonjs/Bracket/components/RoomMenu.d.ts +0 -8
- package/lib/typescript/lib/commonjs/Bracket/components/RoomMenu.d.ts.map +0 -1
- package/lib/typescript/lib/module/Bracket/components/RoomMenu.d.ts +0 -10
- package/lib/typescript/lib/module/Bracket/components/RoomMenu.d.ts.map +0 -1
- package/lib/typescript/src/Bracket/components/RoomMenu.d.ts +0 -14
- package/lib/typescript/src/Bracket/components/RoomMenu.d.ts.map +0 -1
- package/src/Bracket/components/RoomMenu.tsx +0 -69
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Image, Linking } from "react-native";
|
|
3
|
+
import { Checkbox } from '../../Components';
|
|
4
4
|
import type { BracketCompetitionProps, CompetitionPlayerBracketProps, MyPlayerProps, PlayerBalanceProps, PlayerBracketProps } from '../../types';
|
|
5
|
-
import { BracketCompetitionHelpers } from '../api';
|
|
6
|
-
import Colors from '../../constants/colors';
|
|
5
|
+
import { BracketComeptitionApi, BracketCompetitionHelpers } from '../api';
|
|
7
6
|
import PlayerBalanceCard from './PlayerBalanceCard';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
8
8
|
|
|
9
9
|
type JoinCompetitionCardProps = {
|
|
10
10
|
player?:MyPlayerProps,
|
|
11
11
|
loading?:boolean,
|
|
12
|
-
player_bracket
|
|
12
|
+
player_bracket?:PlayerBracketProps,
|
|
13
13
|
player_balance?:PlayerBalanceProps,
|
|
14
14
|
bracket_competition:BracketCompetitionProps,
|
|
15
15
|
onNotEnoughBalance:(data:{ bracket_competition:BracketCompetitionProps }) => void,
|
|
16
|
-
onEnterCompetition:(cpb:CompetitionPlayerBracketProps) => void,
|
|
16
|
+
onEnterCompetition:(cpb:CompetitionPlayerBracketProps, player_bracket?:PlayerBracketProps) => void,
|
|
17
17
|
onClose:() => void
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,26 +22,34 @@ const JoinCompetitionCard = ({ player, player_balance, loading, player_bracket,
|
|
|
22
22
|
|
|
23
23
|
const buy_in_label = BracketCompetitionHelpers.getBuyInTitle(bracket_competition)
|
|
24
24
|
|
|
25
|
-
const handleEnter = () => {
|
|
25
|
+
const handleEnter = async() => {
|
|
26
|
+
if(!player){ return }
|
|
27
|
+
let player_bracket_id = player_bracket?.player_bracket_id
|
|
28
|
+
let new_pb:PlayerBracketProps | undefined = undefined
|
|
29
|
+
if(!player_bracket_id){
|
|
30
|
+
new_pb = await BracketComeptitionApi.createPlayerBracket({
|
|
31
|
+
player_bracket_id: '',
|
|
32
|
+
player_id: '',
|
|
33
|
+
bracket_name: `${player.username} Bracket ${Math.floor(Math.random() * (100 - 1 + 1) + 1)}`,
|
|
34
|
+
create_datetime: '', last_update_datetime: '',
|
|
35
|
+
bracket_id: bracket_competition.bracket_id,
|
|
36
|
+
completion_pct: 0,
|
|
37
|
+
completion_status: 'inprogress',
|
|
38
|
+
status: 'active'
|
|
39
|
+
})
|
|
40
|
+
player_bracket_id = new_pb.player_bracket_id
|
|
41
|
+
}
|
|
26
42
|
const is_enough_balance = BracketCompetitionHelpers.isEnoughBalance(bracket_competition, player_balance);
|
|
27
43
|
if(!is_enough_balance){ return onNotEnoughBalance({ bracket_competition }) }
|
|
28
|
-
const cpb = BracketCompetitionHelpers.generateCompetitionPlayerBracket(bracket_competition.bracket_competition_id,
|
|
29
|
-
onEnterCompetition(cpb)
|
|
44
|
+
const cpb = BracketCompetitionHelpers.generateCompetitionPlayerBracket(bracket_competition.bracket_competition_id, player_bracket_id)
|
|
45
|
+
onEnterCompetition(cpb, new_pb)
|
|
30
46
|
}
|
|
31
47
|
|
|
32
48
|
return (
|
|
33
|
-
<View style={{
|
|
34
|
-
<View style={{ borderTopRightRadius:8, borderTopLeftRadius:8,
|
|
35
|
-
<Text size={16}
|
|
49
|
+
<View float style={{ borderRadius:8 }}>
|
|
50
|
+
<View type='header' style={{ borderTopRightRadius:8, borderTopLeftRadius:8, padding:15 }}>
|
|
51
|
+
<Text size={16} theme='h1'>{bracket_competition.competition_name}</Text>
|
|
36
52
|
</View>
|
|
37
|
-
{player && player_balance ?
|
|
38
|
-
<View style={{ padding:5, backgroundColor:Colors.incentive.gold_faded }}>
|
|
39
|
-
<PlayerBalanceCard
|
|
40
|
-
player={player}
|
|
41
|
-
player_balance={player_balance}
|
|
42
|
-
/>
|
|
43
|
-
</View>
|
|
44
|
-
:<></>}
|
|
45
53
|
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
46
54
|
<Image
|
|
47
55
|
source={{ uri: bracket_competition.image?.url }}
|
|
@@ -51,24 +59,31 @@ const JoinCompetitionCard = ({ player, player_balance, loading, player_bracket,
|
|
|
51
59
|
</View>
|
|
52
60
|
<View style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
53
61
|
<View style={{ flex:1 }}>
|
|
54
|
-
<Text size={14}
|
|
55
|
-
|
|
62
|
+
<Text size={14} theme='h1'>{player_bracket?.bracket_name ?? 'New Bracket'}</Text>
|
|
63
|
+
{player_bracket ?
|
|
64
|
+
<Text style={{ marginTop:3 }} size={12} theme='light'>{(player_bracket.completion_pct*100).toFixed(2)}% Complete</Text>
|
|
65
|
+
:<></>}
|
|
56
66
|
</View>
|
|
57
67
|
</View>
|
|
58
68
|
{bracket_competition.opt_in_url ?
|
|
59
|
-
<
|
|
69
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:20 }} onPress={() => setDisclaimed(!disclaimed)}>
|
|
60
70
|
<Checkbox size={24} checked={disclaimed} disabled onSelect={() => console.log('')}/>
|
|
61
|
-
<Text
|
|
62
|
-
</
|
|
71
|
+
<Text theme='description' size={14} style={{ flex:1, marginLeft:10 }}>I agree to the terms and conditiions outlined <Button style={{ padding:0 }} onPress={() => Linking.openURL(bracket_competition.opt_in_url??'')}><Text size={14} theme='action'>HERE</Text></Button></Text>
|
|
72
|
+
</Button>
|
|
73
|
+
:<></>}
|
|
74
|
+
{player && player_balance ?
|
|
75
|
+
<View type='header' style={{ padding:5, marginBottom:1}}>
|
|
76
|
+
<PlayerBalanceCard
|
|
77
|
+
player={player}
|
|
78
|
+
player_balance={player_balance}
|
|
79
|
+
/>
|
|
80
|
+
</View>
|
|
63
81
|
:<></>}
|
|
64
|
-
<View style={{ flexDirection:'row', alignItems:'center', padding:10,
|
|
82
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
65
83
|
<Button
|
|
66
84
|
title='Close'
|
|
67
85
|
style={{ flex:1, marginRight:5 }}
|
|
68
|
-
|
|
69
|
-
title_color={Colors.brand.electric}
|
|
70
|
-
borderWidth={1}
|
|
71
|
-
borderColor={Colors.brand.electric}
|
|
86
|
+
type='close'
|
|
72
87
|
onPress={() => onClose()}
|
|
73
88
|
/>
|
|
74
89
|
<Button
|
|
@@ -76,9 +91,7 @@ const JoinCompetitionCard = ({ player, player_balance, loading, player_bracket,
|
|
|
76
91
|
disabled={loading || !disclaimed}
|
|
77
92
|
style={{ flex:2, opacity: !disclaimed||loading?0.5:1 }}
|
|
78
93
|
loading={loading}
|
|
79
|
-
|
|
80
|
-
title_color={Colors.shades.white}
|
|
81
|
-
backgroundColor={Colors.utility.success}
|
|
94
|
+
type='success'
|
|
82
95
|
onPress={() => handleEnter()}
|
|
83
96
|
|
|
84
97
|
/>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FlatList } from 'react-native';
|
|
3
|
+
import { Icons } from '../../Components';
|
|
4
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
5
|
+
import { useColors } from '../../constants/useColors';
|
|
6
|
+
|
|
7
|
+
type OptionType = { key:string, label:string, description: string, icon:any }
|
|
8
|
+
|
|
9
|
+
type NavigatorProps = {
|
|
10
|
+
visible: boolean,
|
|
11
|
+
mode: 'large'|'small'|'medium',
|
|
12
|
+
active_option?:string,
|
|
13
|
+
onOptionSelect:(option:OptionType) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Navigator = ({ visible, mode, active_option, onOptionSelect }: NavigatorProps ) => {
|
|
17
|
+
const Colors = useColors();
|
|
18
|
+
|
|
19
|
+
const options:OptionType[] = [
|
|
20
|
+
{ key: 'home', label: 'My Bracket Room', description: 'View all my filled out brackets', icon: <Icons.UserIcon size={18} color={active_option == 'home' ? Colors.text.h1 : Colors.text.highlight} />},
|
|
21
|
+
{ key: 'competitions', label: 'Bracket Competitions', description: 'View all bracket competitions', icon: <Icons.TrophyIcon size={18} color={active_option == 'competitions' ? Colors.text.h1 : Colors.text.highlight} /> },
|
|
22
|
+
{ key: 'brackets', label: 'Active League Brackets', description: 'View all brackets that are currently active', icon: <Icons.BracketIcon size={18} color={active_option == 'brackets' ? Colors.text.h1 : Colors.text.highlight} /> }
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const renderOptions = (data: { item:OptionType, index:number }) => {
|
|
27
|
+
const active = active_option == data.item.key ? true : false
|
|
28
|
+
return (
|
|
29
|
+
<Button float style={{ flexDirection:'row', padding:10, alignItems:'center', backgroundColor:active?Colors.text.highlight:Colors.views.header, margin:4 }}
|
|
30
|
+
onPress={() => onOptionSelect(data.item)}>
|
|
31
|
+
{data.item.icon}
|
|
32
|
+
{mode == 'large' ?
|
|
33
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
34
|
+
<Text size={14} theme='h1' weight='bold' color={active_option == data.item.key ? Colors.text.h1 : Colors.text.highlight}>{data.item.label}</Text>
|
|
35
|
+
<Text style={{ marginTop:3 }} size={10} theme='description' color={active_option == data.item.key ? Colors.text.h1 : Colors.text.highlight}>{data.item.description}</Text>
|
|
36
|
+
</View>
|
|
37
|
+
:<View style={{flex:1}} />}
|
|
38
|
+
<Icons.ChevronIcon direction='right' color={active_option == data.item.key ? Colors.text.h1 : Colors.text.highlight} size={12} />
|
|
39
|
+
</Button>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if(!visible){ return <></> }
|
|
44
|
+
return (
|
|
45
|
+
<View transparent>
|
|
46
|
+
<View transparent style={{ padding:10 }}>
|
|
47
|
+
<FlatList
|
|
48
|
+
data={options}
|
|
49
|
+
renderItem={renderOptions}
|
|
50
|
+
keyExtractor={(item) => item.key}
|
|
51
|
+
/>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default Navigator
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image
|
|
2
|
+
import { Image } from "react-native"
|
|
3
3
|
import type { MyPlayerProps, PlayerBalanceProps } from "../../types"
|
|
4
|
-
import
|
|
5
|
-
import { Text } from '../../Components';
|
|
4
|
+
import { Text, View } from '../../Components/Themed';
|
|
6
5
|
|
|
7
6
|
type PlayerBalanceCardProps = {
|
|
8
7
|
player_balance:PlayerBalanceProps,
|
|
@@ -12,20 +11,20 @@ type PlayerBalanceCardProps = {
|
|
|
12
11
|
const PlayerBalanceCard = ({ player, player_balance }:PlayerBalanceCardProps) => {
|
|
13
12
|
|
|
14
13
|
return (
|
|
15
|
-
<View style={{ flexDirection:'row', alignItems:'center' }}>
|
|
16
|
-
<View>
|
|
14
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center' }}>
|
|
15
|
+
<View transparent>
|
|
17
16
|
<Image
|
|
18
17
|
source={{ uri: player.profile_pic }}
|
|
19
18
|
style={{ height:35, width:35, borderRadius:100 }}
|
|
20
19
|
resizeMode='cover'
|
|
21
20
|
/>
|
|
22
21
|
</View>
|
|
23
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
24
|
-
<Text size={14}
|
|
25
|
-
<Text style={{ marginTop:3 }} size={12}
|
|
22
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
23
|
+
<Text size={14} theme='h1'>{player.first_name} {player.last_name}</Text>
|
|
24
|
+
<Text style={{ marginTop:3 }} size={12} theme='light'>P{player_balance.promo_balance.toFixed(2)} - E{player_balance.free_market_balance.toFixed(2)}</Text>
|
|
26
25
|
</View>
|
|
27
|
-
<View>
|
|
28
|
-
<Text size={14}
|
|
26
|
+
<View transparent>
|
|
27
|
+
<Text size={14} theme='h1'>${player_balance.balance.toFixed(2)}</Text>
|
|
29
28
|
</View>
|
|
30
29
|
</View>
|
|
31
30
|
)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Image } from "react-native";
|
|
2
|
+
import { Button, Text, View } from "../../Components/Themed";
|
|
3
|
+
import type { AthleteProps, BracketCompetitionProps, BracketProps, CompetitionPlayerBracketProps, LeagueProps, PlayerBracketProps, TeamProps } from "../../types"
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Icons } from "../../Components";
|
|
6
|
+
import { useColors } from "../../constants/useColors";
|
|
7
|
+
|
|
8
|
+
type PlayerBracketCardProps = {
|
|
9
|
+
league?:LeagueProps,
|
|
10
|
+
bracket:BracketProps,
|
|
11
|
+
champion_team?:TeamProps,
|
|
12
|
+
champion_athlete?:AthleteProps,
|
|
13
|
+
onEdit: (player_bracket:PlayerBracketProps) => void,
|
|
14
|
+
onView: (bracket_id:string, player_bracket_id?:string, bracket_competition_id?:string) => void,
|
|
15
|
+
bracket_competitions:BracketCompetitionProps[],
|
|
16
|
+
player_bracket:PlayerBracketProps,
|
|
17
|
+
competition_player_brackets:CompetitionPlayerBracketProps[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const PlayerBracketCard = ({ onEdit, champion_team, onView, player_bracket, bracket }:PlayerBracketCardProps) => {
|
|
21
|
+
const Colors = useColors();
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
//const cl = bracket_competition.market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
25
|
+
return (
|
|
26
|
+
<View type='row' style={{ flex:1 }}>
|
|
27
|
+
{player_bracket.champion_id ?
|
|
28
|
+
<View style={{ borderBottomLeftRadius:8, borderRightWidth:1, borderColor:Colors.borders.light }}>
|
|
29
|
+
{champion_team ?
|
|
30
|
+
<View transparent style={{ flex:1, padding:10, justifyContent:'space-between' }}>
|
|
31
|
+
<Image
|
|
32
|
+
source={{ uri: champion_team.image?.url }}
|
|
33
|
+
style={{ height:30, width:30 }}
|
|
34
|
+
resizeMode='cover'
|
|
35
|
+
/>
|
|
36
|
+
<Text theme="description" textAlign="center">{champion_team.abbr}</Text>
|
|
37
|
+
</View>
|
|
38
|
+
:<></>}
|
|
39
|
+
</View>
|
|
40
|
+
:
|
|
41
|
+
<View style={{ borderBottomLeftRadius:8, borderRightWidth:1, borderColor:Colors.borders.light }}>
|
|
42
|
+
<View transparent style={{ flex:1, padding:10, justifyContent:'space-between' }}>
|
|
43
|
+
<Icons.BracketIcon size={16} color={Colors.text.h1} />
|
|
44
|
+
<Text theme="h1" textAlign="center">...</Text>
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
}
|
|
48
|
+
<View style={{ flex:1, marginLeft:8, marginRight:8 }}>
|
|
49
|
+
<Text theme="h1">{player_bracket.bracket_name}</Text>
|
|
50
|
+
<Text style={{ marginTop:4 }} theme="description">{(player_bracket.completion_pct * 100).toFixed(2)}%</Text>
|
|
51
|
+
</View>
|
|
52
|
+
{player_bracket.status != 'closed' ?
|
|
53
|
+
<Button
|
|
54
|
+
type='text'
|
|
55
|
+
style={{ padding:10, marginRight:5 }}
|
|
56
|
+
onPress={() => onEdit(player_bracket)}
|
|
57
|
+
>
|
|
58
|
+
<Icons.EditIcon size={14} color={Colors.text.action} />
|
|
59
|
+
</Button>
|
|
60
|
+
:<></>}
|
|
61
|
+
<Button
|
|
62
|
+
title="VIEW"
|
|
63
|
+
type='text'
|
|
64
|
+
style={{ padding:10 }}
|
|
65
|
+
onPress={() => onView( bracket.bracket_id, player_bracket.player_bracket_id)}
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default React.memo(PlayerBracketCard, (left, right) => {
|
|
72
|
+
if(JSON.stringify(left) != JSON.stringify(right)){return false }
|
|
73
|
+
return true
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
79
|
+
{league ?
|
|
80
|
+
<Image
|
|
81
|
+
source={{ uri: league?.league_image }}
|
|
82
|
+
style={{ height:40, width:40 }}
|
|
83
|
+
resizeMode="cover"
|
|
84
|
+
/>
|
|
85
|
+
:
|
|
86
|
+
<></>
|
|
87
|
+
}
|
|
88
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
89
|
+
<Text theme="h1">{player_bracket.bracket_name}</Text>
|
|
90
|
+
<Text style={{ marginTop:3 }} theme="description">{bracket.bracket_name}</Text>
|
|
91
|
+
</View>
|
|
92
|
+
<Button
|
|
93
|
+
type='text'
|
|
94
|
+
title="EDIT"
|
|
95
|
+
style={{ padding:10, marginRight:5 }}
|
|
96
|
+
onPress={() => onEdit(player_bracket)}
|
|
97
|
+
/>
|
|
98
|
+
<Button
|
|
99
|
+
title="VIEW"
|
|
100
|
+
style={{ padding:10 }}
|
|
101
|
+
type='action'
|
|
102
|
+
onPress={() => onView( bracket.bracket_id, player_bracket.player_bracket_id)}
|
|
103
|
+
/>
|
|
104
|
+
</View>
|
|
105
|
+
*/
|
|
@@ -1,37 +1,48 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FlatList, Image
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { FlatList, Image } from "react-native"
|
|
3
3
|
import type { AthleteProps, BracketCompetitionProps, BracketProps, CompetitionPlayerBracketProps, LeagueProps, PlayerBracketProps, TeamProps } from '../../types';
|
|
4
|
-
import { Icons } from '../../Components';
|
|
5
4
|
import moment from 'moment-mini';
|
|
6
5
|
import { Button, Text, View } from '../../Components/Themed';
|
|
7
6
|
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { BracketComeptitionApi, BracketCompetitionHelpers } from '../api';
|
|
8
8
|
|
|
9
9
|
type PlayerBracketSelectorProps = {
|
|
10
|
-
visible:boolean,
|
|
11
10
|
brackets:BracketProps[],
|
|
11
|
+
player_id?:string,
|
|
12
|
+
bracket_id?:string,
|
|
12
13
|
leagues:LeagueProps[],
|
|
13
14
|
teams:TeamProps[],
|
|
14
15
|
athletes:AthleteProps[],
|
|
15
16
|
player_brackets:PlayerBracketProps[],
|
|
16
17
|
bracket_competitions:BracketCompetitionProps[],
|
|
17
18
|
competition_player_brackets:CompetitionPlayerBracketProps[]
|
|
19
|
+
onCreateNew?:(pb:PlayerBracketProps) => void,
|
|
18
20
|
onClose:() => void,
|
|
19
21
|
onSelect:(pb:PlayerBracketProps) => void,
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
const PlayerBracketSelector = ({
|
|
24
|
+
const PlayerBracketSelector = ({ brackets, bracket_id, leagues, teams, athletes, player_brackets, onSelect, onClose, onCreateNew }:PlayerBracketSelectorProps) => {
|
|
23
25
|
const Colors = useColors();
|
|
24
|
-
|
|
26
|
+
const [ action_loading, setActionLoading ] = useState(false);
|
|
25
27
|
const active_brackets = player_brackets.filter(pb => pb.status == 'active');
|
|
26
28
|
|
|
27
29
|
const unique_bracket_ids = [ ...new Set(active_brackets.map(b => b.bracket_id)) ]
|
|
28
30
|
|
|
31
|
+
const handleCreateNew = async() => {
|
|
32
|
+
if(!bracket_id || !onCreateNew){ return }
|
|
33
|
+
if(action_loading){ return }
|
|
34
|
+
setActionLoading(true);
|
|
35
|
+
let new_pb = BracketCompetitionHelpers.createEmptyPlayerBracket('', bracket_id);
|
|
36
|
+
new_pb = await BracketComeptitionApi.createPlayerBracket(new_pb);
|
|
37
|
+
onCreateNew(new_pb);
|
|
38
|
+
setActionLoading(false);
|
|
39
|
+
}
|
|
29
40
|
|
|
30
41
|
const renderPlayerBrackets = (data : { item:PlayerBracketProps, index:number }) => {
|
|
31
42
|
const champion_team = data.item.champion_id_type == 'team' ? teams.find(t => t.team_id == data.item.champion_id) : undefined
|
|
32
43
|
const champion_athlete = data.item.champion_id_type == 'athlete' ? athletes.find(t => t.team_id == data.item.champion_id) : undefined
|
|
33
44
|
return (
|
|
34
|
-
<Button style={{ padding:10, flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.borders.light }} onPress={() => onSelect(data.item)}>
|
|
45
|
+
<Button transparent style={{ padding:10, flexDirection:'row', alignItems:'center', borderRadius:0, borderBottomWidth:1, borderColor:Colors.borders.light }} onPress={() => onSelect(data.item)}>
|
|
35
46
|
{champion_team ?
|
|
36
47
|
<View transparent style={{ marginRight:5 }}>
|
|
37
48
|
<Image
|
|
@@ -55,7 +66,8 @@ const PlayerBracketSelector = ({ visible, brackets, leagues, teams, athletes, pl
|
|
|
55
66
|
</View>
|
|
56
67
|
<Button
|
|
57
68
|
title='VIEW'
|
|
58
|
-
type='
|
|
69
|
+
type='action'
|
|
70
|
+
style={{ padding:10 }}
|
|
59
71
|
disabled
|
|
60
72
|
onPress={() => console.log('')}
|
|
61
73
|
/>
|
|
@@ -95,24 +107,40 @@ const PlayerBracketSelector = ({ visible, brackets, leagues, teams, athletes, pl
|
|
|
95
107
|
)
|
|
96
108
|
}
|
|
97
109
|
|
|
98
|
-
if(!visible){ return <></> }
|
|
99
110
|
|
|
100
111
|
return (
|
|
101
|
-
<View style={{ flex:1 }}>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
<Text size={18} theme='h1' weight='bold'>My Brackets</Text>
|
|
106
|
-
<Text style={{ marginTop:4 }} size={14} theme='light' weight='regular'>Select a filled bracket below to manage it</Text>
|
|
112
|
+
<View transparent style={{ flex:1 }}>
|
|
113
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
114
|
+
<View transparent style={{ flex:1 }}>
|
|
115
|
+
<Text theme='h1'>My Brackets</Text>
|
|
107
116
|
</View>
|
|
108
|
-
|
|
109
|
-
|
|
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={{ marginTop:1 }}>
|
|
110
130
|
<FlatList
|
|
111
131
|
data={unique_bracket_ids}
|
|
112
132
|
renderItem={renderBrackets}
|
|
113
133
|
keyExtractor={(item) => item.toString()}
|
|
114
134
|
/>
|
|
115
|
-
</
|
|
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
|
+
</View>
|
|
116
144
|
</View>
|
|
117
145
|
)
|
|
118
146
|
}
|