be-components 1.2.7 → 1.2.8
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/Competition/components/CompetitionCard.js +1 -1
- package/lib/commonjs/Competition/components/CompetitionCard.js.map +1 -1
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js +1 -1
- package/lib/commonjs/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/commonjs/CompetitionManager/api/index.js +577 -0
- package/lib/commonjs/CompetitionManager/api/index.js.map +1 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +439 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +269 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js +142 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +370 -0
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -0
- package/lib/commonjs/CompetitionManager/components/MarketSelector.js +99 -0
- package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -0
- package/lib/commonjs/CompetitionManager/index.js +188 -0
- package/lib/commonjs/CompetitionManager/index.js.map +1 -0
- package/lib/commonjs/Components/Dropdown.js +98 -0
- package/lib/commonjs/Components/Dropdown.js.map +1 -0
- package/lib/commonjs/Components/Icons.js +1 -1
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Markets/api/index.js +28 -0
- package/lib/commonjs/Markets/api/index.js.map +1 -0
- package/lib/commonjs/Markets/components/MarketButton.js +25 -0
- package/lib/commonjs/Markets/components/MarketButton.js.map +1 -0
- package/lib/commonjs/Squares/api/index.js.map +1 -1
- package/lib/commonjs/Squares/components/PrizeCard.js +161 -0
- package/lib/commonjs/Squares/components/PrizeCard.js.map +1 -0
- package/lib/commonjs/Squares/components/SquareCard.js.map +1 -1
- package/lib/commonjs/Squares/index.js +10 -1
- package/lib/commonjs/Squares/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +10 -0
- package/lib/commonjs/constants/styles.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Competition/components/CompetitionCard.js +1 -1
- package/lib/module/Competition/components/CompetitionCard.js.map +1 -1
- package/lib/module/Competition/components/EnterCompetitionPrompt.js +1 -1
- package/lib/module/Competition/components/EnterCompetitionPrompt.js.map +1 -1
- package/lib/module/CompetitionManager/api/index.js +571 -0
- package/lib/module/CompetitionManager/api/index.js.map +1 -0
- package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +434 -0
- package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -0
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +262 -0
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -0
- package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js +135 -0
- package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -0
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +364 -0
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -0
- package/lib/module/CompetitionManager/components/MarketSelector.js +92 -0
- package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -0
- package/lib/module/CompetitionManager/index.js +179 -0
- package/lib/module/CompetitionManager/index.js.map +1 -0
- package/lib/module/Components/Dropdown.js +89 -0
- package/lib/module/Components/Dropdown.js.map +1 -0
- package/lib/module/Components/Icons.js +1 -1
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Markets/api/index.js +23 -0
- package/lib/module/Markets/api/index.js.map +1 -0
- package/lib/module/Markets/components/MarketButton.js +18 -0
- package/lib/module/Markets/components/MarketButton.js.map +1 -0
- package/lib/module/Squares/api/index.js.map +1 -1
- package/lib/module/Squares/components/PrizeCard.js +152 -0
- package/lib/module/Squares/components/PrizeCard.js.map +1 -0
- package/lib/module/Squares/components/SquareCard.js.map +1 -1
- package/lib/module/Squares/index.js +10 -1
- package/lib/module/Squares/index.js.map +1 -1
- package/lib/module/constants/styles.js +10 -0
- package/lib/module/constants/styles.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/CompetitionManager/api/index.d.ts +109 -0
- package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +23 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +10 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts +17 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +13 -0
- package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts +13 -0
- package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionManager/index.d.ts +8 -0
- package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -0
- package/lib/typescript/src/Components/Dropdown.d.ts +15 -0
- package/lib/typescript/src/Components/Dropdown.d.ts.map +1 -0
- package/lib/typescript/src/Markets/api/index.d.ts +7 -0
- package/lib/typescript/src/Markets/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Markets/components/MarketButton.d.ts +11 -0
- package/lib/typescript/src/Markets/components/MarketButton.d.ts.map +1 -0
- package/lib/typescript/src/Squares/api/index.d.ts +2 -1
- package/lib/typescript/src/Squares/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Squares/components/PrizeCard.d.ts +11 -0
- package/lib/typescript/src/Squares/components/PrizeCard.d.ts.map +1 -0
- package/lib/typescript/src/Squares/components/SquareCard.d.ts.map +1 -1
- package/lib/typescript/src/Squares/index.d.ts.map +1 -1
- package/lib/typescript/src/constants/styles.d.ts +10 -0
- package/lib/typescript/src/constants/styles.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/components/CompetitionCard.tsx +1 -1
- package/src/Competition/components/EnterCompetitionPrompt.tsx +2 -2
- package/src/CompetitionManager/api/index.ts +484 -0
- package/src/CompetitionManager/components/CompetitionContestsForm.tsx +473 -0
- package/src/CompetitionManager/components/CompetitionInfoForm.tsx +171 -0
- package/src/CompetitionManager/components/CompetitionMatchMarketCard.tsx +155 -0
- package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +229 -0
- package/src/CompetitionManager/components/MarketSelector.tsx +66 -0
- package/src/CompetitionManager/index.tsx +163 -0
- package/src/Components/Dropdown.tsx +78 -0
- package/src/Components/Icons.tsx +1 -1
- package/src/Markets/api/index.ts +18 -0
- package/src/Markets/components/MarketButton.tsx +24 -0
- package/src/Squares/api/index.ts +2 -2
- package/src/Squares/components/PrizeCard.tsx +90 -0
- package/src/Squares/components/SquareCard.tsx +0 -1
- package/src/Squares/index.tsx +12 -2
- package/src/constants/styles.ts +5 -0
- package/src/index.tsx +2 -0
- package/src/types.d.ts +26 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { View, TouchableOpacity, FlatList } from 'react-native';
|
|
3
|
+
import Text from './Text';
|
|
4
|
+
import Colors from '../constants/colors';
|
|
5
|
+
import Icons from './Icons';
|
|
6
|
+
|
|
7
|
+
type DropdownProps = {
|
|
8
|
+
selected_value:string,
|
|
9
|
+
invalid?: boolean,
|
|
10
|
+
errors?:string[],
|
|
11
|
+
dropdown_options: { value:string, eligible_options: string[] }[]
|
|
12
|
+
read_only?:boolean
|
|
13
|
+
onOptionSelect: (option:string) => void
|
|
14
|
+
}
|
|
15
|
+
const DropDown = ({ invalid, errors, read_only, selected_value, dropdown_options, onOptionSelect }:DropdownProps) => {
|
|
16
|
+
const [ expanded, setExpanded ] = useState(false);
|
|
17
|
+
let options:string[] = []
|
|
18
|
+
|
|
19
|
+
dropdown_options.map(o => {
|
|
20
|
+
options = options.concat(o.eligible_options)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const handleOptionSelect = (option:string) => {
|
|
24
|
+
setExpanded(false);
|
|
25
|
+
onOptionSelect(option)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const renderErrors = (data : { item:string, index:number }) => {
|
|
30
|
+
return (
|
|
31
|
+
<Text style={{ margin:4 }} size={12} color={Colors.utility.error} weight='regular'>{data.item}</Text>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const renderOptions = (data: { item: string, index:number }) => {
|
|
37
|
+
const last_item = data.index == options.length - 1 ? true : false
|
|
38
|
+
return (
|
|
39
|
+
<TouchableOpacity style={{ paddingTop:10, paddingBottom:last_item?0:10, borderBottomWidth:last_item?0:1, borderColor:Colors.shades.shade600 }} onPress={() => handleOptionSelect(data.item)}>
|
|
40
|
+
<Text size={14} weight='regular' color={Colors.brand.midnight}>{data.item}</Text>
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<View>
|
|
47
|
+
<View style={{ borderRadius:8, borderWidth:1, borderColor:invalid?Colors.utility.error:Colors.shades.shade100, backgroundColor:Colors.shades.white }}>
|
|
48
|
+
<TouchableOpacity disabled={read_only} style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => setExpanded(!expanded)}>
|
|
49
|
+
<Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight="semibold">{ selected_value ?? 'Select Value'}</Text>
|
|
50
|
+
{!read_only ?
|
|
51
|
+
<Icons.ChevronIcon
|
|
52
|
+
direction={expanded?'up':'down'}
|
|
53
|
+
color={Colors.brand.midnight}
|
|
54
|
+
size={8}
|
|
55
|
+
/>
|
|
56
|
+
:<></>}
|
|
57
|
+
</TouchableOpacity>
|
|
58
|
+
{expanded ?
|
|
59
|
+
<View style={{padding:10 }}>
|
|
60
|
+
<FlatList
|
|
61
|
+
data={options}
|
|
62
|
+
renderItem={renderOptions}
|
|
63
|
+
/>
|
|
64
|
+
</View>
|
|
65
|
+
:<></>}
|
|
66
|
+
</View>
|
|
67
|
+
{invalid && errors && errors.length > 0 ?
|
|
68
|
+
<FlatList
|
|
69
|
+
data={errors}
|
|
70
|
+
renderItem={renderErrors}
|
|
71
|
+
keyExtractor={(item) => item}
|
|
72
|
+
/>
|
|
73
|
+
:<></>}
|
|
74
|
+
</View>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default DropDown
|
package/src/Components/Icons.tsx
CHANGED
|
@@ -46,7 +46,7 @@ const UnbidSquare = ({ color, secondary_color }:IconProps) => {
|
|
|
46
46
|
</mask>
|
|
47
47
|
<g mask="url(#mask0_720_125)">
|
|
48
48
|
<rect y="0.5" width="50" height="50" rx="5.67771" fill={color??Colors.brand.midnight}/>
|
|
49
|
-
<rect x="-50.6396" y="53.9214" width="72.8366" height="71.825" transform="rotate(-45 -50.6396 53.9214)" fill={secondary_color
|
|
49
|
+
<rect x="-50.6396" y="53.9214" width="72.8366" height="71.825" transform="rotate(-45 -50.6396 53.9214)" fill={secondary_color}/>
|
|
50
50
|
<rect x="0.300451" y="0.800451" width="49.3991" height="49.3991" rx="5.37725" stroke="#FCFCFC" stroke-width="0.600902"/>
|
|
51
51
|
<rect x="-2.30176" y="0.5" width="52.9414" height="50.256" fill={secondary_color??Colors.brand.cyan} fill-opacity="0.4"/>
|
|
52
52
|
<path d="M14.0734 29V18.4516H18.1562C19.3411 18.4516 20.2213 18.7049 20.7965 19.2115C21.3718 19.7095 21.6595 20.4007 21.6595 21.2851C21.6595 21.7574 21.5478 22.1781 21.3246 22.5473C21.1099 22.908 20.8266 23.1913 20.4746 23.3974C20.8695 23.5605 21.2259 23.8568 21.5436 24.2861C21.8613 24.7068 22.0201 25.2306 22.0201 25.8574C22.0201 26.7761 21.7239 27.5317 21.1314 28.1242C20.5389 28.7081 19.7189 29 18.6714 29H14.0734ZM16.2114 27.1711H18.3623C18.7401 27.1711 19.0707 27.0595 19.354 26.8362C19.646 26.613 19.7919 26.2867 19.7919 25.8574C19.7919 25.4624 19.6631 25.1361 19.4055 24.8785C19.1565 24.6124 18.7916 24.4793 18.3108 24.4793H16.2114V27.1711ZM16.2114 22.6761H17.9888C18.4267 22.6761 18.7744 22.5731 19.032 22.367C19.2982 22.1609 19.4313 21.8561 19.4313 21.4526C19.4313 20.6798 18.9633 20.2934 18.0274 20.2934H16.2114V22.6761ZM23.5399 29V18.4516H25.6779V29H23.5399ZM27.7 29V18.4516H30.9972C32.6372 18.4516 33.8865 18.911 34.7451 19.8297C35.6038 20.7399 36.0331 22.0364 36.0331 23.7194C36.0331 24.2603 35.9859 24.7669 35.8914 25.2392C35.8055 25.7114 35.6424 26.1837 35.402 26.6559C35.1702 27.1282 34.8696 27.5317 34.5004 27.8666C34.1398 28.2015 33.659 28.4762 33.0579 28.6909C32.4569 28.897 31.7699 29 30.9972 29H27.7ZM29.838 27.1969H30.7911C31.7957 27.1969 32.547 26.9221 33.045 26.3726C33.543 25.823 33.792 24.9386 33.792 23.7194C33.792 22.4658 33.5344 21.5771 33.0193 21.0533C32.5041 20.5295 31.7699 20.2676 30.8169 20.2676H29.838V27.1969Z" fill="white"/>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MarketProps } from "../../types"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export { MarketHelpers }
|
|
5
|
+
|
|
6
|
+
const MarketHelpers = {
|
|
7
|
+
getVar1Label: (market:MarketProps, var_1:number) => {
|
|
8
|
+
if(market.type != 'Spread'){ return `${var_1}` }
|
|
9
|
+
if(var_1 < 0){ return `${var_1}` }
|
|
10
|
+
return `+${var_1}`
|
|
11
|
+
},
|
|
12
|
+
getOddsLabel: (odds:number, decimals?:number) => {
|
|
13
|
+
let new_odds = odds.toFixed()
|
|
14
|
+
if(decimals){ new_odds = odds.toFixed(decimals) }
|
|
15
|
+
if(odds < 0){ return `${new_odds}` }
|
|
16
|
+
return `+${new_odds}`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacity } from "react-native"
|
|
3
|
+
import Text from '../../Components/Text';
|
|
4
|
+
import type { BestAvailableOrderProps, MarketProps, MarketSideOptionProps, TradeProps } from '../../types';
|
|
5
|
+
import { MarketHelpers } from '../api';
|
|
6
|
+
|
|
7
|
+
type MarketButtonProps = {
|
|
8
|
+
market:MarketProps,
|
|
9
|
+
side_option:MarketSideOptionProps,
|
|
10
|
+
trade?:TradeProps,
|
|
11
|
+
order?:BestAvailableOrderProps
|
|
12
|
+
}
|
|
13
|
+
const MarketCard = ({ market, trade }:MarketButtonProps) => {
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<TouchableOpacity style={{ padding:5 }}>
|
|
17
|
+
{trade && market.var_1_required ?
|
|
18
|
+
<Text theme='body'>{MarketHelpers.getVar1Label(market, trade.var_1)}</Text>
|
|
19
|
+
:<></>}
|
|
20
|
+
</TouchableOpacity>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default MarketCard
|
package/src/Squares/api/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from "axios"
|
|
2
2
|
import { APIOverrides } from "../../ApiOverrides"
|
|
3
|
-
import type { BuySquaresResponseProps, EventProps, LeagueProps, OfferResponseProps, PlayerSquareProps, PublicPlayerProps, SquareOfferProps, SquareProps, SquareResultProps, SquaresCompetitionProps, SquaresPayoutProps, SquaresTypeProps, SquareValueProps } from "../../types"
|
|
3
|
+
import type { BuySquaresResponseProps, EventProps, LeagueProps, OfferResponseProps, PlayerSquareProps, PublicPlayerProps, SquareOfferProps, SquarePrizeProps, SquareProps, SquareResultProps, SquaresCompetitionProps, SquaresPayoutProps, SquaresTypeProps, SquareValueProps } from "../../types"
|
|
4
4
|
import moment from "moment-mini"
|
|
5
5
|
|
|
6
6
|
let AUTH_SVC_API = ''
|
|
@@ -18,7 +18,7 @@ const SquaresApi = {
|
|
|
18
18
|
//MK_SVC_API = endpoints['MK_SVC_API'] as string;
|
|
19
19
|
AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
|
|
20
20
|
},
|
|
21
|
-
getSquareCompetitionById: async(sq_comp_id:string):Promise<{ squares_competition:SquaresCompetitionProps, square_results:SquareResultProps[], squares:SquareProps[], player_squares:PlayerSquareProps[], square_offers:SquareOfferProps[], squares_type:SquaresTypeProps, squares_payout_type: SquaresPayoutProps, player_square_history:PlayerSquareProps[] }> => {
|
|
21
|
+
getSquareCompetitionById: async(sq_comp_id:string):Promise<{ squares_competition:SquaresCompetitionProps, square_results:SquareResultProps[], squares:SquareProps[], player_squares:PlayerSquareProps[], square_offers:SquareOfferProps[], squares_type:SquaresTypeProps, squares_payout_type: SquaresPayoutProps, player_square_history:PlayerSquareProps[], square_prizes:SquarePrizeProps[] }> => {
|
|
22
22
|
const resp = await axios.get(`${TP_SVC_API}/tp/squares/comp/details/${sq_comp_id}`)
|
|
23
23
|
return resp.data
|
|
24
24
|
},
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, FlatList, Image } from 'react-native';
|
|
3
|
+
import { view_styles } from '../../constants/styles';
|
|
4
|
+
import { Icons, Text } from '../../Components';
|
|
5
|
+
import Colors from '../../constants/colors';
|
|
6
|
+
import type { EventProps, PublicPlayerProps, SquarePrizeProps, SquareProps } from '../../types';
|
|
7
|
+
|
|
8
|
+
type PrizeCardProps = {
|
|
9
|
+
square_prizes:SquarePrizeProps[]
|
|
10
|
+
event?:EventProps,
|
|
11
|
+
squares: SquareProps[],
|
|
12
|
+
players:PublicPlayerProps[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const PrizeCard = ({ event, square_prizes, players, squares }:PrizeCardProps) => {
|
|
16
|
+
const [ expanded, setExpanded ] = useState(false);
|
|
17
|
+
|
|
18
|
+
const renderPrizes = (data: { item:SquarePrizeProps, index:number }) => {
|
|
19
|
+
const square = squares.find(s => s.sq_square_id == data.item.sq_square_id)
|
|
20
|
+
const winner = players.find(p => p.player_id == data.item.winner_id)
|
|
21
|
+
if(!square){ return <></> }
|
|
22
|
+
return (
|
|
23
|
+
<View style={{ ...view_styles.body_row, borderBottomWidth:1, borderBottomColor:Colors.shades.shade600 }}>
|
|
24
|
+
<Image
|
|
25
|
+
source={{ uri: data.item.image.url }}
|
|
26
|
+
style={{ height: 40, width:40, borderRadius:4 }}
|
|
27
|
+
resizeMode='cover'
|
|
28
|
+
/>
|
|
29
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
30
|
+
<Text theme='header_2'>{data.item.description}</Text>
|
|
31
|
+
{winner ?
|
|
32
|
+
<Text style={{marginTop:3}} size={12} color={Colors.incentive.gold} weight={'bold'}>Winner: @{winner.username}</Text>
|
|
33
|
+
:<></>}
|
|
34
|
+
</View>
|
|
35
|
+
{data.item.status == 'active' ?
|
|
36
|
+
<View style={{ padding:10 }}>
|
|
37
|
+
<Icons.UnbidSquare color={event?.home?.primary_color} secondary_color={event?.away?.primary_color} size={20} />
|
|
38
|
+
</View>
|
|
39
|
+
:data.item.status == 'awarded'?
|
|
40
|
+
<View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
41
|
+
{winner ?
|
|
42
|
+
<Image
|
|
43
|
+
source={{ uri: winner.profile_pic && winner.profile_pic != '' ? winner.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
44
|
+
style={{ height:40, width:40, borderRadius:4, marginRight:10 }}
|
|
45
|
+
resizeMode='cover'
|
|
46
|
+
/>
|
|
47
|
+
:<></>}
|
|
48
|
+
<View>
|
|
49
|
+
<Icons.UnbidSquare color={Colors.shades.shade100} secondary_color={Colors.shades.shade100} size={20} />
|
|
50
|
+
<View style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
|
|
51
|
+
<Text>{square.square_score_x}, {square.square_score_y}</Text>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
:<></>}
|
|
56
|
+
</View>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<View style={{ ...view_styles.section, minWidth:350 }}>
|
|
62
|
+
<TouchableOpacity style={view_styles.section_header} onPress={() => setExpanded(!expanded)}>
|
|
63
|
+
<Icons.AwardRibbonIcon size={18} color={Colors.incentive.gold} />
|
|
64
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
65
|
+
<Text theme='header'>HIDDEN PRIZES</Text>
|
|
66
|
+
<Text style={{ marginTop:3 }} theme="body_2">This board contains some hidden prizes! Check them out here!</Text>
|
|
67
|
+
</View>
|
|
68
|
+
<Icons.ChevronIcon direction={true?'down':'up'} size={8} color={Colors.brand.midnight} />
|
|
69
|
+
</TouchableOpacity>
|
|
70
|
+
{expanded ?
|
|
71
|
+
<View style={view_styles.section_body}>
|
|
72
|
+
<FlatList
|
|
73
|
+
data={square_prizes.sort((a,b) => parseInt(a.square_prize_id) - parseInt(b.square_prize_id))}
|
|
74
|
+
renderItem={renderPrizes}
|
|
75
|
+
keyExtractor={(item) => item.square_prize_id.toString()}
|
|
76
|
+
/>
|
|
77
|
+
<View style={{ marginTop:10, flexDirection:'row', alignItems:'center', borderRadius:8, backgroundColor:Colors.incentive.gold_faded, padding:10 }}>
|
|
78
|
+
<Icons.AlertIcon color={Colors.brand.midnight} size={16} />
|
|
79
|
+
<View style={{ flex:1, marginLeft:5 }}>
|
|
80
|
+
<Text theme='header_2' color={Colors.brand.midnight}>Prizes are hidden behind random squares on the board. End up with this square after the auction period and win the prize!</Text>
|
|
81
|
+
<Text style={{ marginTop:3 }} theme='body' color={Colors.brand.midnight}>Square will be visible once the auction period ends</Text>
|
|
82
|
+
</View>
|
|
83
|
+
</View>
|
|
84
|
+
</View>
|
|
85
|
+
:<></>}
|
|
86
|
+
</View>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export default PrizeCard
|
|
@@ -168,7 +168,6 @@ const SquareCard = ({ player_id, square, player_square, event, event_status, mar
|
|
|
168
168
|
if(square_state === 'existing_buy_offer' && player_square?.player_id != player_id){ showSubText = 'OFFER' }
|
|
169
169
|
if(square_state === 'existing_buy_offer' && player_square?.player_id == player_id){ showSubText = 'SELL' }
|
|
170
170
|
if(square_state === 'existing_sell_offer' && player_square?.player_id != player_id){ showSubText = 'BUY' }
|
|
171
|
-
|
|
172
171
|
return (
|
|
173
172
|
<TouchableOpacity style={{ margin:3, height:40, width:40, borderRadius:4, justifyContent:'center', alignItems:'center', backgroundColor:getSquareBackgroundColor(square_state), borderWidth:getSquareBorderWidth(square_state), borderTopWidth:getSquareBorderTopWidth(square_state), borderColor:getSquareBorderColor(square_state) }} onPress={() => onSquareSelect(square, draft_player_square||draft_square_offer?'remove':'add')}>
|
|
174
173
|
{isUserIconVisible(square_state) ?
|
package/src/Squares/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react"
|
|
2
2
|
import { ActivityIndicator, View, Image, TouchableOpacity, ScrollView } from 'react-native';
|
|
3
|
-
import type { BuySquaresResponseProps, EventProps, LeagueProps, OfferResponseProps, PlayerSquareProps, PublicPlayerProps, SquareOfferProps, SquareProps, SquareResultProps, SquaresCompetitionProps, SquaresPayoutProps, SquaresTypeProps } from "../types"
|
|
3
|
+
import type { BuySquaresResponseProps, EventProps, LeagueProps, OfferResponseProps, PlayerSquareProps, PublicPlayerProps, SquareOfferProps, SquarePrizeProps, SquareProps, SquareResultProps, SquaresCompetitionProps, SquaresPayoutProps, SquaresTypeProps } from "../types"
|
|
4
4
|
import Colors from "../constants/colors";
|
|
5
5
|
import { SqauresHelpers, SquaresApi } from "./api";
|
|
6
6
|
import { Button, Icons, Text } from "../Components";
|
|
@@ -18,6 +18,7 @@ import MySquaresCard from "./components/MySquaresCard";
|
|
|
18
18
|
import { view_styles } from "../constants/styles";
|
|
19
19
|
import MyStatsCard from "./components/MyStatsCard";
|
|
20
20
|
import SquareOffersCard from "./components/SquareOffersCard";
|
|
21
|
+
import PrizeCard from './components/PrizeCard';
|
|
21
22
|
|
|
22
23
|
type SquaresModuleProps = {
|
|
23
24
|
player_id?:string,
|
|
@@ -42,6 +43,7 @@ const SquaresModule = ({ sq_comp_id, player_id, distinct_id, onRequestAuthentica
|
|
|
42
43
|
event?:EventProps,
|
|
43
44
|
squares_competition?:SquaresCompetitionProps,
|
|
44
45
|
squares:SquareProps[],
|
|
46
|
+
square_prizes:SquarePrizeProps[],
|
|
45
47
|
league?:LeagueProps,
|
|
46
48
|
players:PublicPlayerProps[],
|
|
47
49
|
squares_payout_type?:SquaresPayoutProps,
|
|
@@ -56,6 +58,7 @@ const SquaresModule = ({ sq_comp_id, player_id, distinct_id, onRequestAuthentica
|
|
|
56
58
|
squares:[],
|
|
57
59
|
players:[],
|
|
58
60
|
square_results: [],
|
|
61
|
+
square_prizes:[],
|
|
59
62
|
square_offers: [],
|
|
60
63
|
player_square_history: [],
|
|
61
64
|
player_squares: []
|
|
@@ -71,7 +74,7 @@ const SquaresModule = ({ sq_comp_id, player_id, distinct_id, onRequestAuthentica
|
|
|
71
74
|
});
|
|
72
75
|
|
|
73
76
|
const { square_bids, draft_square_offers, submit_ready } = board_data;
|
|
74
|
-
const { loading, league, event, players, loaded, squares_competition, squares, squares_type, squares_payout_type, square_results, square_offers, player_square_history, player_squares } = module_data;
|
|
77
|
+
const { loading, league, event, players, loaded, squares_competition, square_prizes, squares, squares_type, squares_payout_type, square_results, square_offers, player_square_history, player_squares } = module_data;
|
|
75
78
|
|
|
76
79
|
const squares_expected_value = SqauresHelpers.getMyExpectedValue(squares, [ ...player_squares.filter(ps => ps.status == 'active' && ps.player_id == player_id) ], squares_competition, player_id)
|
|
77
80
|
const my_squares = player_squares.filter(ps => ps.status == 'active' && ps.player_id == player_id);
|
|
@@ -117,6 +120,7 @@ const SquaresModule = ({ sq_comp_id, player_id, distinct_id, onRequestAuthentica
|
|
|
117
120
|
squares_payout_type: d.squares_payout_type,
|
|
118
121
|
squares:d.squares,
|
|
119
122
|
players:ps,
|
|
123
|
+
square_prizes: d.square_prizes,
|
|
120
124
|
square_offers: d.square_offers,
|
|
121
125
|
square_results: d.square_results,
|
|
122
126
|
player_squares:d.player_squares.filter(ps => ps.status == 'active'),
|
|
@@ -351,6 +355,12 @@ const SquaresModule = ({ sq_comp_id, player_id, distinct_id, onRequestAuthentica
|
|
|
351
355
|
onRequestAuthenticate={() => onRequestAuthenticate(squares_competition.auth_strategy_id)}
|
|
352
356
|
/>
|
|
353
357
|
:<></>}
|
|
358
|
+
<PrizeCard
|
|
359
|
+
square_prizes={square_prizes}
|
|
360
|
+
squares={squares}
|
|
361
|
+
players={players}
|
|
362
|
+
event={event}
|
|
363
|
+
/>
|
|
354
364
|
<View>
|
|
355
365
|
<SquaresBoard
|
|
356
366
|
player_id={player_id}
|
package/src/constants/styles.ts
CHANGED
|
@@ -4,6 +4,11 @@ import Colors from './colors';
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
export const view_styles = StyleSheet.create({
|
|
7
|
+
wrapper: {
|
|
8
|
+
flexDirection:'row',
|
|
9
|
+
flexWrap: 'wrap'
|
|
10
|
+
},
|
|
11
|
+
input: { padding:10, borderWidth:1, borderColor:Colors.shades.shade600, borderRadius:4 },
|
|
7
12
|
container: {
|
|
8
13
|
backgroundColor:Colors.shades.white,
|
|
9
14
|
borderTopRightRadius:22,
|
package/src/index.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import BracketRoom from "./Bracket";
|
|
|
18
18
|
import SocketManager from './Socket';
|
|
19
19
|
import SquaresModule from "./Squares";
|
|
20
20
|
import PromotedOrder from "./PromotedOrder";
|
|
21
|
+
import CompetitionManager from "./CompetitionManager";
|
|
21
22
|
|
|
22
23
|
export {
|
|
23
24
|
Authenticator,
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
BEEventApi,
|
|
26
27
|
BELinkApi,
|
|
27
28
|
ProfileManager,
|
|
29
|
+
CompetitionManager,
|
|
28
30
|
Components,
|
|
29
31
|
SocialComponents,
|
|
30
32
|
APIOverrides,
|
package/src/types.d.ts
CHANGED
|
@@ -957,6 +957,12 @@ export interface MarketProps {
|
|
|
957
957
|
last_update_datetime: any;
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
+
export interface MarketSideOptionProps {
|
|
961
|
+
side: string,
|
|
962
|
+
label: string,
|
|
963
|
+
id_source: 'athlete' | 'team' | 'side' | 'exotic',
|
|
964
|
+
parseable_title: string
|
|
965
|
+
}
|
|
960
966
|
|
|
961
967
|
export interface TradeProps {
|
|
962
968
|
trade_id: string;
|
|
@@ -994,7 +1000,8 @@ export interface CompetitionProps {
|
|
|
994
1000
|
auth_strategy_id:string,
|
|
995
1001
|
competition_name:string,
|
|
996
1002
|
competition_description:string,
|
|
997
|
-
buy_in:number,
|
|
1003
|
+
buy_in:number | string,
|
|
1004
|
+
league_name?:string,
|
|
998
1005
|
admin_id:string,
|
|
999
1006
|
admin?:PublicPlayerProps,
|
|
1000
1007
|
guaranteed_payout?:number,
|
|
@@ -1016,7 +1023,7 @@ export interface CompetitionProps {
|
|
|
1016
1023
|
promo_payout?:number,
|
|
1017
1024
|
sponsor_id?:string,
|
|
1018
1025
|
sponsor?:PublicPlayerProps,
|
|
1019
|
-
available_tickets:number,
|
|
1026
|
+
available_tickets:number | string,
|
|
1020
1027
|
tickets_sold:number,
|
|
1021
1028
|
market_ids:string[],
|
|
1022
1029
|
ticket_revenue:number,
|
|
@@ -1041,6 +1048,7 @@ export interface CompetitionMatchProps {
|
|
|
1041
1048
|
create_datetime:any,
|
|
1042
1049
|
market_id_override?:string,
|
|
1043
1050
|
side_type_override?:string,
|
|
1051
|
+
competition_match_markets?:CompetitionMatchMarketProps[],
|
|
1044
1052
|
side_id_override?:string,
|
|
1045
1053
|
last_update_datetime:any,
|
|
1046
1054
|
status: 'closed'|'inprogress'|'deleted',
|
|
@@ -1497,6 +1505,21 @@ export interface SquareResultProps {
|
|
|
1497
1505
|
export interface SquareOfferProps {
|
|
1498
1506
|
sq_offer_id:string, sq_player_square_id:string, offerer_id:string, offeree_id:string, amount:number, buy_sell_ind:'buy'|'sell', sq_comp_id:string, market_type:'FREE'|'FOR_MONEY', status:'offered'|'accepted'|'rejected'|'withdrawn', create_datetime:any, last_update_datetime:any
|
|
1499
1507
|
}
|
|
1508
|
+
export interface SquarePrizeProps {
|
|
1509
|
+
square_prize_id:string,
|
|
1510
|
+
company_id:string,
|
|
1511
|
+
sq_comp_id:string,
|
|
1512
|
+
sq_square_id:string,
|
|
1513
|
+
winner_id?:string,
|
|
1514
|
+
sq_player_square_id?:string,
|
|
1515
|
+
status: 'pending' | 'inactive' | 'active' | 'awarded' | 'claimed' | 'expired',
|
|
1516
|
+
expire_datetime:any,
|
|
1517
|
+
image: { url: string },
|
|
1518
|
+
description: string,
|
|
1519
|
+
company_coupon_id?:string,
|
|
1520
|
+
create_datetime:any,
|
|
1521
|
+
last_update_datetime: any
|
|
1522
|
+
}
|
|
1500
1523
|
|
|
1501
1524
|
export type SquareStateProps = 'no_bid'|'existing_bid'|'bid_draft'|'outbid_draft'|'outbid'|'no_offer'|'draft_buy_offer'|'draft_sell_offer'|
|
|
1502
1525
|
'existing_buy_offer'|'existing_sell_offer'
|
|
@@ -1505,6 +1528,7 @@ export type SquareStateProps = 'no_bid'|'existing_bid'|'bid_draft'|'outbid_draft
|
|
|
1505
1528
|
|
|
1506
1529
|
|
|
1507
1530
|
|
|
1531
|
+
|
|
1508
1532
|
//EVENTS
|
|
1509
1533
|
export interface BestAvailableOrderProps {
|
|
1510
1534
|
event_id:string,
|