be-components 3.4.2 → 3.4.3
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/Components/Icons.js +30 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/SearchBox.js +17 -23
- package/lib/commonjs/Components/SearchBox.js.map +1 -1
- package/lib/commonjs/Components/Themed.js +2 -2
- package/lib/commonjs/Components/Themed.js.map +1 -1
- package/lib/commonjs/Engage/components/BracketCompetitionCard.js +75 -58
- package/lib/commonjs/Engage/components/BracketCompetitionCard.js.map +1 -1
- package/lib/commonjs/Engage/components/CompanyCard.js +31 -26
- package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -1
- package/lib/commonjs/Engage/components/CompetitionCard.js +85 -68
- package/lib/commonjs/Engage/components/CompetitionCard.js.map +1 -1
- package/lib/commonjs/Engage/components/EngageHeader.js +62 -36
- package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -1
- package/lib/commonjs/Engage/components/PrivateCodePrompt.js +47 -45
- package/lib/commonjs/Engage/components/PrivateCodePrompt.js.map +1 -1
- package/lib/commonjs/Engage/components/SquaresCompetitionCard.js +69 -56
- package/lib/commonjs/Engage/components/SquaresCompetitionCard.js.map +1 -1
- package/lib/commonjs/Engage/index.js +262 -259
- package/lib/commonjs/Engage/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +69 -46
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +1 -1
- package/lib/commonjs/constants/styles.js.map +1 -1
- package/lib/commonjs/constants/useColors.js +6 -3
- package/lib/commonjs/constants/useColors.js.map +1 -1
- package/lib/module/Components/Icons.js +30 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/SearchBox.js +11 -17
- package/lib/module/Components/SearchBox.js.map +1 -1
- package/lib/module/Components/Themed.js +2 -2
- package/lib/module/Components/Themed.js.map +1 -1
- package/lib/module/Engage/components/BracketCompetitionCard.js +52 -35
- package/lib/module/Engage/components/BracketCompetitionCard.js.map +1 -1
- package/lib/module/Engage/components/CompanyCard.js +27 -21
- package/lib/module/Engage/components/CompanyCard.js.map +1 -1
- package/lib/module/Engage/components/CompetitionCard.js +57 -40
- package/lib/module/Engage/components/CompetitionCard.js.map +1 -1
- package/lib/module/Engage/components/EngageHeader.js +53 -27
- package/lib/module/Engage/components/EngageHeader.js.map +1 -1
- package/lib/module/Engage/components/PrivateCodePrompt.js +36 -33
- package/lib/module/Engage/components/PrivateCodePrompt.js.map +1 -1
- package/lib/module/Engage/components/SquaresCompetitionCard.js +51 -38
- package/lib/module/Engage/components/SquaresCompetitionCard.js.map +1 -1
- package/lib/module/Engage/index.js +262 -259
- package/lib/module/Engage/index.js.map +1 -1
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js +69 -46
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/module/constants/styles.js +1 -1
- package/lib/module/constants/styles.js.map +1 -1
- package/lib/module/constants/useColors.js +6 -3
- package/lib/module/constants/useColors.js.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -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/commonjs/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/CompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Engage/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Engage/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants/styles.d.ts +1 -1
- package/lib/typescript/lib/commonjs/constants/useColors.d.ts +5 -4
- package/lib/typescript/lib/commonjs/constants/useColors.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/SearchBox.d.ts +1 -2
- package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts +2 -4
- package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts +1 -2
- package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Engage/index.d.ts +3 -3
- package/lib/typescript/lib/module/Engage/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/constants/useColors.d.ts +71 -0
- package/lib/typescript/lib/module/constants/useColors.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/CompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts +1 -2
- package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/index.d.ts +5 -1
- package/lib/typescript/src/Engage/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/constants/useColors.d.ts +71 -0
- package/lib/typescript/src/constants/useColors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Components/Icons.tsx +16 -0
- package/src/Components/SearchBox.tsx +11 -13
- package/src/Components/Themed.tsx +3 -3
- package/src/Engage/components/BracketCompetitionCard.tsx +34 -31
- package/src/Engage/components/CompanyCard.tsx +17 -19
- package/src/Engage/components/CompetitionCard.tsx +40 -35
- package/src/Engage/components/EngageHeader.tsx +30 -29
- package/src/Engage/components/PrivateCodePrompt.tsx +29 -33
- package/src/Engage/components/SquaresCompetitionCard.tsx +33 -29
- package/src/Engage/index.tsx +191 -187
- package/src/MarketComponents/components/TeamEventMarket/index.tsx +55 -44
- package/src/constants/styles.ts +1 -1
- package/src/constants/useColors.tsx +7 -5
package/src/Components/Icons.tsx
CHANGED
|
@@ -25,6 +25,21 @@ const AlertIcon = ({ color, size }:IconProps) => {
|
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
const RefreshIcon = ({ color, size }:IconProps) => {
|
|
29
|
+
const ratio = .8214
|
|
30
|
+
const height = size??24
|
|
31
|
+
const width = height * ratio
|
|
32
|
+
return (
|
|
33
|
+
<Svg width={`${width}px`} height={`${height}px`} viewBox="0 0 23 28">
|
|
34
|
+
<G id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
|
35
|
+
<G id="refresh-cw-alt-2-svgrepo-com" transform="translate(2.000000, 2.000000)" stroke={color??Colors.brand.midnight} stroke-width="3">
|
|
36
|
+
<Path d="M8.399958,0 L10.799946,2.39452803 L10.7289064,2.46567567 M10.799946,19.200024 L8.399958,21.4928525 L8.43559782,21.5299324 M10.7289064,2.46567567 L8.399958,4.799976 M10.7289064,2.46567567 C10.3587082,2.42229589 9.98191009,2.399988 9.599952,2.399988 C4.29804251,2.399988 0,6.69803051 0,11.99994 C0,15.0316048 1.40527697,17.7350713 3.599982,19.4943825 M15.599922,4.50553347 C17.794591,6.26486868 19.199904,8.96829916 19.199904,11.99994 C19.199904,17.3018735 14.9018855,21.599892 9.599952,21.599892 C9.20587397,21.599892 8.81719591,21.5761321 8.43559782,21.5299324 M10.799946,24 L8.43559782,21.5299324" id="Shape"></Path>
|
|
37
|
+
</G>
|
|
38
|
+
</G>
|
|
39
|
+
</Svg>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
28
43
|
const SearchIcon = ({ color, size }: IconProps) => {
|
|
29
44
|
const icon_size = size ?? 19
|
|
30
45
|
return (
|
|
@@ -1429,6 +1444,7 @@ export default {
|
|
|
1429
1444
|
PlusCircleIcon,
|
|
1430
1445
|
PausedIcon,
|
|
1431
1446
|
TwitterXIcon,
|
|
1447
|
+
RefreshIcon,
|
|
1432
1448
|
ChangeIcon,
|
|
1433
1449
|
USDIcon,
|
|
1434
1450
|
EyeOffIcon,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { TextInput, View } from "react-native"
|
|
2
|
-
import Button from "./Button";
|
|
3
1
|
import React, { useState } from "react";
|
|
4
2
|
import Icons from "./Icons";
|
|
5
|
-
import
|
|
3
|
+
import { TextInput, View, Button } from "./Themed";
|
|
4
|
+
import { useColors } from "../constants/useColors";
|
|
6
5
|
|
|
7
6
|
type SearchBoxProps = {
|
|
8
7
|
onSearch?: (text:string) => void,
|
|
@@ -14,7 +13,7 @@ type SearchBoxProps = {
|
|
|
14
13
|
|
|
15
14
|
const SearchBox = ({ placeholder, onSearch, onChange, hide_search_button, style }:SearchBoxProps) => {
|
|
16
15
|
const [ search_value, setSearchValue ] = useState('');
|
|
17
|
-
|
|
16
|
+
const Colors = useColors();
|
|
18
17
|
const handleSearch = () => {
|
|
19
18
|
if(!onSearch){ return }
|
|
20
19
|
if(search_value == ''){ return alert('Please provide search value') }
|
|
@@ -23,16 +22,17 @@ const SearchBox = ({ placeholder, onSearch, onChange, hide_search_button, style
|
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
|
-
<View style={{
|
|
27
|
-
<View style={{ flex:1, flexDirection:'row', alignItems:'center', marginRight:10
|
|
28
|
-
<View style={{ padding:10 }}>
|
|
29
|
-
<Icons.SearchIcon size={12} color={Colors.
|
|
25
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center', padding:5 }}>
|
|
26
|
+
<View type='input' style={{ flex:1, flexDirection:'row', alignItems:'center', marginRight:10 }}>
|
|
27
|
+
<View transparent style={{ padding:10 }}>
|
|
28
|
+
<Icons.SearchIcon size={12} color={Colors.text.h1} />
|
|
30
29
|
</View>
|
|
31
30
|
<TextInput
|
|
32
31
|
placeholder={placeholder ?? 'Search'}
|
|
33
32
|
value={search_value}
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
transparent
|
|
34
|
+
placeholderTextColor={Colors.text.descriptionLight}
|
|
35
|
+
style={{ flex:1, ...style }}
|
|
36
36
|
onChangeText={(text) => {
|
|
37
37
|
setSearchValue(text)
|
|
38
38
|
if(onChange){ onChange(text) }
|
|
@@ -42,9 +42,7 @@ const SearchBox = ({ placeholder, onSearch, onChange, hide_search_button, style
|
|
|
42
42
|
{!hide_search_button ?
|
|
43
43
|
<Button
|
|
44
44
|
title="Search"
|
|
45
|
-
|
|
46
|
-
backgroundColor={Colors.brand.midnight}
|
|
47
|
-
borderRadius={8}
|
|
45
|
+
type='info'
|
|
48
46
|
onPress={() => handleSearch()}
|
|
49
47
|
/>
|
|
50
48
|
:<></>}
|
|
@@ -78,9 +78,9 @@ export type ViewProps = BEViewProps & DefaultView['props'];
|
|
|
78
78
|
|
|
79
79
|
export function View(props: ViewProps) {
|
|
80
80
|
const { style, float, transparent, type, ...otherProps } = props;
|
|
81
|
-
const C = useColors();
|
|
82
81
|
const color_mode = useColorScheme() ?? 'light'
|
|
83
|
-
|
|
82
|
+
const C = useColors();
|
|
83
|
+
|
|
84
84
|
const getColor = () => {
|
|
85
85
|
if(transparent){ return 'transparent' }
|
|
86
86
|
switch(type){
|
|
@@ -119,8 +119,8 @@ export type ButtonProps = BEButtonProps & TouchableOpacityProps;
|
|
|
119
119
|
|
|
120
120
|
export const Button = (props:ButtonProps) => {
|
|
121
121
|
const { style, type, children, transparent, loading, title, float, backgroundColor, title_color, borderColor, ...otherProps } = props;
|
|
122
|
-
const C = useColors();
|
|
123
122
|
const color_mode = useColorScheme() ?? 'light'
|
|
123
|
+
const C = useColors();
|
|
124
124
|
|
|
125
125
|
const getTheme = () => {
|
|
126
126
|
let b_colors = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
3
|
import type { BracketCompetitionProps, BracketProps, CompanyProps, CompetitionResultTypeProps, LeagueProps, PublicPlayerProps } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
6
|
-
import { Icons, Text } from '../../Components';
|
|
4
|
+
import { Icons } from '../../Components';
|
|
7
5
|
import moment from 'moment-mini';
|
|
6
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
7
|
+
import { useColors } from '../../constants/useColors';
|
|
8
8
|
|
|
9
9
|
type BracketCompetitionCardProps = {
|
|
10
10
|
bracket_competition:BracketCompetitionProps,
|
|
@@ -17,6 +17,7 @@ type BracketCompetitionCardProps = {
|
|
|
17
17
|
onCompetitionSelect:(c:BracketCompetitionProps) => void
|
|
18
18
|
}
|
|
19
19
|
const BracketCompetitionCard = ({ bracket_competition, bracket, league, company, admin, onCompetitionSelect }:BracketCompetitionCardProps) => {
|
|
20
|
+
const Colors = useColors();
|
|
20
21
|
const cl = bracket_competition.market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
21
22
|
let current_payout = bracket_competition.ticket_revenue
|
|
22
23
|
if(bracket_competition.promo_payout){ current_payout += bracket_competition.promo_payout }
|
|
@@ -24,23 +25,23 @@ const BracketCompetitionCard = ({ bracket_competition, bracket, league, company,
|
|
|
24
25
|
|
|
25
26
|
const tickets_available = bracket_competition.max_brackets - bracket_competition.tickets_sold
|
|
26
27
|
const is_live = moment().isAfter(moment(bracket_competition.scheduled_datetime)) ? true : false
|
|
27
|
-
|
|
28
|
+
const is_closed = bracket_competition.status == 'closed' ? true : false
|
|
28
29
|
return (
|
|
29
|
-
<
|
|
30
|
-
<View style={{
|
|
30
|
+
<Button float style={{ padding:0 }} onPress={() => onCompetitionSelect(bracket_competition)}>
|
|
31
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
31
32
|
<Image
|
|
32
33
|
source={{ uri: bracket_competition.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
33
34
|
style={{ height:45, width:45, borderRadius:4}}
|
|
34
35
|
resizeMode='cover'
|
|
35
36
|
/>
|
|
36
|
-
<View style={{ flex:1, marginLeft:10, marginRight:10
|
|
37
|
-
<Text theme='
|
|
38
|
-
<Text style={{ marginTop:3 }} theme='
|
|
37
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
38
|
+
<Text theme='h2'>{bracket_competition.competition_name}</Text>
|
|
39
|
+
<Text style={{ marginTop:3 }} theme='description'>{bracket_competition.competition_description}</Text>
|
|
39
40
|
</View>
|
|
40
|
-
<Text size={20} color={Colors.
|
|
41
|
+
<Text size={20} color={Colors.text.action} weight='bold'>{cl}{bracket_competition.buy_in}</Text>
|
|
41
42
|
</View>
|
|
42
|
-
<View style={{
|
|
43
|
-
<View
|
|
43
|
+
<View type='body' style={{ padding:10 }}>
|
|
44
|
+
<View type='row'>
|
|
44
45
|
{bracket && league ?
|
|
45
46
|
<View style={{ flex:1, flexDirection:'row', alignItems:'center', marginRight:10 }}>
|
|
46
47
|
<Image
|
|
@@ -49,24 +50,24 @@ const BracketCompetitionCard = ({ bracket_competition, bracket, league, company,
|
|
|
49
50
|
resizeMode='cover'
|
|
50
51
|
/>
|
|
51
52
|
<View style={{ flex:1, marginLeft:10 }}>
|
|
52
|
-
<Text theme='
|
|
53
|
+
<Text theme='h2'>{bracket.bracket_name}</Text>
|
|
53
54
|
</View>
|
|
54
55
|
</View>
|
|
55
56
|
:<></>}
|
|
56
57
|
{tickets_available > 0 ?
|
|
57
58
|
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
58
|
-
<Text size={18} color={Colors.
|
|
59
|
-
<Text style={{ marginTop:3 }} theme='
|
|
59
|
+
<Text size={18} color={Colors.text.h1} weight='bold'>{tickets_available}</Text>
|
|
60
|
+
<Text style={{ marginTop:3 }} theme='description'>TICKETS</Text>
|
|
60
61
|
</View>
|
|
61
62
|
:
|
|
62
63
|
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
63
|
-
<Text size={18} color={Colors.
|
|
64
|
+
<Text size={18} color={Colors.text.error} weight='bold'>FULL</Text>
|
|
64
65
|
</View>
|
|
65
66
|
}
|
|
66
67
|
</View>
|
|
67
68
|
</View>
|
|
68
69
|
|
|
69
|
-
<View style={{
|
|
70
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
70
71
|
{company ?
|
|
71
72
|
<Image
|
|
72
73
|
source={{ uri: company.company_image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
@@ -81,10 +82,10 @@ const BracketCompetitionCard = ({ bracket_competition, bracket, league, company,
|
|
|
81
82
|
/>
|
|
82
83
|
:<></>}
|
|
83
84
|
{bracket_competition.prize_override ?
|
|
84
|
-
<View style={{ flex:1, flexDirection:'row', alignItems:'center', marginLeft:10 }}>
|
|
85
|
-
<View style={{ flex:1, marginRight:10}}>
|
|
86
|
-
<Text size={12} weight='bold' color={Colors.
|
|
87
|
-
<Text style={{ marginTop:3 }} size={10} color={Colors.
|
|
85
|
+
<View transparent style={{ flex:1, flexDirection:'row', alignItems:'center', marginLeft:10 }}>
|
|
86
|
+
<View transparent style={{ flex:1, marginRight:10}}>
|
|
87
|
+
<Text size={12} weight='bold' color={Colors.text.h1}>ADDITIONAL PRIZE</Text>
|
|
88
|
+
<Text style={{ marginTop:3 }} size={10} color={Colors.text.gold} weight='bold'>{bracket_competition.prize_override}</Text>
|
|
88
89
|
</View>
|
|
89
90
|
{bracket_competition.prize_image?.url ?
|
|
90
91
|
<Image
|
|
@@ -93,24 +94,26 @@ const BracketCompetitionCard = ({ bracket_competition, bracket, league, company,
|
|
|
93
94
|
resizeMode='cover'
|
|
94
95
|
/>
|
|
95
96
|
:
|
|
96
|
-
<Icons.AwardRibbonIcon size={24} color={Colors.
|
|
97
|
+
<Icons.AwardRibbonIcon size={24} color={Colors.text.gold} />
|
|
97
98
|
}
|
|
98
99
|
</View>
|
|
99
100
|
:
|
|
100
|
-
<View style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
101
|
-
<View style={{ flex:1, marginLeft:20, marginRight:20 }}>
|
|
102
|
-
<Text theme='
|
|
103
|
-
{
|
|
104
|
-
<Text style={{ marginTop:3 }} color={Colors.
|
|
101
|
+
<View transparent style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
102
|
+
<View transparent style={{ flex:1, marginLeft:20, marginRight:20 }}>
|
|
103
|
+
<Text theme='h2'>CURRENT PAYOUT</Text>
|
|
104
|
+
{is_closed ?
|
|
105
|
+
<Text style={{ marginTop:3 }} color={Colors.text.gold} weight='bold' size={12}>COMPLETED</Text>
|
|
106
|
+
:is_live ?
|
|
107
|
+
<Text style={{ marginTop:3 }} color={Colors.text.error} weight='bold' size={12}>IN PROGRESS</Text>
|
|
105
108
|
:
|
|
106
|
-
<Text style={{ marginTop:3 }} theme='
|
|
109
|
+
<Text style={{ marginTop:3 }} theme='description'>Join Until {moment(bracket_competition.scheduled_datetime).format('ddd hh:mm a')}</Text>
|
|
107
110
|
}
|
|
108
111
|
</View>
|
|
109
|
-
<Text color={Colors.
|
|
112
|
+
<Text color={Colors.text.success} size={20} weight='bold'>{cl}{current_payout.toFixed(2)}</Text>
|
|
110
113
|
</View>
|
|
111
114
|
}
|
|
112
115
|
</View>
|
|
113
|
-
</
|
|
116
|
+
</Button>
|
|
114
117
|
)
|
|
115
118
|
}
|
|
116
119
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import React, { useEffect
|
|
2
|
-
import {
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Image, Linking } from 'react-native';
|
|
3
3
|
import type { BEEventProps, CompanyProps } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import Colors from '../../constants/colors';
|
|
7
|
-
import { useIsInViewport } from '../../Components/ViewportObserver';
|
|
4
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
5
|
+
import { useColors } from '../../constants/useColors';
|
|
8
6
|
|
|
9
7
|
type CompanyCardProps = {
|
|
10
8
|
company:CompanyProps,
|
|
@@ -15,9 +13,9 @@ type CompanyCardProps = {
|
|
|
15
13
|
const MAX_IMAGE_WIDTH = 175
|
|
16
14
|
|
|
17
15
|
const CompanyCard = ({company, width, onEvent, onSelectCompany}:CompanyCardProps) => {
|
|
18
|
-
|
|
19
|
-
const company_ref = useRef(null)
|
|
20
|
-
const isInViewport = useIsInViewport(company_ref);
|
|
16
|
+
const Colors = useColors();
|
|
17
|
+
//const company_ref = useRef(null)
|
|
18
|
+
const isInViewport = false//useIsInViewport(company_ref);
|
|
21
19
|
useEffect(() => {
|
|
22
20
|
if(isInViewport && onEvent){
|
|
23
21
|
let be_event:BEEventProps = {
|
|
@@ -41,28 +39,28 @@ const CompanyCard = ({company, width, onEvent, onSelectCompany}:CompanyCardProps
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
return (
|
|
44
|
-
<
|
|
42
|
+
<Button float style={{ flexGrow:1, width:image_width, borderRadius:8, padding:0, backgroundColor:company.brand_primary ?? Colors.absolutes.shades.shade100, borderColor:Colors.absolutes.shades.shade100}}
|
|
45
43
|
onPress={() => {
|
|
46
44
|
if(onSelectCompany){ return onSelectCompany(company) }
|
|
47
45
|
if(company.company_url){ Linking.openURL(company.company_url) }
|
|
48
46
|
return
|
|
49
47
|
}}>
|
|
50
|
-
<View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
51
|
-
<View style={{
|
|
52
|
-
<Text size={14} color={Colors.
|
|
48
|
+
<View transparent style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
49
|
+
<View transparent style={{ flexShrink:1 }}>
|
|
50
|
+
<Text size={14} theme='h2' color={Colors.text.white} weight='bold'>{company.company_name}</Text>
|
|
53
51
|
</View>
|
|
54
52
|
</View>
|
|
55
|
-
<View style={{
|
|
53
|
+
<View style={{ flexGrow:1, borderBottomRightRadius:8, borderBottomLeftRadius:8, backgroundColor:Colors.absolutes.shades.shade100 }}>
|
|
56
54
|
<Image
|
|
57
55
|
source={{ uri: company.company_image?.url }}
|
|
58
|
-
style={{ height: image_width, width:image_width, borderBottomRightRadius:8, borderBottomLeftRadius:8
|
|
59
|
-
resizeMode='
|
|
56
|
+
style={{ height: image_width, width:image_width - 2, borderBottomRightRadius:8, borderBottomLeftRadius:8}}
|
|
57
|
+
resizeMode='contain'
|
|
60
58
|
/>
|
|
61
|
-
<View style={{ position:'absolute', backgroundColor:Colors.
|
|
62
|
-
<Text theme='
|
|
59
|
+
<View style={{ position:'absolute', backgroundColor:Colors.text.white, bottom:0, left:0, right:0, padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
60
|
+
<Text theme='h2' color={Colors.absolutes.brand.midnight}>{description}</Text>
|
|
63
61
|
</View>
|
|
64
62
|
</View>
|
|
65
|
-
</
|
|
63
|
+
</Button>
|
|
66
64
|
)
|
|
67
65
|
}
|
|
68
66
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
3
|
import type { CompanyProps, CompetitionProps, CompetitionResultTypeProps, CompetitionTypeProps, PublicPlayerProps } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
6
|
-
import { Icons, Text } from '../../Components';
|
|
4
|
+
import { Icons } from '../../Components';
|
|
7
5
|
import moment from 'moment-mini';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
8
8
|
|
|
9
9
|
type CompetitionCardProps = {
|
|
10
10
|
competition:CompetitionProps,
|
|
@@ -16,6 +16,7 @@ type CompetitionCardProps = {
|
|
|
16
16
|
onCompetitionSelect:(c:CompetitionProps) => void
|
|
17
17
|
}
|
|
18
18
|
const CompetitionCard = ({ competition, competition_type, company, admin, onCompetitionSelect }:CompetitionCardProps) => {
|
|
19
|
+
const Colors = useColors();
|
|
19
20
|
const cl = competition.market_type == 'FOR_MONEY' ? '$' : 'E'
|
|
20
21
|
let current_payout = competition.ticket_revenue
|
|
21
22
|
if(competition.promo_payout){ current_payout += competition.promo_payout }
|
|
@@ -23,59 +24,60 @@ const CompetitionCard = ({ competition, competition_type, company, admin, onComp
|
|
|
23
24
|
|
|
24
25
|
const tickets_available = parseFloat(competition.available_tickets as string) - competition.tickets_sold
|
|
25
26
|
const is_live = moment().isAfter(moment(competition.scheduled_datetime)) ? true : false
|
|
27
|
+
const is_closed = competition.status == 'closed' ? true : false
|
|
26
28
|
const getTypeIcon = () => {
|
|
27
29
|
switch(competition_type.type){
|
|
28
30
|
case 'pick':
|
|
29
|
-
return <Icons.SelectorIcon size={20} color={Colors.
|
|
31
|
+
return <Icons.SelectorIcon size={20} color={Colors.text.h1} />
|
|
30
32
|
default: return <></>
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
return (
|
|
35
|
-
<
|
|
36
|
-
<View style={{
|
|
37
|
+
<Button float style={{ padding:0 }} onPress={() => onCompetitionSelect(competition)}>
|
|
38
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
37
39
|
<Image
|
|
38
40
|
source={{ uri: competition.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
39
41
|
style={{ height:45, width:45, borderRadius:4}}
|
|
40
42
|
resizeMode='cover'
|
|
41
43
|
/>
|
|
42
|
-
<View style={{ flex:1, marginLeft:10, marginRight:10
|
|
43
|
-
<Text theme='
|
|
44
|
-
<Text style={{ marginTop:3 }} theme='
|
|
44
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
45
|
+
<Text theme='h2'>{competition.competition_name}</Text>
|
|
46
|
+
<Text style={{ marginTop:3 }} theme='description'>{competition.competition_description}</Text>
|
|
45
47
|
</View>
|
|
46
|
-
<Text size={20} color={Colors.
|
|
48
|
+
<Text size={20} color={Colors.text.action} weight='bold'>{cl}{competition.buy_in}</Text>
|
|
47
49
|
</View>
|
|
48
|
-
<View style={{
|
|
49
|
-
<View
|
|
50
|
+
<View type='body' style={{ padding:10 }}>
|
|
51
|
+
<View type='row'>
|
|
50
52
|
|
|
51
53
|
{tickets_available > 0 ?
|
|
52
54
|
<View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
53
|
-
<Text size={18} color={Colors.
|
|
54
|
-
<Text style={{ marginTop:3 }} theme='
|
|
55
|
+
<Text size={18} color={Colors.text.h1} weight='bold'>{tickets_available}</Text>
|
|
56
|
+
<Text style={{ marginTop:3 }} theme='description'>TICKETS</Text>
|
|
55
57
|
</View>
|
|
56
58
|
:
|
|
57
59
|
<View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
58
|
-
<Text size={18} color={Colors.
|
|
60
|
+
<Text size={18} color={Colors.text.error} weight='bold'>FULL</Text>
|
|
59
61
|
</View>
|
|
60
62
|
}
|
|
61
63
|
{competition_type.type == 'pick' ?
|
|
62
64
|
<View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
63
|
-
<Text size={18} color={Colors.
|
|
64
|
-
<Text style={{ marginTop:3 }} theme='
|
|
65
|
+
<Text size={18} color={Colors.text.h1} weight='bold'>{competition.max_pick_count}</Text>
|
|
66
|
+
<Text style={{ marginTop:3 }} theme='description'>PICKS</Text>
|
|
65
67
|
</View>
|
|
66
68
|
:
|
|
67
69
|
<View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
68
|
-
<Text size={18} color={Colors.
|
|
69
|
-
<Text style={{ marginTop:3 }} size={14} color={Colors.
|
|
70
|
+
<Text size={18} color={Colors.text.h1} weight='bold' textAlign='center'>E{competition.initial_balance}</Text>
|
|
71
|
+
<Text style={{ marginTop:3 }} size={14} color={Colors.text.h1} textAlign='center'>STARTING BALANCE</Text>
|
|
70
72
|
</View>
|
|
71
73
|
}
|
|
72
74
|
<View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
73
75
|
{getTypeIcon()}
|
|
74
|
-
<Text style={{ marginTop:3 }} theme='
|
|
76
|
+
<Text style={{ marginTop:3 }} theme='description'>{competition_type.type_label.toUpperCase()}</Text>
|
|
75
77
|
</View>
|
|
76
78
|
</View>
|
|
77
79
|
</View>
|
|
78
|
-
<View style={{
|
|
80
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
79
81
|
{company ?
|
|
80
82
|
<Image
|
|
81
83
|
source={{ uri: company.company_image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
@@ -90,10 +92,10 @@ const CompetitionCard = ({ competition, competition_type, company, admin, onComp
|
|
|
90
92
|
/>
|
|
91
93
|
:<></>}
|
|
92
94
|
{competition.prize_override ?
|
|
93
|
-
<View style={{ flex:1, flexDirection:'row', alignItems:'center', marginLeft:10 }}>
|
|
94
|
-
<View style={{ flex:1, marginRight:10}}>
|
|
95
|
-
<Text size={12} weight='bold' color={Colors.
|
|
96
|
-
<Text style={{ marginTop:3 }} size={10} color={Colors.
|
|
95
|
+
<View transparent style={{ flex:1, flexDirection:'row', alignItems:'center', marginLeft:10 }}>
|
|
96
|
+
<View transparent style={{ flex:1, marginRight:10}}>
|
|
97
|
+
<Text size={12} weight='bold' color={Colors.text.h1}>ADDITIONAL PRIZE</Text>
|
|
98
|
+
<Text style={{ marginTop:3 }} size={10} color={Colors.text.gold} weight='bold'>{competition.prize_override}</Text>
|
|
97
99
|
</View>
|
|
98
100
|
{competition.prize_image?.url ?
|
|
99
101
|
<Image
|
|
@@ -102,24 +104,27 @@ const CompetitionCard = ({ competition, competition_type, company, admin, onComp
|
|
|
102
104
|
resizeMode='cover'
|
|
103
105
|
/>
|
|
104
106
|
:
|
|
105
|
-
<Icons.AwardRibbonIcon size={24} color={Colors.
|
|
107
|
+
<Icons.AwardRibbonIcon size={24} color={Colors.text.gold} />
|
|
106
108
|
}
|
|
107
109
|
</View>
|
|
108
110
|
:
|
|
109
|
-
<View style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
110
|
-
<View style={{ flex:1, marginLeft:20, marginRight:20 }}>
|
|
111
|
-
<Text theme='
|
|
112
|
-
{
|
|
113
|
-
<Text style={{ marginTop:3 }} color={Colors.
|
|
111
|
+
<View transparent style={{ flex:1, flexDirection:'row', alignItems:'center' }}>
|
|
112
|
+
<View transparent style={{ flex:1, marginLeft:20, marginRight:20 }}>
|
|
113
|
+
<Text theme='h2'>{is_closed ? 'TOTAL PAID OUT': 'CURRENT PAYOUT'}</Text>
|
|
114
|
+
{is_closed ?
|
|
115
|
+
<Text style={{ marginTop:3 }} color={Colors.text.gold} weight='bold' size={12}>COMPLETED</Text>
|
|
114
116
|
:
|
|
115
|
-
|
|
117
|
+
is_live ?
|
|
118
|
+
<Text style={{ marginTop:3 }} color={Colors.text.error} weight='bold' size={12}>IN PROGRESS</Text>
|
|
119
|
+
:
|
|
120
|
+
<Text style={{ marginTop:3 }} theme='light'>Join Until {moment(competition.scheduled_datetime).format('ddd hh:mm a')}</Text>
|
|
116
121
|
}
|
|
117
122
|
</View>
|
|
118
|
-
<Text color={Colors.
|
|
123
|
+
<Text color={Colors.text.success} size={20} weight='bold'>{cl}{current_payout.toFixed(2)}</Text>
|
|
119
124
|
</View>
|
|
120
125
|
}
|
|
121
126
|
</View>
|
|
122
|
-
</
|
|
127
|
+
</Button>
|
|
123
128
|
)
|
|
124
129
|
}
|
|
125
130
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image, FlatList, ActivityIndicator } from "react-native";
|
|
3
3
|
import type { BEEventProps, CompanyProps } from '../../types';
|
|
4
4
|
import {LinearGradient} from 'expo-linear-gradient';
|
|
5
|
-
import
|
|
6
|
-
import { Button, Icons, Text } from '../../Components';
|
|
5
|
+
import { Icons } from '../../Components';
|
|
7
6
|
import { view_styles } from '../../constants/styles';
|
|
8
7
|
import CompanyCard from './CompanyCard';
|
|
9
8
|
import SearchBox from '../../Components/SearchBox';
|
|
10
9
|
import { EngageApi } from '../api';
|
|
10
|
+
import { useColors } from '../../constants/useColors';
|
|
11
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
11
12
|
|
|
12
13
|
type EngageHeaderProps = {
|
|
13
14
|
companies:CompanyProps[],
|
|
@@ -32,7 +33,7 @@ const EngageHeader = ({ companies, width, onManage, onEvent, onSelectCompany }:E
|
|
|
32
33
|
});
|
|
33
34
|
const [ found_companies, setFoundCompanies ] = useState<CompanyProps[]>([]);
|
|
34
35
|
const { active, loading, value } = search;
|
|
35
|
-
|
|
36
|
+
const Colors = useColors();
|
|
36
37
|
let filtered_companies = [ ...found_companies ]
|
|
37
38
|
filtered_companies = filtered_companies.filter(c => c.company_name.toLowerCase().includes(value.toLowerCase()))
|
|
38
39
|
|
|
@@ -63,7 +64,7 @@ const EngageHeader = ({ companies, width, onManage, onEvent, onSelectCompany }:E
|
|
|
63
64
|
|
|
64
65
|
const renderCompanies = (data:{ item:CompanyProps, index:number }) => {
|
|
65
66
|
return (
|
|
66
|
-
<View>
|
|
67
|
+
<View transparent style={{ margin:4, marginRight:12 }}>
|
|
67
68
|
<CompanyCard
|
|
68
69
|
company={data.item}
|
|
69
70
|
width={width / 2.5}
|
|
@@ -77,9 +78,9 @@ const EngageHeader = ({ companies, width, onManage, onEvent, onSelectCompany }:E
|
|
|
77
78
|
const company = companies[active_company]
|
|
78
79
|
|
|
79
80
|
return (
|
|
80
|
-
<View>
|
|
81
|
-
<LinearGradient colors={[Colors.
|
|
82
|
-
<View style={{ borderRadius:100, height:75, width:75, backgroundColor:Colors.
|
|
81
|
+
<View type = 'header'>
|
|
82
|
+
<LinearGradient colors={[Colors.views.background, Colors.views.header ]} style={{ padding:20, flexDirection:'row', alignItems:'center' }}>
|
|
83
|
+
<View float style={{ borderRadius:100, height:75, width:75, backgroundColor:Colors.text.white, justifyContent:'center', alignItems:'center', ...view_styles.float }}>
|
|
83
84
|
{company ?
|
|
84
85
|
<Image
|
|
85
86
|
source={{ uri: company.company_image?.url }}
|
|
@@ -88,41 +89,41 @@ const EngageHeader = ({ companies, width, onManage, onEvent, onSelectCompany }:E
|
|
|
88
89
|
/>
|
|
89
90
|
:<></>}
|
|
90
91
|
</View>
|
|
91
|
-
<View style={{ flex:1, marginLeft:20 }}>
|
|
92
|
-
<Text size={20} weight='bold' color={Colors.
|
|
93
|
-
<Text style={{ marginTop:10 }} size={14} weight='regular' color={Colors.
|
|
92
|
+
<View transparent style={{ flex:1, marginLeft:20 }}>
|
|
93
|
+
<Text size={20} weight='bold' color={Colors.text.h1}>Engage with our partners</Text>
|
|
94
|
+
<Text style={{ marginTop:10 }} size={14} weight='regular' color={Colors.text.h1}>Competitions, squares, brackets are all brought to you without fees thanks to our amazing partners.</Text>
|
|
94
95
|
</View>
|
|
95
96
|
{onManage ?
|
|
96
97
|
<View style={{ position:'absolute', bottom:5, right:10 }}>
|
|
97
98
|
<Button
|
|
98
99
|
title='MANAGE'
|
|
99
|
-
|
|
100
|
-
padding={10}
|
|
101
|
-
backgroundColor={Colors.utility.success}
|
|
100
|
+
type='success'
|
|
102
101
|
onPress={() => onManage()}
|
|
103
102
|
/>
|
|
104
103
|
</View>
|
|
105
|
-
|
|
104
|
+
:<></>}
|
|
106
105
|
</LinearGradient>
|
|
107
|
-
<View
|
|
108
|
-
<
|
|
106
|
+
<View transparent style={{ padding:10 }}>
|
|
107
|
+
<Button float style={{ flexDirection:'row', alignItems:'center', marginBottom:10 }} onPress={() => setSearch({ ...search, active: !active })}>
|
|
109
108
|
<View style={{ flex:1, marginRight:10 }}>
|
|
110
|
-
<Text theme='
|
|
109
|
+
<Text theme='h1'>{active?'Search':'Support'} Our Partners!</Text>
|
|
110
|
+
{active ?
|
|
111
|
+
<Text style={{ marginTop:3 }} theme='description'>Use the search box below to find a brand that you're interested in!</Text>
|
|
112
|
+
:
|
|
113
|
+
<Text style={{ marginTop:3 }} theme='description'>Below are brands that currently have availble competitions!</Text>
|
|
114
|
+
}
|
|
115
|
+
</View>
|
|
116
|
+
<View float style={{ height:30, width:30, backgroundColor:Colors.views.header, borderRadius:100, justifyContent:'center', alignItems:'center' }}>
|
|
111
117
|
{active ?
|
|
112
|
-
<
|
|
118
|
+
<Icons.CloseIcon color={Colors.text.error} size={12} />
|
|
113
119
|
:
|
|
114
|
-
<
|
|
120
|
+
<Icons.SearchIcon color={Colors.text.h1} size={16} />
|
|
115
121
|
}
|
|
116
122
|
</View>
|
|
117
|
-
|
|
118
|
-
<Icons.CloseIcon color={Colors.utility.error} size={18} />
|
|
119
|
-
:
|
|
120
|
-
<Icons.SearchIcon color={Colors.brand.midnight} size={18} />
|
|
121
|
-
}
|
|
122
|
-
</TouchableOpacity>
|
|
123
|
+
</Button>
|
|
123
124
|
{active ?
|
|
124
|
-
<View>
|
|
125
|
-
<View style={{ marginBottom:10 }}>
|
|
125
|
+
<View transparent>
|
|
126
|
+
<View transparent style={{ marginBottom:10 }}>
|
|
126
127
|
<SearchBox
|
|
127
128
|
placeholder='Search our brands'
|
|
128
129
|
onChange={(text) => setSearch({ ...search, value: text })}
|
|
@@ -130,7 +131,7 @@ const EngageHeader = ({ companies, width, onManage, onEvent, onSelectCompany }:E
|
|
|
130
131
|
/>
|
|
131
132
|
</View>
|
|
132
133
|
{loading ?
|
|
133
|
-
<ActivityIndicator size='large' color={Colors.
|
|
134
|
+
<ActivityIndicator size='large' color={Colors.text.h1} />
|
|
134
135
|
:<></>}
|
|
135
136
|
<FlatList
|
|
136
137
|
data={filtered_companies}
|