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.
Files changed (116) hide show
  1. package/lib/commonjs/Components/Icons.js +30 -0
  2. package/lib/commonjs/Components/Icons.js.map +1 -1
  3. package/lib/commonjs/Components/SearchBox.js +17 -23
  4. package/lib/commonjs/Components/SearchBox.js.map +1 -1
  5. package/lib/commonjs/Components/Themed.js +2 -2
  6. package/lib/commonjs/Components/Themed.js.map +1 -1
  7. package/lib/commonjs/Engage/components/BracketCompetitionCard.js +75 -58
  8. package/lib/commonjs/Engage/components/BracketCompetitionCard.js.map +1 -1
  9. package/lib/commonjs/Engage/components/CompanyCard.js +31 -26
  10. package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -1
  11. package/lib/commonjs/Engage/components/CompetitionCard.js +85 -68
  12. package/lib/commonjs/Engage/components/CompetitionCard.js.map +1 -1
  13. package/lib/commonjs/Engage/components/EngageHeader.js +62 -36
  14. package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -1
  15. package/lib/commonjs/Engage/components/PrivateCodePrompt.js +47 -45
  16. package/lib/commonjs/Engage/components/PrivateCodePrompt.js.map +1 -1
  17. package/lib/commonjs/Engage/components/SquaresCompetitionCard.js +69 -56
  18. package/lib/commonjs/Engage/components/SquaresCompetitionCard.js.map +1 -1
  19. package/lib/commonjs/Engage/index.js +262 -259
  20. package/lib/commonjs/Engage/index.js.map +1 -1
  21. package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +69 -46
  22. package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
  23. package/lib/commonjs/constants/styles.js +1 -1
  24. package/lib/commonjs/constants/styles.js.map +1 -1
  25. package/lib/commonjs/constants/useColors.js +6 -3
  26. package/lib/commonjs/constants/useColors.js.map +1 -1
  27. package/lib/module/Components/Icons.js +30 -0
  28. package/lib/module/Components/Icons.js.map +1 -1
  29. package/lib/module/Components/SearchBox.js +11 -17
  30. package/lib/module/Components/SearchBox.js.map +1 -1
  31. package/lib/module/Components/Themed.js +2 -2
  32. package/lib/module/Components/Themed.js.map +1 -1
  33. package/lib/module/Engage/components/BracketCompetitionCard.js +52 -35
  34. package/lib/module/Engage/components/BracketCompetitionCard.js.map +1 -1
  35. package/lib/module/Engage/components/CompanyCard.js +27 -21
  36. package/lib/module/Engage/components/CompanyCard.js.map +1 -1
  37. package/lib/module/Engage/components/CompetitionCard.js +57 -40
  38. package/lib/module/Engage/components/CompetitionCard.js.map +1 -1
  39. package/lib/module/Engage/components/EngageHeader.js +53 -27
  40. package/lib/module/Engage/components/EngageHeader.js.map +1 -1
  41. package/lib/module/Engage/components/PrivateCodePrompt.js +36 -33
  42. package/lib/module/Engage/components/PrivateCodePrompt.js.map +1 -1
  43. package/lib/module/Engage/components/SquaresCompetitionCard.js +51 -38
  44. package/lib/module/Engage/components/SquaresCompetitionCard.js.map +1 -1
  45. package/lib/module/Engage/index.js +262 -259
  46. package/lib/module/Engage/index.js.map +1 -1
  47. package/lib/module/MarketComponents/components/TeamEventMarket/index.js +69 -46
  48. package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
  49. package/lib/module/constants/styles.js +1 -1
  50. package/lib/module/constants/styles.js.map +1 -1
  51. package/lib/module/constants/useColors.js +6 -3
  52. package/lib/module/constants/useColors.js.map +1 -1
  53. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  54. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  55. package/lib/typescript/lib/commonjs/Components/SearchBox.d.ts.map +1 -1
  56. package/lib/typescript/lib/commonjs/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
  57. package/lib/typescript/lib/commonjs/Engage/components/CompanyCard.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/Engage/components/CompetitionCard.d.ts.map +1 -1
  59. package/lib/typescript/lib/commonjs/Engage/components/EngageHeader.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts +1 -2
  61. package/lib/typescript/lib/commonjs/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
  63. package/lib/typescript/lib/commonjs/Engage/index.d.ts +2 -1
  64. package/lib/typescript/lib/commonjs/Engage/index.d.ts.map +1 -1
  65. package/lib/typescript/lib/commonjs/constants/styles.d.ts +1 -1
  66. package/lib/typescript/lib/commonjs/constants/useColors.d.ts +5 -4
  67. package/lib/typescript/lib/commonjs/constants/useColors.d.ts.map +1 -1
  68. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  69. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  70. package/lib/typescript/lib/module/Components/SearchBox.d.ts +1 -2
  71. package/lib/typescript/lib/module/Components/SearchBox.d.ts.map +1 -1
  72. package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts +1 -2
  73. package/lib/typescript/lib/module/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
  74. package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts +1 -2
  75. package/lib/typescript/lib/module/Engage/components/CompanyCard.d.ts.map +1 -1
  76. package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts +1 -2
  77. package/lib/typescript/lib/module/Engage/components/CompetitionCard.d.ts.map +1 -1
  78. package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts +1 -2
  79. package/lib/typescript/lib/module/Engage/components/EngageHeader.d.ts.map +1 -1
  80. package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts +2 -4
  81. package/lib/typescript/lib/module/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
  82. package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts +1 -2
  83. package/lib/typescript/lib/module/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
  84. package/lib/typescript/lib/module/Engage/index.d.ts +3 -3
  85. package/lib/typescript/lib/module/Engage/index.d.ts.map +1 -1
  86. package/lib/typescript/lib/module/constants/useColors.d.ts +71 -0
  87. package/lib/typescript/lib/module/constants/useColors.d.ts.map +1 -1
  88. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  89. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  90. package/lib/typescript/src/Components/SearchBox.d.ts.map +1 -1
  91. package/lib/typescript/src/Engage/components/BracketCompetitionCard.d.ts.map +1 -1
  92. package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -1
  93. package/lib/typescript/src/Engage/components/CompetitionCard.d.ts.map +1 -1
  94. package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -1
  95. package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts +1 -2
  96. package/lib/typescript/src/Engage/components/PrivateCodePrompt.d.ts.map +1 -1
  97. package/lib/typescript/src/Engage/components/SquaresCompetitionCard.d.ts.map +1 -1
  98. package/lib/typescript/src/Engage/index.d.ts +5 -1
  99. package/lib/typescript/src/Engage/index.d.ts.map +1 -1
  100. package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
  101. package/lib/typescript/src/constants/useColors.d.ts +71 -0
  102. package/lib/typescript/src/constants/useColors.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/src/Components/Icons.tsx +16 -0
  105. package/src/Components/SearchBox.tsx +11 -13
  106. package/src/Components/Themed.tsx +3 -3
  107. package/src/Engage/components/BracketCompetitionCard.tsx +34 -31
  108. package/src/Engage/components/CompanyCard.tsx +17 -19
  109. package/src/Engage/components/CompetitionCard.tsx +40 -35
  110. package/src/Engage/components/EngageHeader.tsx +30 -29
  111. package/src/Engage/components/PrivateCodePrompt.tsx +29 -33
  112. package/src/Engage/components/SquaresCompetitionCard.tsx +33 -29
  113. package/src/Engage/index.tsx +191 -187
  114. package/src/MarketComponents/components/TeamEventMarket/index.tsx +55 -44
  115. package/src/constants/styles.ts +1 -1
  116. package/src/constants/useColors.tsx +7 -5
