be-components 3.5.7 → 3.5.9

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 (128) hide show
  1. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js +52 -75
  2. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js.map +1 -1
  3. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +135 -119
  4. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  5. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js +69 -62
  6. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js.map +1 -1
  7. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +86 -91
  8. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  9. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +143 -150
  10. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  11. package/lib/commonjs/CompetitionManager/components/ContestSelector.js +57 -61
  12. package/lib/commonjs/CompetitionManager/components/ContestSelector.js.map +1 -1
  13. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +120 -266
  14. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  15. package/lib/commonjs/CompetitionManager/components/MarketSelector.js +35 -32
  16. package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -1
  17. package/lib/commonjs/CompetitionManager/components/PlayerSelector.js +42 -39
  18. package/lib/commonjs/CompetitionManager/components/PlayerSelector.js.map +1 -1
  19. package/lib/commonjs/CompetitionManager/index.js +47 -50
  20. package/lib/commonjs/CompetitionManager/index.js.map +1 -1
  21. package/lib/commonjs/MarketComponents/components/OrderBook.js +1 -0
  22. package/lib/commonjs/MarketComponents/components/OrderBook.js.map +1 -1
  23. package/lib/commonjs/ProfileManager/Components/VouchCard.js +56 -3
  24. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  25. package/lib/commonjs/ProfileManager/Components/Vouchhtml.js +86 -0
  26. package/lib/commonjs/ProfileManager/Components/Vouchhtml.js.map +1 -0
  27. package/lib/module/CompetitionManager/components/AthleteSelector.js +42 -65
  28. package/lib/module/CompetitionManager/components/AthleteSelector.js.map +1 -1
  29. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +93 -77
  30. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  31. package/lib/module/CompetitionManager/components/CompetitionHeader.js +47 -40
  32. package/lib/module/CompetitionManager/components/CompetitionHeader.js.map +1 -1
  33. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +59 -64
  34. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  35. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +108 -115
  36. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  37. package/lib/module/CompetitionManager/components/ContestSelector.js +34 -38
  38. package/lib/module/CompetitionManager/components/ContestSelector.js.map +1 -1
  39. package/lib/module/CompetitionManager/components/ContestSettingsForm.js +90 -237
  40. package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  41. package/lib/module/CompetitionManager/components/MarketSelector.js +26 -23
  42. package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -1
  43. package/lib/module/CompetitionManager/components/PlayerSelector.js +30 -27
  44. package/lib/module/CompetitionManager/components/PlayerSelector.js.map +1 -1
  45. package/lib/module/CompetitionManager/index.js +32 -35
  46. package/lib/module/CompetitionManager/index.js.map +1 -1
  47. package/lib/module/MarketComponents/components/OrderBook.js +1 -0
  48. package/lib/module/MarketComponents/components/OrderBook.js.map +1 -1
  49. package/lib/module/ProfileManager/Components/VouchCard.js +56 -3
  50. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  51. package/lib/module/ProfileManager/Components/Vouchhtml.js +80 -0
  52. package/lib/module/ProfileManager/Components/Vouchhtml.js.map +1 -0
  53. package/lib/typescript/lib/commonjs/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  54. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts +1 -2
  55. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  56. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  57. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts +1 -2
  58. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  59. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  60. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  61. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  63. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  64. package/lib/typescript/lib/commonjs/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  65. package/lib/typescript/lib/commonjs/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  66. package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts +2 -1
  67. package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts.map +1 -1
  68. package/lib/typescript/lib/commonjs/MarketComponents/components/OrderBook.d.ts.map +1 -1
  69. package/lib/typescript/lib/commonjs/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  70. package/lib/typescript/lib/commonjs/ProfileManager/Components/Vouchhtml.d.ts +9 -0
  71. package/lib/typescript/lib/commonjs/ProfileManager/Components/Vouchhtml.d.ts.map +1 -0
  72. package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts +1 -2
  73. package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  74. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts +2 -4
  75. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  76. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts +1 -2
  77. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  78. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts +2 -4
  79. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  80. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts +2 -4
  81. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  82. package/lib/typescript/lib/module/CompetitionManager/components/ContestSelector.d.ts +1 -2
  83. package/lib/typescript/lib/module/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  84. package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts +2 -4
  85. package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  86. package/lib/typescript/lib/module/CompetitionManager/components/MarketSelector.d.ts +1 -2
  87. package/lib/typescript/lib/module/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  88. package/lib/typescript/lib/module/CompetitionManager/components/PlayerSelector.d.ts +1 -2
  89. package/lib/typescript/lib/module/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  90. package/lib/typescript/lib/module/CompetitionManager/index.d.ts +3 -3
  91. package/lib/typescript/lib/module/CompetitionManager/index.d.ts.map +1 -1
  92. package/lib/typescript/lib/module/MarketComponents/components/OrderBook.d.ts.map +1 -1
  93. package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  94. package/lib/typescript/lib/module/ProfileManager/Components/Vouchhtml.d.ts +8 -0
  95. package/lib/typescript/lib/module/ProfileManager/Components/Vouchhtml.d.ts.map +1 -0
  96. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  97. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +1 -1
  98. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  99. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  100. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +1 -1
  101. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  102. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -1
  103. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  104. package/lib/typescript/src/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  105. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts +1 -1
  106. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  107. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  108. package/lib/typescript/src/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  109. package/lib/typescript/src/CompetitionManager/index.d.ts +7 -1
  110. package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -1
  111. package/lib/typescript/src/MarketComponents/components/OrderBook.d.ts.map +1 -1
  112. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  113. package/lib/typescript/src/ProfileManager/Components/Vouchhtml.d.ts +10 -0
  114. package/lib/typescript/src/ProfileManager/Components/Vouchhtml.d.ts.map +1 -0
  115. package/package.json +4 -1
  116. package/src/CompetitionManager/components/AthleteSelector.tsx +32 -52
  117. package/src/CompetitionManager/components/CompetitionContestsForm.tsx +82 -89
  118. package/src/CompetitionManager/components/CompetitionHeader.tsx +45 -37
  119. package/src/CompetitionManager/components/CompetitionInfoForm.tsx +36 -40
  120. package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +88 -96
  121. package/src/CompetitionManager/components/ContestSelector.tsx +33 -36
  122. package/src/CompetitionManager/components/ContestSettingsForm.tsx +58 -179
  123. package/src/CompetitionManager/components/MarketSelector.tsx +19 -21
  124. package/src/CompetitionManager/components/PlayerSelector.tsx +23 -26
  125. package/src/CompetitionManager/index.tsx +22 -25
  126. package/src/MarketComponents/components/OrderBook.tsx +1 -0
  127. package/src/ProfileManager/Components/VouchCard.tsx +46 -2
  128. package/src/ProfileManager/Components/Vouchhtml.ts +87 -0
