be-components 3.4.2 → 3.4.4
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 +70 -47
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +3 -2
- 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 +70 -47
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
- package/lib/module/constants/styles.js +3 -2
- 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 +3 -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/styles.d.ts +2 -0
- 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/styles.d.ts +1 -0
- package/lib/typescript/src/constants/styles.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 +56 -45
- package/src/constants/styles.ts +2 -2
- package/src/constants/useColors.tsx +7 -5
|
@@ -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}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { View } from "react-native"
|
|
3
2
|
import type { BracketCompetitionProps, CompetitionProps, CompetitionSeasonProps, SquaresCompetitionProps } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import { Button, Icons, Text, TextInput } from '../../Components';
|
|
6
|
-
import Colors from '../../constants/colors';
|
|
3
|
+
import { Icons } from '../../Components';
|
|
7
4
|
import { EngageApi } from '../api';
|
|
5
|
+
import { useColors } from '../../constants/useColors';
|
|
6
|
+
import { Button, Text, TextInput, View } from '../../Components/Themed';
|
|
8
7
|
|
|
9
8
|
type PrivateCodePromptProps = {
|
|
10
|
-
width:number,
|
|
11
9
|
onFoundCompetition:(c:CompetitionProps) => void,
|
|
12
10
|
onFoundSquaresCompetition:(sc:SquaresCompetitionProps) => void,
|
|
13
11
|
onFoundSeason:(cs:CompetitionSeasonProps) => void,
|
|
@@ -15,7 +13,7 @@ type PrivateCodePromptProps = {
|
|
|
15
13
|
onClose:() => void
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
const PrivateCodePrompt = ({
|
|
16
|
+
const PrivateCodePrompt = ({ onFoundCompetition, onFoundSquaresCompetition, onFoundSeason, onFoundBracket, onClose }:PrivateCodePromptProps) => {
|
|
19
17
|
const [ search, setSearch ] = useState<{
|
|
20
18
|
loading:boolean,
|
|
21
19
|
value: string,
|
|
@@ -26,6 +24,8 @@ const PrivateCodePrompt = ({ width, onFoundCompetition, onFoundSquaresCompetitio
|
|
|
26
24
|
const [ error, setError ] = useState<string|undefined>();
|
|
27
25
|
const { loading, value } = search;
|
|
28
26
|
|
|
27
|
+
const Colors = useColors();
|
|
28
|
+
|
|
29
29
|
const handleSearch = async() => {
|
|
30
30
|
setSearch({ ...search, loading:true });
|
|
31
31
|
const result = await EngageApi.getPrivateEngage(value);
|
|
@@ -39,50 +39,46 @@ const PrivateCodePrompt = ({ width, onFoundCompetition, onFoundSquaresCompetitio
|
|
|
39
39
|
|
|
40
40
|
const search_valid = value ? true : false
|
|
41
41
|
return (
|
|
42
|
-
<View style={{
|
|
43
|
-
<View style={{
|
|
44
|
-
<Icons.SearchIcon color={Colors.
|
|
45
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
46
|
-
<Text theme='
|
|
42
|
+
<View float style={{ margin:10 }}>
|
|
43
|
+
<View type='header' style={{ padding:15, flexDirection:'row', alignItems:'center', borderTopRightRadius:8, borderTopLeftRadius:8}}>
|
|
44
|
+
<Icons.SearchIcon color={Colors.text.h1} size={20}/>
|
|
45
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
46
|
+
<Text theme='h1'>Find Private Competition!</Text>
|
|
47
47
|
</View>
|
|
48
48
|
</View>
|
|
49
|
-
<View style={{
|
|
50
|
-
<View style={{ borderRadius:8,
|
|
51
|
-
<Text size={18} color={Colors.
|
|
52
|
-
<Text style={{ marginTop:10 }} size={14} color={Colors.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
<View style={{ padding:10 }}>
|
|
50
|
+
<View style={{ borderRadius:8, padding:10 }}>
|
|
51
|
+
<Text size={18} color={Colors.text.h1} textAlign='center' theme='h1'>Did you receive a private code?</Text>
|
|
52
|
+
<Text style={{ marginTop:10 }} size={14} color={Colors.text.h1} textAlign='center' weight='regular'>Enter the code in the input section below and press FIND. If we find the competition / squares / bracket, we will send you to it!</Text>
|
|
53
|
+
<View type='input' style={{ marginTop:10 }}>
|
|
54
|
+
<TextInput
|
|
55
|
+
placeholder='Enter Private Code'
|
|
56
|
+
style={{ textAlign:'center' }}
|
|
57
|
+
onChangeText={(text) => {
|
|
58
|
+
if(error){ setError(undefined) }
|
|
59
|
+
setSearch({ ...search, value:text })
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
</View>
|
|
63
63
|
{error?
|
|
64
64
|
<View style={{ marginTop:10, padding:10 }}>
|
|
65
|
-
<Text size={14} color={Colors.
|
|
65
|
+
<Text size={14} color={Colors.text.error} weight='bold' textAlign='center'>{error}</Text>
|
|
66
66
|
</View>
|
|
67
67
|
:<></>}
|
|
68
68
|
</View>
|
|
69
69
|
</View>
|
|
70
|
-
<View style={{
|
|
70
|
+
<View type='footer' style={{ flexDirection:'row', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
71
71
|
<Button
|
|
72
72
|
title='CANCEL'
|
|
73
|
-
|
|
74
|
-
title_color={Colors.shades.white}
|
|
73
|
+
type='close'
|
|
75
74
|
style={{ marginRight:5 }}
|
|
76
|
-
padding={15}
|
|
77
75
|
onPress={() => onClose()}
|
|
78
76
|
/>
|
|
79
77
|
<Button
|
|
80
78
|
style={{ flex:1, opacity:search_valid&&!loading?1:0.5 }}
|
|
81
|
-
padding={15}
|
|
82
79
|
disabled={loading || !search_valid}
|
|
83
80
|
loading={loading}
|
|
84
|
-
|
|
85
|
-
title_color={Colors.shades.white}
|
|
81
|
+
type='success'
|
|
86
82
|
title='FIND'
|
|
87
83
|
onPress={async() => handleSearch()}
|
|
88
84
|
/>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Image
|
|
3
|
-
import {
|
|
4
|
-
import { Icons, Text } from '../../Components';
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
|
+
import { Icons } from '../../Components';
|
|
6
4
|
import type { CompanyProps, EventProps, PublicPlayerProps, SquaresCompetitionProps } from '../../types';
|
|
7
5
|
import moment from 'moment-mini';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { Button, View, Text } from '../../Components/Themed';
|
|
8
8
|
|
|
9
9
|
type SquaresCompetitionCardProps = {
|
|
10
10
|
squares_competition:SquaresCompetitionProps,
|
|
@@ -13,55 +13,57 @@ type SquaresCompetitionCardProps = {
|
|
|
13
13
|
company?:CompanyProps,
|
|
14
14
|
onSelectCompetition:(sq:SquaresCompetitionProps) => void
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
const SquaresCompetitionCard = ({ squares_competition, admin, event, company, onSelectCompetition }:SquaresCompetitionCardProps) => {
|
|
18
|
+
const Colors = useColors()
|
|
18
19
|
let current_payout = squares_competition.potential_winnings
|
|
19
20
|
if(squares_competition.guaranteed_payout && squares_competition.guaranteed_payout > current_payout){ current_payout = squares_competition.guaranteed_payout }
|
|
20
21
|
const is_live = moment().isAfter(moment(squares_competition.begin_datetime)) ? true : false
|
|
22
|
+
const is_closed = squares_competition.complete_ind ? true : false
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
23
|
-
<View style={{
|
|
24
|
+
<Button float style={{ padding:0 }} onPress={() => onSelectCompetition(squares_competition)}>
|
|
25
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
24
26
|
<Image
|
|
25
27
|
source={{ uri: squares_competition.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
26
28
|
style={{ height:45, width:45, borderRadius:4}}
|
|
27
29
|
resizeMode='cover'
|
|
28
30
|
/>
|
|
29
|
-
<View style={{ flex:1, marginLeft:10, marginRight:10
|
|
30
|
-
<Text theme='
|
|
31
|
-
<Text style={{ marginTop:3 }} theme='
|
|
31
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
32
|
+
<Text theme='h2'>{squares_competition.sq_comp_name}</Text>
|
|
33
|
+
<Text style={{ marginTop:3 }} theme='description'>{squares_competition.sq_comp_description}</Text>
|
|
32
34
|
</View>
|
|
33
|
-
<Text size={20} color={Colors.
|
|
35
|
+
<Text size={20} color={Colors.text.action} weight='bold'>${squares_competition.minimum_square_price}</Text>
|
|
34
36
|
</View>
|
|
35
|
-
<View style={{
|
|
36
|
-
<View
|
|
37
|
+
<View type='body' style={{ padding:10 }}>
|
|
38
|
+
<View type='row'>
|
|
37
39
|
{event ?
|
|
38
|
-
<View style={{ flex:1, flexDirection:'row', marginRight:10, borderRightWidth:1, borderColor:Colors.
|
|
40
|
+
<View transparent style={{ flex:1, flexDirection:'row', marginRight:10, borderRightWidth:1, borderColor:Colors.borders.light }}>
|
|
39
41
|
<View style={{ flexDirection:'row', alignItems:'center' }}>
|
|
40
42
|
<Image
|
|
41
43
|
source={{ uri: event.away?.image?.url }}
|
|
42
44
|
style={{ height:30, width:30 }}
|
|
43
45
|
resizeMode='cover'
|
|
44
46
|
/>
|
|
45
|
-
<Text style={{ padding:5 }} theme='
|
|
47
|
+
<Text style={{ padding:5 }} theme='h2'>VS</Text>
|
|
46
48
|
<Image
|
|
47
49
|
source={{ uri: event.home?.image?.url }}
|
|
48
50
|
style={{ height:30, width:30 }}
|
|
49
51
|
resizeMode='cover'
|
|
50
52
|
/>
|
|
51
53
|
</View>
|
|
52
|
-
<View style={{ flex:1, marginLeft:10 }}>
|
|
53
|
-
<Text theme='
|
|
54
|
-
<Text style={{ marginTop:3 }} theme='
|
|
54
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
55
|
+
<Text theme='h2'>{event.event_title}</Text>
|
|
56
|
+
<Text style={{ marginTop:3 }} theme='description'>{event.time_detail == 'scheduled' ? moment(event.scheduled_datetime).format('MMM DD hh:mm a') : event.time_detail}</Text>
|
|
55
57
|
</View>
|
|
56
58
|
</View>
|
|
57
59
|
:<></>}
|
|
58
|
-
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
59
|
-
<Icons.SquaresIcon size={24} color={Colors.
|
|
60
|
-
<Text style={{ marginTop:3 }} theme='
|
|
60
|
+
<View transparent style={{ justifyContent:'center', alignItems:'center' }}>
|
|
61
|
+
<Icons.SquaresIcon size={24} color={Colors.text.h1} />
|
|
62
|
+
<Text style={{ marginTop:3 }} theme='h2'>AUCTION</Text>
|
|
61
63
|
</View>
|
|
62
64
|
</View>
|
|
63
65
|
</View>
|
|
64
|
-
<View style={{
|
|
66
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
65
67
|
{company ?
|
|
66
68
|
<Image
|
|
67
69
|
source={{ uri: company.company_image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
@@ -75,17 +77,19 @@ const SquaresCompetitionCard = ({ squares_competition, admin, event, company, on
|
|
|
75
77
|
resizeMode='cover'
|
|
76
78
|
/>
|
|
77
79
|
:<></>}
|
|
78
|
-
<View style={{ flex:1, marginLeft:20, marginRight:20 }}>
|
|
79
|
-
<Text theme='
|
|
80
|
-
{
|
|
81
|
-
<Text style={{ marginTop:3 }} color={Colors.
|
|
80
|
+
<View transparent style={{ flex:1, marginLeft:20, marginRight:20 }}>
|
|
81
|
+
<Text theme='h2'>{is_closed ? 'TOTAL PAID OUT': 'CURRENT PAYOUT'}</Text>
|
|
82
|
+
{is_closed ?
|
|
83
|
+
<Text style={{ marginTop:3 }} color={Colors.text.gold} weight='bold' size={12}>COMPLETED</Text>
|
|
84
|
+
:is_live ?
|
|
85
|
+
<Text style={{ marginTop:3 }} color={Colors.text.error} weight='bold' size={12}>AUCTION COMPLETE</Text>
|
|
82
86
|
:
|
|
83
|
-
<Text style={{ marginTop:3 }} theme='
|
|
87
|
+
<Text style={{ marginTop:3 }} theme='light'>Auction Ends {moment(squares_competition.begin_datetime).fromNow()}</Text>
|
|
84
88
|
}
|
|
85
89
|
</View>
|
|
86
|
-
<Text color={Colors.
|
|
90
|
+
<Text color={Colors.text.success} size={20} weight='bold'>${current_payout.toFixed(2)}</Text>
|
|
87
91
|
</View>
|
|
88
|
-
</
|
|
92
|
+
</Button>
|
|
89
93
|
)
|
|
90
94
|
}
|
|
91
95
|
|