@@ -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 Colors from "../constants/colors";
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={{ flex:1, flexDirection:'row', alignItems:'center', padding:5 }}>
27
- <View style={{ flex:1, flexDirection:'row', alignItems:'center', marginRight:10, borderWidth:1, borderRadius:8, borderColor:Colors.shades.shade400 }}>
28
- <View style={{ padding:10 }}>
29
- <Icons.SearchIcon size={12} color={Colors.brand.midnight} />
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
- placeholderTextColor={Colors.shades.shade400}
35
- style={{ flex:1, padding:10, color:Colors.brand.midnight, fontFamily: 'barlow-semibold', fontSize:14, ...style }}
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
- title_color={Colors.shades.white}
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 { View, Image, TouchableOpacity } from 'react-native';
2
+ import { Image } from 'react-native';
3
3
  import type { BracketCompetitionProps, BracketProps, CompanyProps, CompetitionResultTypeProps, LeagueProps, PublicPlayerProps } from '../../types';
4
- import { view_styles } from '../../constants/styles';
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
- <TouchableOpacity style={{ ...view_styles.section, padding:0, borderWidth:1, borderColor:Colors.shades.shade600 }} onPress={() => onCompetitionSelect(bracket_competition)}>
30
- <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100 }}>
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, borderRightWidth:1, borderRightColor:Colors.shades.shade600 }}>
37
- <Text theme='header_2'>{bracket_competition.competition_name}</Text>
38
- <Text style={{ marginTop:3 }} theme='body'>{bracket_competition.competition_description}</Text>
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.brand.electric} weight='bold'>{cl}{bracket_competition.buy_in}</Text>
41
+ <Text size={20} color={Colors.text.action} weight='bold'>{cl}{bracket_competition.buy_in}</Text>
41
42
  </View>