@@ -1,12 +1,12 @@
1
- import { FlatList, TextInput, TouchableOpacity, View, Image } from "react-native"
1
+ import { Image } from "react-native"
2
2
  import React, { useEffect, useState } from "react";
3
3
  import type { CompetitionProps, CompetitionResultTypeProps, MyPlayerProps, PublicPlayerProps } from "../../types";
4
4
  import { ManageCompetitionApi } from "../api";
5
- import Colors from "../../constants/colors";
6
- import { Button, Icons, Text } from "../../Components";
7
- import { view_styles } from "../../constants/styles";
5
+ import { Icons, Toggle } from "../../Components";
8
6
  import DropDown from "../../Components/Dropdown";
9
7
  import moment from "moment-mini";
8
+ import { Button, Text, TextInput, View } from "../../Components/Themed";
9
+ import { useColors } from "../../constants/useColors";
10
10
 
11
11
  type CompetitionSettingsFormProps = {
12
12
  player?: MyPlayerProps,
@@ -20,12 +20,12 @@ type CompetitionSettingsFormProps = {
20
20
 
21
21
  const market_types = ['FOR_MONEY', 'FREE']
22
22
 
23
- const CompetitionSettingsForm = ({ is_valid, player, width, competition, competition_result_types, onCompetitionUpdate, onShowPacers }: CompetitionSettingsFormProps) => {
23
+ const CompetitionSettingsForm = ({ is_valid, player, competition, competition_result_types, onCompetitionUpdate, onShowPacers }: CompetitionSettingsFormProps) => {
24
24
  const [ expanded, setExpanded ] = useState(false);
25
25
  const [ draft_competition, setDraftCompetition ] = useState<CompetitionProps | undefined>(undefined);
26
26
  //const [ player_selector_visible, setPlayerSelectorVisible ] = useState(false);
27
27
  const [ pacer, setPacer ] = useState<PublicPlayerProps | MyPlayerProps>();
28
-
28
+ const Colors = useColors();
29
29
  const competition_result_type = competition_result_types.find(crt => crt.competition_result_type_id == competition?.competition_result_type_id);
30
30
 
31
31
  useEffect(() => {
@@ -51,71 +51,58 @@ const CompetitionSettingsForm = ({ is_valid, player, width, competition, competi
51
51
  setPacer(ps[0])
52
52
  }
53
53
 
54
- const renderMarketTypes = (data:{ item:string, index:number }) => {
55
- if(!draft_competition){ return <></> }
56
- const selected = data.item == competition.market_type ? true : false
57
- return (
58
- <TouchableOpacity
59
- disabled={competition.competition_season_id ? true : false}
60
- style={{ minWidth:75, margin:1, borderRadius:8, padding:10, backgroundColor:selected?Colors.brand.midnight:undefined }} onPress={() => onCompetitionUpdate({ ...draft_competition, market_type: data.item })}>
61
- <Text textAlign="center" color={selected?Colors.shades.white:Colors.brand.midnight} weight={selected?'bold':'regular'} size={14}>{data.item == 'FOR_MONEY'?'USD':'EDGE COINS'}</Text>
62
- </TouchableOpacity>
63
- )
64
- }
65
-
66
54
 
67
55
  if(!competition || !draft_competition){ return <></> }
68
56
  const is_changed = JSON.stringify(competition) != JSON.stringify(draft_competition) ? true : false
69
57
 
70
58
  return (
71
- <View style={{ ...view_styles.section, flexGrow:1 }}>
72
- <TouchableOpacity style={{ ...view_styles.section_header, maxWidth: width }} onPress={() => setExpanded(!expanded)}>
59
+ <View float style={{ flexGrow:1, borderRadius:0 }}>
60
+ <Button float style={{ flexDirection:'row', alignItems:'center', borderRadius:0 }} onPress={() => setExpanded(!expanded)}>
73
61
  {is_valid ?
74
- <Icons.CheckCirlceIcon size={16} color={Colors.utility.success} />
62
+ <Icons.CheckCirlceIcon size={16} color={Colors.text.success} />
75
63
  :
76
- <Icons.AlertIcon size={16} color={Colors.utility.warning} />
64
+ <Icons.AlertIcon size={16} color={Colors.text.warning} />
77
65
  }
78
- <View style={{ flex:1, marginLeft:10 }}>
79
- <Text theme='header'>Competition Settings</Text>
80
- <Text style={{ marginTop:3 }} theme='body'>Manage the high level information of this competition</Text>
66
+ <View transparent style={{ flex:1, marginLeft:10 }}>
67
+ <Text theme='h1'>Competition Settings</Text>
68
+ <Text style={{ marginTop:3 }} theme='description'>Manage the high level information of this competition</Text>
81
69
  </View>
82
70
  {is_changed ?
83
71
  <Button
84
72
  title='SAVE'
85
- padding={10}
86
- title_color={Colors.shades.white}
87
- backgroundColor={Colors.utility.success}
73
+ type='success'
88
74
  onPress={() => onCompetitionUpdate(draft_competition)}
89
75
  />
90
76
  :
91
- <Icons.ChevronIcon direction={expanded ? 'up' : 'down'} color={Colors.brand.midnight} size={8} />
77
+ <Icons.ChevronIcon direction={expanded ? 'up' : 'down'} color={Colors.text.h1} size={8} />
92
78
  }
93
- </TouchableOpacity>
79
+ </Button>
94
80
  {expanded ?
95
- <View nativeID="competition_settings" style={{ ...view_styles.section_body, maxWidth:width, backgroundColor:Colors.shades.shade100 }}>
81
+ <View type='body' nativeID="competition_settings" style={{ flexGrow:1 }}>
96
82
 
97
-
98
- <View nativeID="competition_currency" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width}}>
99
- <View style={{ flex:1, margin:5, minWidth:200 }}>
100
- <Text theme="header_2">Competition Currency</Text>
101
- <Text style={{ marginTop:3 }} theme="body">Is the ticket price in real-money or edge coins?</Text>
83
+ <View nativeID="competition_currency" style={{ padding:10, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
84
+ <View style={{ margin:5, minWidth:200 }}>
85
+ <Text theme="h1">Competition Currency</Text>
86
+ <Text style={{ marginTop:3 }} theme="description">Is the ticket price in real-money or edge coins?</Text>
102
87
  </View>
103
- <View style={{ justifyContent:'flex-end', margin: 5, borderRadius:8, backgroundColor:Colors.shades.white }}>
104
- <FlatList
105
- data={market_types}
106
- renderItem={renderMarketTypes}
107
- keyExtractor={(item) => item}
108
- horizontal
88
+ <View style={{ justifyContent:'flex-end', margin: 5, borderRadius:8 }}>
89
+ <Toggle
90
+ options={market_types.map(t => {
91
+ return { key: t, label: t }
92
+ })}
93
+ onSelectOption={(key) => onCompetitionUpdate({ ...draft_competition, market_type: key})}
94
+ selected_option={competition.market_type}
109
95
  />
96
+
110
97
  </View>
111
98
  </View>
112
-
113
- <View nativeID="competition_payout" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width}}>
114
- <View style={{ flex:1, margin:5, minWidth:200 }}>
115
- <Text theme="header_2">Competition Payout Type</Text>
116
- <Text style={{ marginTop:3 }} theme="body">{competition_result_type?competition_result_type.description:'Choose the type of payout for this competition'}</Text>
99
+ <View style={{borderBottomWidth:1, borderBottomColor:Colors.borders.light, padding:10}}>
100
+ <View type='row' nativeID="competition_payout" style={{ flexWrap:'wrap' }}>
101
+ <View transparent style={{ flex:1, minWidth:200 }}>
102
+ <Text theme="h1">Competition Payout Type</Text>
103
+ <Text style={{ marginTop:3 }} theme="description">{competition_result_type?competition_result_type.description:'Choose the type of payout for this competition'}</Text>
117
104
  </View>
118
- <View style={{ justifyContent:'flex-end', margin:5, borderRadius:8, backgroundColor:Colors.shades.white }}>
105
+ <View transparent style={{ flex:1, justifyContent:'flex-end', margin:5, borderRadius:8 }}>
119
106
  <DropDown
120
107
  read_only={competition.competition_season_id ? true : false}
121
108
  dropdown_options={[
@@ -131,82 +118,87 @@ const CompetitionSettingsForm = ({ is_valid, player, width, competition, competi
131
118
  </View>
132
119
  </View>
133
120
  {competition_result_type?.type == 'outpace' ?
134
- <TouchableOpacity
135
- disabled={competition.competition_season_id ? true : false}
136
- style={{ backgroundColor:Colors.shades.white, borderRadius:8, padding:10 }} onPress={() => onShowPacers()}>
137
- {pacer ?
138
- <View style={{ ...view_styles.body_row }}>
139
- <Icons.PacerCarIcon size={24} color={Colors.brand.midnight} />
140
- <Image
141
- source={{ uri: pacer.profile_pic && pacer.profile_pic != '' ? pacer.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
142
- style={{ height:40, width:40, borderRadius:4, marginLeft:10 }}
143
- resizeMode="cover"
144
- />
145
- <View style={{ flex:1, marginLeft:10 }}>
146
- <Text theme="header_2">@{pacer.username}</Text>
147
- <Text style={{ marginTop:3 }} theme="body">Joined {moment(pacer.create_datetime).format('MMM YYYY')}</Text>
121
+ <View transparent style={{ marginTop:10 }}>
122
+ <Text style={{ marginBottom:10 }} theme="h1">Select a Pacer</Text>
123
+ <Button
124
+ float
125
+ disabled={competition.competition_season_id ? true : false}
126
+ style={{ borderRadius:8, padding:10 }} onPress={() => onShowPacers()}>
127
+ {pacer ?
128
+ <View transparent type='row'>
129
+ <Icons.PacerCarIcon size={24} color={Colors.text.h1} />
130
+ <Image
131
+ source={{ uri: pacer.profile_pic && pacer.profile_pic != '' ? pacer.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
132
+ style={{ height:40, width:40, borderRadius:4, marginLeft:10 }}
133
+ resizeMode="cover"
134
+ />
135
+ <View transparent style={{ flex:1, marginLeft:10 }}>
136
+ <Text theme="h2">@{pacer.username}</Text>
137
+ <Text style={{ marginTop:3 }} theme="description">Joined {moment(pacer.create_datetime).format('MMM YYYY')}</Text>
138
+ </View>
139
+ <Icons.ChevronIcon direction="right" color={Colors.text.h1} size={8} />
148
140
  </View>
149
- <Icons.ChevronIcon direction="right" color={Colors.brand.midnight} size={8} />
150
- </View>
151
- :
152
- <View style={{ ...view_styles.body_row }}>
153
- <Icons.AlertIcon size={20} color={Colors.utility.warning} />
154
- <Image
155
- source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
156
- style={{ height:40, width:40, borderRadius:4, marginLeft:10 }}
157
- resizeMode="cover"
158
- />
159
- <View style={{ flex:1, marginLeft:10 }}>
160
- <Text theme="header_2">Select A Pacer!</Text>
141
+ :
142
+ <View type='row'>
143
+ <Icons.AlertIcon size={20} color={Colors.text.warning} />
144
+ <Image
145
+ source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
146
+ style={{ height:40, width:40, borderRadius:4, marginLeft:10 }}
147
+ resizeMode="cover"
148
+ />
149
+ <View style={{ flex:1, marginLeft:10 }}>
150
+ <Text theme="h2">Select A Pacer!</Text>
151
+ </View>
152
+ <Icons.ChevronIcon direction="right" color={Colors.text.h1} size={8} />
161
153
  </View>
162
- <Icons.ChevronIcon direction="right" color={Colors.brand.midnight} size={8} />
163
- </View>
164
- }
165
- </TouchableOpacity>
154
+ }
155
+ </Button>
156
+ </View>
166
157
  :<></>}
167
- <View nativeID="buy_in" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width}}>
168
- <View style={{ flex:1, margin:5, minWidth:200 }}>
169
- <Text theme="header_2">Ticket Price</Text>
170
- <Text style={{ marginTop:3 }} theme="body">Set the amount required to purchase a ticket to participate</Text>
158
+ </View>
159
+ <View type='row' nativeID="buy_in" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
160
+ <View style={{ flex:1, minWidth:200 }}>
161
+ <Text theme="h1">Ticket Price</Text>
162
+ <Text style={{ marginTop:3 }} theme="description">Set the amount required to purchase a ticket to participate</Text>
171
163
  </View>
172
164
  <TextInput
173
- style={{ ...view_styles.input, textAlign:'center', margin:5, width:100, backgroundColor:Colors.shades.white }}
165
+ style={{ flex:1, textAlign:'center', width:100 }}
174
166
  onChangeText={(text) => setDraftCompetition({ ...draft_competition, buy_in: text })}
175
167
  placeholder="0"
168
+ keyboardType="decimal-pad"
176
169
  editable={competition.competition_season_id ? false : true}
177
170
  value={draft_competition.buy_in as string}
178
- placeholderTextColor={Colors.brand.slate}
179
171
  />
180
172
  </View>
181
173
  {player?.role == 'admin' ?
182
- <View nativeID="buy_in" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width}}>
183
- <View style={{ flex:1, margin:5, minWidth:200 }}>
184
- <Text theme="header_2">Guaranteed Payout</Text>
185
- <Text style={{ marginTop:3 }} theme="body">ADMIN ONLY - How much is guaranteed to be paid out?</Text>
174
+ <View type='row' nativeID="buy_in" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
175
+ <View style={{ flex:1, minWidth:200 }}>
176
+ <Text theme="h1">Guaranteed Payout</Text>
177
+ <Text style={{ marginTop:3 }} theme="description">ADMIN ONLY - How much is guaranteed to be paid out?</Text>
186
178
  </View>
187
179
  <TextInput
188
- style={{ ...view_styles.input, textAlign:'center', margin:5, width:100, backgroundColor:Colors.shades.white }}
180
+ style={{ flex:1, textAlign:'center', width:100 }}
189
181
  onChangeText={(text) => setDraftCompetition({ ...draft_competition, guaranteed_payout: text })}
190
182
  placeholder="0"
183
+ keyboardType="decimal-pad"
191
184
  editable={competition.competition_season_id ? false : true}
192
185
  value={draft_competition.guaranteed_payout as string}
193
- placeholderTextColor={Colors.brand.slate}
194
186
  />
195
187
  </View>
196
188
  :<></>}
197
189
 
198
- <View nativeID="Max Tickets" style={{ flexDirection:'row', flexWrap:'wrap', padding:10, borderBottomWidth:1, borderBottomColor:Colors.shades.white }}>
199
- <View style={{ flex:1, marginRight:5 }}>
200
- <Text theme="header_2">Max Tickets</Text>
201
- <Text style={{ marginTop:3 }} theme="body">Maximum number of tickets that can be sold</Text>
190
+ <View type='row' nativeID="Max Tickets" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
191
+ <View style={{ flex:1, marginRight:5, minWidth:200 }}>
192
+ <Text theme="h1">Max Tickets</Text>
193
+ <Text style={{ marginTop:3 }} theme="description">Maximum number of tickets that can be sold</Text>
202
194
  </View>
203
195
  <TextInput
204
- style={{ ...view_styles.input, textAlign:'center', width:100, backgroundColor:Colors.shades.white }}
196
+ style={{ flex:1, textAlign:'center', width:100 }}
205
197
  onChangeText={(text) => setDraftCompetition({ ...draft_competition, available_tickets: text })}
206
198
  placeholder="100"
199
+ keyboardType="decimal-pad"
207
200
  editable={competition.competition_season_id ? false : true}
208
201
  value={draft_competition.available_tickets as string}
209
- placeholderTextColor={Colors.brand.slate}
210
202
  />
211
203
  </View>
212
204
  </View>
@@ -1,13 +1,13 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, FlatList, TouchableOpacity, ScrollView, Image, ActivityIndicator } from "react-native"
3
- import Colors from '../../constants/colors';
4
- import { view_styles } from '../../constants/styles';
5
- import { Button, Switch, Text } from '../../Components';
2
+ import { FlatList, ScrollView, Image, ActivityIndicator } from "react-native"
3
+ import { Switch } from '../../Components';
6
4
  import DropDown from '../../Components/Dropdown';
7
5
  import type { EventProps, LeagueProps } from '../../types';
8
6
  import { ManageCompetitionMatchApi } from '../api';
9
7
  import moment from 'moment-mini';
10
8
  import SearchBox from '../../Components/SearchBox';
9
+ import { useColors } from '../../constants/useColors';
10
+ import { Button, Text, View } from '../../Components/Themed';
11
11
 
12
12
  type ContestSelectorProps = {
13
13
  width: number,
@@ -22,6 +22,7 @@ type ContestSelectorProps = {
22
22
  }
23
23
 
24
24
  const ContestSelector = ({ action_loading, width, height, leagues, selected_team_events, onClose, onSelectTeamEvent, onDeselectTeamEvent, onSelectTeamEvents }:ContestSelectorProps) => {
25
+ const Colors = useColors();
25
26
  const [ search_value, setSearchValue ] = useState('');
26
27
  const [ filters, setFilters ] = useState<{
27
28
  ranked?:boolean,
@@ -96,17 +97,17 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
96
97
  const renderDivisions = (data: { item:string, index:number }) => {
97
98
  const selected = filters.division == data.item ? true : false
98
99
  return (
99
- <TouchableOpacity style={{ padding:10 }} onPress={() => selected ? setFilters({ ...filters, division: undefined }) : setFilters({ ...filters, division:data.item })}>
100
- <Text color={selected ? Colors.brand.midnight : Colors.brand.slate} weight={selected ? 'bold': 'regular'}>{data.item}</Text>
101
- </TouchableOpacity>
100
+ <Button style={{ padding:10 }} onPress={() => selected ? setFilters({ ...filters, division: undefined }) : setFilters({ ...filters, division:data.item })}>
101
+ <Text theme={selected?'h1':'description'}>{data.item}</Text>
102
+ </Button>
102
103
  )
103
104
  }
104
105
  const renderSubDivisions = (data: { item:string, index:number }) => {
105
106
  const selected = filters.sub_division == data.item ? true : false
106
107
  return (
107
- <TouchableOpacity style={{ padding:10 }} onPress={() => selected ? setFilters({ ...filters, sub_division: undefined }) : setFilters({ ...filters, sub_division:data.item })}>
108
- <Text color={selected ? Colors.brand.midnight : Colors.brand.slate} weight={selected ? 'bold': 'regular'}>{data.item}</Text>
109
- </TouchableOpacity>
108
+ <Button style={{ padding:10 }} onPress={() => selected ? setFilters({ ...filters, sub_division: undefined }) : setFilters({ ...filters, sub_division:data.item })}>
109
+ <Text theme={selected?'h1':'description'}>{data.item}</Text>
110
+ </Button>
110
111
  )
111
112
  }
112
113
 
@@ -114,10 +115,10 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
114
115
  const formatted_date = moment(data.item, 'YYYY/MM/DD')
115
116
  const active = active_date == data.item ? true : false
116
117
  return (
117
- <TouchableOpacity style={{ padding:10, justifyContent:'center', alignItems:'center' }} onPress={() => setData({ ...selector_data, active_date: data.item })}>
118
- <Text size={12} color={Colors.brand.midnight} textAlign='center' weight={active ? 'bold' : 'regular'}>{formatted_date.format('ddd')}</Text>
119
- <Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} textAlign='center' weight={active ? 'bold' : 'regular'}>{formatted_date.format('MMM DD')}</Text>
120
- </TouchableOpacity>
118
+ <Button style={{ padding:10, justifyContent:'center', alignItems:'center' }} onPress={() => setData({ ...selector_data, active_date: data.item })}>
119
+ <Text size={12} theme={active?'h1':'description'} textAlign='center' >{formatted_date.format('ddd')}</Text>
120
+ <Text style={{ marginTop:3 }} size={12} color={Colors.text.h1} textAlign='center' theme={active?'h1':'description'}>{formatted_date.format('MMM DD')}</Text>
121
+ </Button>
121
122
  )
122
123
  }
123
124
 
@@ -125,14 +126,14 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
125
126
  const selected = selected_team_events.map(e => e.event_id.toString()).includes(data.item.event_id.toString()) ? true : false
126
127
  const is_live = moment(data.item.scheduled_datetime).isBefore(moment()) ? true : false
127
128
  return (
128
- <View style={{ ...view_styles.body_row, padding:10, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
129
- <View style={{ flexDirection:'row', alignItems:'center', paddingRight:10, borderRightWidth:1, borderColor:Colors.shades.shade600 }}>
129
+ <View type='row' style={{ padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
130
+ <View style={{ flexDirection:'row', alignItems:'center', paddingRight:10, borderRightWidth:1, borderColor:Colors.borders.light }}>
130
131
  <Image
131
132
  source={{ uri: data.item.away?.image?.url }}
132
133
  style={{ height:34, width:34, borderRadius:4 }}
133
134
  resizeMode='cover'
134
135
  />
135
- <Text style={{ padding:5 }} theme='body'>VS</Text>
136
+ <Text style={{ padding:5 }} theme='description'>VS</Text>
136
137
  <Image
137
138
  source={{ uri: data.item.home?.image?.url }}
138
139
  style={{ height:34, width:34, borderRadius:4 }}
@@ -140,8 +141,8 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
140
141
  />
141
142
  </View>
142
143
  <View style={{ flex:1, marginLeft: 10 }}>
143
- <Text theme='header_2'>{data.item.event_title}</Text>
144
- <Text style={{ marginTop:3 }} theme='body'>{data.item.time_detail == 'scheduled' ? moment(data.item.scheduled_datetime).format('MMM DD hh:mm a'): data.item.time_detail}</Text>
144
+ <Text theme='h2'>{data.item.event_title}</Text>
145
+ <Text style={{ marginTop:3 }} theme='description'>{data.item.time_detail == 'scheduled' ? moment(data.item.scheduled_datetime).format('MMM DD hh:mm a'): data.item.time_detail}</Text>
145
146
  </View>
146
147
  {!is_live ?
147
148
  <Switch
@@ -159,8 +160,8 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
159
160
  }
160
161
 
161
162
  return (
162
- <View style={{ ...view_styles.section, margin:0, width, height }}>
163
- <View style={{ ...view_styles.section_header, zIndex: 1}}>
163
+ <View style={{ margin:0, width, height }}>
164
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
164
165
  {active_league ?
165
166
  <Image
166
167
  source={{ uri: active_league.league_image }}
@@ -168,11 +169,11 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
168
169
  resizeMode='cover'
169
170
  />
170
171
  :<></>}
171
- <View style={{ flex:1, marginRight:50 }}>
172
- <Text theme='header'>MANAGE CONTESTS</Text>
173
- <Text style={{ marginTop:3 }} theme='body'>Add / Remove contests from the competition</Text>
172
+ <View transparent style={{ flex:1, marginRight:50 }}>
173
+ <Text theme='h1'>MANAGE CONTESTS</Text>
174
+ <Text style={{ marginTop:3 }} theme='description'>Add / Remove contests from the competition</Text>
174
175
  </View>
175
- <View style={{ position: 'absolute', top:10, right:10, justifyContent:'center', alignItems:'center' }}>
176
+ <View style={{ position: 'absolute', zIndex:1, top:10, right:10, justifyContent:'center', alignItems:'center' }}>
176
177
  <DropDown
177
178
  dropdown_options={[
178
179
  {value:'league_id', eligible_options: leagues.sort((a,b) => a.priority - b.priority).map(l => l.league_name)}
@@ -203,9 +204,9 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
203
204
  {divisions.length > 1 ?
204
205
  <View nativeID='filters' style={{ flexDirection:'row' }}>
205
206
  {show_ranked ?
206
- <TouchableOpacity style={{ padding:10 }} onPress={() => filters.ranked ? setFilters({ ...filters, ranked: false }) : setFilters({ ...filters, ranked: true })}>
207
- <Text color={filters.ranked ? Colors.brand.midnight : Colors.brand.slate} weight={filters.ranked ? 'bold': 'regular'}>Top 25</Text>
208
- </TouchableOpacity>
207
+ <Button style={{ padding:10 }} onPress={() => filters.ranked ? setFilters({ ...filters, ranked: false }) : setFilters({ ...filters, ranked: true })}>
208
+ <Text theme={filters.ranked ? 'h1':'description'}>Top 25</Text>
209
+ </Button>
209
210
  :<></>}
210
211
  <FlatList
211
212
  data={divisions}
@@ -227,7 +228,7 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
227
228
  :<></>}
228
229
  <View style={{ padding:10 }}>
229
230
  {loading ?
230
- <ActivityIndicator style={{ padding:20, alignSelf:'center' }} size='large' color={Colors.brand.midnight} />
231
+ <ActivityIndicator style={{ padding:20, alignSelf:'center' }} size='large' color={Colors.text.h1} />
231
232
  :<></>}
232
233
  <FlatList
233
234
  data={filtered_events}
@@ -236,16 +237,14 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
236
237
  />
237
238
  </View>
238
239
  </ScrollView>
239
- <View style={{ ...view_styles.section_footer, flexDirection:'row' }}>
240
+ <View type='footer' style={{ flexDirection:'row' }}>
240
241
  {filtered_events.length > 0 ?
241
242
  <Button
242
243
  title='ADD ALL'
243
244
  style={{ flex:2, marginRight:10, opacity:!show_add_all || action_loading?0.5:1 }}
244
245
  loading={action_loading}
245
246
  disabled={!show_add_all || action_loading}
246
- padding={15}
247
- title_color={Colors.shades.white}
248
- backgroundColor={Colors.brand.electric}
247
+ type='success'
249
248
  onPress={() => {
250
249
  ///First remove any event that is already selected
251
250
  let add_events = filtered_events.filter(e => !selected_team_events.map(e => e.event_id.toString()).includes(e.event_id))
@@ -256,9 +255,7 @@ const ContestSelector = ({ action_loading, width, height, leagues, selected_team
256
255
  <Button
257
256
  title='CLOSE'
258
257
  style={{ flex:1 }}
259
- padding={15}
260
- title_color={Colors.shades.white}
261
- backgroundColor={Colors.utility.error}
258
+ type='error'
262
259
  onPress={() => onClose()}
263
260
  />
264
261
  </View>