42
- <View style={{ ...view_styles.section_body }}>
43
- <View style={{ ...view_styles.body_row }}>
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='header_2'>{bracket.bracket_name}</Text>
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.brand.midnight} weight='bold'>{tickets_available}</Text>
59
- <Text style={{ marginTop:3 }} theme='body'>TICKETS</Text>
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.utility.error} weight='bold'>FULL</Text>
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={{ ...view_styles.section_footer, backgroundColor:company?Colors.incentive.gold_faded:Colors.shades.shade100 }}>
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.brand.midnight}>ADDITIONAL PRIZE</Text>
87
- <Text style={{ marginTop:3 }} size={10} color={Colors.incentive.gold} weight='bold'>{bracket_competition.prize_override}</Text>
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.incentive.gold} />
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='header_2'>CURRENT PAYOUT</Text>
103
- {is_live ?
104
- <Text style={{ marginTop:3 }} color={Colors.utility.error} weight='bold' size={12}>IN PROGRESS</Text>
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='body_2'>Join Until {moment(bracket_competition.scheduled_datetime).format('ddd hh:mm a')}</Text>
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.utility.success} size={20} weight='bold'>{cl}{current_payout.toFixed(2)}</Text>
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
- </TouchableOpacity>
116
+ </Button>
114
117
  )
115
118
  }
116
119
 
@@ -1,10 +1,8 @@
1
- import React, { useEffect, useRef } from 'react';
2
- import { View, Image, Linking, TouchableOpacity } from 'react-native';
1
+ import React, { useEffect } from 'react';
2
+ import { Image, Linking } from 'react-native';
3
3
  import type { BEEventProps, CompanyProps } from '../../types';
4
- import { view_styles } from '../../constants/styles';
5
- import { Text } from '../../Components';
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
- <TouchableOpacity ref={company_ref} style={{ ...view_styles.section, width:image_width, backgroundColor:company.brand_primary ?? Colors.shades.shade100, borderRadius:8 }}
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={{ flex:1 }}>
52
- <Text size={14} color={Colors.shades.white} weight='bold'>{company.company_name}</Text>
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={{ backgroundColor:Colors.shades.shade100, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
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='cover'
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.shades.white, bottom:0, left:0, right:0, padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
62
- <Text theme='header_2'>{description}</Text>
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
- </TouchableOpacity>
63
+ </Button>
66
64
  )
67
65
  }
68
66
 
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { View, Image, TouchableOpacity } from 'react-native';
2
+ import { Image } from 'react-native';
3
3
  import type { CompanyProps, CompetitionProps, CompetitionResultTypeProps, CompetitionTypeProps, PublicPlayerProps } from '../../types';
4
- import { view_styles } from '../../constants/styles';
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.brand.midnight} />
31
+ return <Icons.SelectorIcon size={20} color={Colors.text.h1} />
30
32
  default: return <></>
31
33
  }
32
34
  }
33
35
 
34
36
  return (
35
- <TouchableOpacity style={{ ...view_styles.section, padding:0, borderWidth:1, borderColor:Colors.shades.shade600 }} onPress={() => onCompetitionSelect(competition)}>
36
- <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100 }}>
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, borderRightWidth:1, borderRightColor:Colors.shades.shade600 }}>
43
- <Text theme='header_2'>{competition.competition_name}</Text>
44
- <Text style={{ marginTop:3 }} theme='body'>{competition.competition_description}</Text>
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.brand.electric} weight='bold'>{cl}{competition.buy_in}</Text>
48
+ <Text size={20} color={Colors.text.action} weight='bold'>{cl}{competition.buy_in}</Text>
47
49
  </View>
48
- <View style={{ ...view_styles.section_body }}>
49
- <View style={{ ...view_styles.body_row }}>
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.brand.midnight} weight='bold'>{tickets_available}</Text>
54
- <Text style={{ marginTop:3 }} theme='body'>TICKETS</Text>
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.utility.error} weight='bold'>FULL</Text>
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.brand.midnight} weight='bold'>{competition.max_pick_count}</Text>
64
- <Text style={{ marginTop:3 }} theme='body'>PICKS</Text>
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.brand.midnight} weight='bold' textAlign='center'>E{competition.initial_balance}</Text>
69
- <Text style={{ marginTop:3 }} size={14} color={Colors.brand.midnight} textAlign='center'>STARTING BALANCE</Text>
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='body'>{competition_type.type_label.toUpperCase()}</Text>
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={{ ...view_styles.section_footer, backgroundColor:company?Colors.incentive.gold_faded:Colors.shades.shade100 }}>
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.brand.midnight}>ADDITIONAL PRIZE</Text>
96
- <Text style={{ marginTop:3 }} size={10} color={Colors.incentive.gold} weight='bold'>{competition.prize_override}</Text>
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.incentive.gold} />
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='header_2'>CURRENT PAYOUT</Text>
112
- {is_live ?
113
- <Text style={{ marginTop:3 }} color={Colors.utility.error} weight='bold' size={12}>IN PROGRESS</Text>
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
- <Text style={{ marginTop:3 }} theme='body_2'>Join Until {moment(competition.scheduled_datetime).format('ddd hh:mm a')}</Text>
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.utility.success} size={20} weight='bold'>{cl}{current_payout.toFixed(2)}</Text>
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
- </TouchableOpacity>
127
+ </Button>
123
128
  )
124
129
  }
125
130
 
@@ -1,13 +1,14 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, Image, FlatList, TouchableOpacity, ActivityIndicator } from "react-native";
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 Colors from '../../constants/colors';
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.brand.midnightTopGradient, Colors.brand.midnight ]} style={{ padding:20, flexDirection:'row', alignItems:'center' }}>
82
- <View style={{ borderRadius:100, height:75, width:75, backgroundColor:Colors.shades.white, justifyContent:'center', alignItems:'center', ...view_styles.float }}>
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.shades.white}>Engage with our partners</Text>
93
- <Text style={{ marginTop:10 }} size={14} weight='regular' color={Colors.shades.white}>Competitions, squares, brackets are all brought to you without fees thanks to our amazing partners.</Text>
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
- title_color={Colors.shades.white}
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 nativeID='brands'>
108
- <TouchableOpacity style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100, borderRadius:0, marginBottom:10 }} onPress={() => setSearch({ ...search, active: !active })}>
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='header'>{active?'Search':'Support'} Our Partners!</Text>
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
- <Text style={{ marginTop:3 }} theme='body'>Use the search box below to find a brand that you're interested in!</Text>
118
+ <Icons.CloseIcon color={Colors.text.error} size={12} />
113
119
  :
114
- <Text style={{ marginTop:3 }} theme='body'>Below are brands that currently have availble competitions!</Text>
120
+ <Icons.SearchIcon color={Colors.text.h1} size={16} />
115
121
  }
116
122
  </View>
117
- {active ?
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.brand.midnight} />
134
+ <ActivityIndicator size='large' color={Colors.text.h1} />
134
135
  :<></>}
135
136
  <FlatList
136
137
  data={filtered_companies}