be-components 6.7.8 → 6.8.0

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 (255) hide show
  1. package/lib/commonjs/Authenticator/index.js +1 -0
  2. package/lib/commonjs/Authenticator/index.js.map +1 -1
  3. package/lib/commonjs/Competition/components/CompetitionInfoCard.js +13 -0
  4. package/lib/commonjs/Competition/components/CompetitionInfoCard.js.map +1 -1
  5. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js +1 -1
  6. package/lib/commonjs/Competition/components/CompetitionLeaderboard.js.map +1 -1
  7. package/lib/commonjs/Competition/index.js +26 -43
  8. package/lib/commonjs/Competition/index.js.map +1 -1
  9. package/lib/commonjs/CompetitionManager/api/index.js +57 -11
  10. package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
  11. package/lib/commonjs/CompetitionManager/components/AdminCompetitionList.js +406 -287
  12. package/lib/commonjs/CompetitionManager/components/AdminCompetitionList.js.map +1 -1
  13. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js +11 -3
  14. package/lib/commonjs/CompetitionManager/components/AthleteSelector.js.map +1 -1
  15. package/lib/commonjs/CompetitionManager/components/CompanySelector.js +94 -0
  16. package/lib/commonjs/CompetitionManager/components/CompanySelector.js.map +1 -0
  17. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js +135 -107
  18. package/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  19. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js +5 -5
  20. package/lib/commonjs/CompetitionManager/components/CompetitionHeader.js.map +1 -1
  21. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +80 -34
  22. package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  23. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js +12 -8
  24. package/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -1
  25. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +36 -30
  26. package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  27. package/lib/commonjs/CompetitionManager/components/ContestSelector.js +4 -2
  28. package/lib/commonjs/CompetitionManager/components/ContestSelector.js.map +1 -1
  29. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +37 -33
  30. package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  31. package/lib/commonjs/CompetitionManager/components/GroupSelector.js +94 -0
  32. package/lib/commonjs/CompetitionManager/components/GroupSelector.js.map +1 -0
  33. package/lib/commonjs/CompetitionManager/components/MarketSelector.js +21 -12
  34. package/lib/commonjs/CompetitionManager/components/MarketSelector.js.map +1 -1
  35. package/lib/commonjs/CompetitionManager/components/PlayerSelector.js +4 -1
  36. package/lib/commonjs/CompetitionManager/components/PlayerSelector.js.map +1 -1
  37. package/lib/commonjs/CompetitionManager/index.js +44 -49
  38. package/lib/commonjs/CompetitionManager/index.js.map +1 -1
  39. package/lib/commonjs/Components/Toggle.js +2 -1
  40. package/lib/commonjs/Components/Toggle.js.map +1 -1
  41. package/lib/commonjs/CreateEngagement/api/index.js +192 -0
  42. package/lib/commonjs/CreateEngagement/api/index.js.map +1 -0
  43. package/lib/commonjs/CreateEngagement/index.js +1400 -0
  44. package/lib/commonjs/CreateEngagement/index.js.map +1 -0
  45. package/lib/commonjs/MarketComponents/api/index.js +51 -1
  46. package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
  47. package/lib/commonjs/MarketComponents/components/LeagueSchedule.js +210 -0
  48. package/lib/commonjs/MarketComponents/components/LeagueSchedule.js.map +1 -0
  49. package/lib/commonjs/constants/useColors.js +1 -1
  50. package/lib/commonjs/constants/useColors.js.map +1 -1
  51. package/lib/commonjs/index.js +7 -0
  52. package/lib/commonjs/index.js.map +1 -1
  53. package/lib/commonjs/types.d.js.map +1 -1
  54. package/lib/module/Authenticator/index.js +1 -0
  55. package/lib/module/Authenticator/index.js.map +1 -1
  56. package/lib/module/Competition/components/CompetitionInfoCard.js +13 -0
  57. package/lib/module/Competition/components/CompetitionInfoCard.js.map +1 -1
  58. package/lib/module/Competition/components/CompetitionLeaderboard.js +1 -1
  59. package/lib/module/Competition/components/CompetitionLeaderboard.js.map +1 -1
  60. package/lib/module/Competition/index.js +26 -43
  61. package/lib/module/Competition/index.js.map +1 -1
  62. package/lib/module/CompetitionManager/api/index.js +57 -11
  63. package/lib/module/CompetitionManager/api/index.js.map +1 -1
  64. package/lib/module/CompetitionManager/components/AdminCompetitionList.js +391 -272
  65. package/lib/module/CompetitionManager/components/AdminCompetitionList.js.map +1 -1
  66. package/lib/module/CompetitionManager/components/AthleteSelector.js +11 -3
  67. package/lib/module/CompetitionManager/components/AthleteSelector.js.map +1 -1
  68. package/lib/module/CompetitionManager/components/CompanySelector.js +87 -0
  69. package/lib/module/CompetitionManager/components/CompanySelector.js.map +1 -0
  70. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js +135 -107
  71. package/lib/module/CompetitionManager/components/CompetitionContestsForm.js.map +1 -1
  72. package/lib/module/CompetitionManager/components/CompetitionHeader.js +5 -5
  73. package/lib/module/CompetitionManager/components/CompetitionHeader.js.map +1 -1
  74. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +80 -34
  75. package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
  76. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js +12 -8
  77. package/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.js.map +1 -1
  78. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +36 -30
  79. package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
  80. package/lib/module/CompetitionManager/components/ContestSelector.js +4 -2
  81. package/lib/module/CompetitionManager/components/ContestSelector.js.map +1 -1
  82. package/lib/module/CompetitionManager/components/ContestSettingsForm.js +37 -33
  83. package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
  84. package/lib/module/CompetitionManager/components/GroupSelector.js +87 -0
  85. package/lib/module/CompetitionManager/components/GroupSelector.js.map +1 -0
  86. package/lib/module/CompetitionManager/components/MarketSelector.js +21 -12
  87. package/lib/module/CompetitionManager/components/MarketSelector.js.map +1 -1
  88. package/lib/module/CompetitionManager/components/PlayerSelector.js +4 -1
  89. package/lib/module/CompetitionManager/components/PlayerSelector.js.map +1 -1
  90. package/lib/module/CompetitionManager/index.js +45 -50
  91. package/lib/module/CompetitionManager/index.js.map +1 -1
  92. package/lib/module/Components/Toggle.js +2 -1
  93. package/lib/module/Components/Toggle.js.map +1 -1
  94. package/lib/module/CreateEngagement/api/index.js +186 -0
  95. package/lib/module/CreateEngagement/api/index.js.map +1 -0
  96. package/lib/module/CreateEngagement/index.js +1392 -0
  97. package/lib/module/CreateEngagement/index.js.map +1 -0
  98. package/lib/module/MarketComponents/api/index.js +51 -1
  99. package/lib/module/MarketComponents/api/index.js.map +1 -1
  100. package/lib/module/MarketComponents/components/LeagueSchedule.js +202 -0
  101. package/lib/module/MarketComponents/components/LeagueSchedule.js.map +1 -0
  102. package/lib/module/constants/useColors.js +1 -1
  103. package/lib/module/constants/useColors.js.map +1 -1
  104. package/lib/module/index.js +2 -1
  105. package/lib/module/index.js.map +1 -1
  106. package/lib/module/types.d.js.map +1 -1
  107. package/lib/typescript/lib/commonjs/Authenticator/index.d.ts.map +1 -1
  108. package/lib/typescript/lib/commonjs/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  109. package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
  110. package/lib/typescript/lib/commonjs/CompetitionManager/api/index.d.ts +9 -4
  111. package/lib/typescript/lib/commonjs/CompetitionManager/api/index.d.ts.map +1 -1
  112. package/lib/typescript/lib/commonjs/CompetitionManager/components/AdminCompetitionList.d.ts +4 -3
  113. package/lib/typescript/lib/commonjs/CompetitionManager/components/AdminCompetitionList.d.ts.map +1 -1
  114. package/lib/typescript/lib/commonjs/CompetitionManager/components/AthleteSelector.d.ts +3 -1
  115. package/lib/typescript/lib/commonjs/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  116. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompanySelector.d.ts +8 -0
  117. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompanySelector.d.ts.map +1 -0
  118. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts +2 -2
  119. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  120. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionHeader.d.ts +2 -1
  121. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  122. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts +3 -2
  123. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  124. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  125. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  126. package/lib/typescript/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  127. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  128. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  129. package/lib/typescript/lib/commonjs/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  130. package/lib/typescript/lib/commonjs/CompetitionManager/components/GroupSelector.d.ts +8 -0
  131. package/lib/typescript/lib/commonjs/CompetitionManager/components/GroupSelector.d.ts.map +1 -0
  132. package/lib/typescript/lib/commonjs/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  133. package/lib/typescript/lib/commonjs/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  134. package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts +4 -1
  135. package/lib/typescript/lib/commonjs/CompetitionManager/index.d.ts.map +1 -1
  136. package/lib/typescript/lib/commonjs/Components/Toggle.d.ts +2 -1
  137. package/lib/typescript/lib/commonjs/Components/Toggle.d.ts.map +1 -1
  138. package/lib/typescript/lib/commonjs/CreateEngagement/api/index.d.ts +39 -0
  139. package/lib/typescript/lib/commonjs/CreateEngagement/api/index.d.ts.map +1 -0
  140. package/lib/typescript/lib/commonjs/CreateEngagement/index.d.ts +18 -0
  141. package/lib/typescript/lib/commonjs/CreateEngagement/index.d.ts.map +1 -0
  142. package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts +8 -0
  143. package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts.map +1 -1
  144. package/lib/typescript/lib/commonjs/MarketComponents/components/LeagueSchedule.d.ts +8 -0
  145. package/lib/typescript/lib/commonjs/MarketComponents/components/LeagueSchedule.d.ts.map +1 -0
  146. package/lib/typescript/lib/commonjs/index.d.ts +1 -0
  147. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  148. package/lib/typescript/lib/module/Authenticator/index.d.ts.map +1 -1
  149. package/lib/typescript/lib/module/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  150. package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
  151. package/lib/typescript/lib/module/CompetitionManager/api/index.d.ts +9 -4
  152. package/lib/typescript/lib/module/CompetitionManager/api/index.d.ts.map +1 -1
  153. package/lib/typescript/lib/module/CompetitionManager/components/AdminCompetitionList.d.ts +5 -5
  154. package/lib/typescript/lib/module/CompetitionManager/components/AdminCompetitionList.d.ts.map +1 -1
  155. package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts +3 -1
  156. package/lib/typescript/lib/module/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  157. package/lib/typescript/lib/module/CompetitionManager/components/CompanySelector.d.ts +8 -0
  158. package/lib/typescript/lib/module/CompetitionManager/components/CompanySelector.d.ts.map +1 -0
  159. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts +2 -2
  160. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  161. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts +2 -1
  162. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  163. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts +3 -2
  164. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  165. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  166. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  167. package/lib/typescript/lib/module/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  168. package/lib/typescript/lib/module/CompetitionManager/components/ContestSelector.d.ts.map +1 -1
  169. package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  170. package/lib/typescript/lib/module/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  171. package/lib/typescript/lib/module/CompetitionManager/components/GroupSelector.d.ts +8 -0
  172. package/lib/typescript/lib/module/CompetitionManager/components/GroupSelector.d.ts.map +1 -0
  173. package/lib/typescript/lib/module/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  174. package/lib/typescript/lib/module/CompetitionManager/components/PlayerSelector.d.ts.map +1 -1
  175. package/lib/typescript/lib/module/CompetitionManager/index.d.ts +4 -1
  176. package/lib/typescript/lib/module/CompetitionManager/index.d.ts.map +1 -1
  177. package/lib/typescript/lib/module/Components/Toggle.d.ts +2 -1
  178. package/lib/typescript/lib/module/Components/Toggle.d.ts.map +1 -1
  179. package/lib/typescript/lib/module/CreateEngagement/api/index.d.ts +38 -0
  180. package/lib/typescript/lib/module/CreateEngagement/api/index.d.ts.map +1 -0
  181. package/lib/typescript/lib/module/CreateEngagement/index.d.ts +18 -0
  182. package/lib/typescript/lib/module/CreateEngagement/index.d.ts.map +1 -0
  183. package/lib/typescript/lib/module/MarketComponents/api/index.d.ts +8 -0
  184. package/lib/typescript/lib/module/MarketComponents/api/index.d.ts.map +1 -1
  185. package/lib/typescript/lib/module/MarketComponents/components/LeagueSchedule.d.ts +8 -0
  186. package/lib/typescript/lib/module/MarketComponents/components/LeagueSchedule.d.ts.map +1 -0
  187. package/lib/typescript/lib/module/index.d.ts +2 -1
  188. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  189. package/lib/typescript/src/Competition/components/CompetitionInfoCard.d.ts.map +1 -1
  190. package/lib/typescript/src/Competition/index.d.ts +1 -1
  191. package/lib/typescript/src/Competition/index.d.ts.map +1 -1
  192. package/lib/typescript/src/CompetitionManager/api/index.d.ts +13 -5
  193. package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
  194. package/lib/typescript/src/CompetitionManager/components/AdminCompetitionList.d.ts +5 -1
  195. package/lib/typescript/src/CompetitionManager/components/AdminCompetitionList.d.ts.map +1 -1
  196. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts +4 -2
  197. package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
  198. package/lib/typescript/src/CompetitionManager/components/CompanySelector.d.ts +10 -0
  199. package/lib/typescript/src/CompetitionManager/components/CompanySelector.d.ts.map +1 -0
  200. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts +1 -2
  201. package/lib/typescript/src/CompetitionManager/components/CompetitionContestsForm.d.ts.map +1 -1
  202. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts +3 -1
  203. package/lib/typescript/src/CompetitionManager/components/CompetitionHeader.d.ts.map +1 -1
  204. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts +4 -3
  205. package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
  206. package/lib/typescript/src/CompetitionManager/components/CompetitionMatchMarketCard.d.ts.map +1 -1
  207. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts +1 -2
  208. package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
  209. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts +1 -2
  210. package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
  211. package/lib/typescript/src/CompetitionManager/components/GroupSelector.d.ts +10 -0
  212. package/lib/typescript/src/CompetitionManager/components/GroupSelector.d.ts.map +1 -0
  213. package/lib/typescript/src/CompetitionManager/components/MarketSelector.d.ts.map +1 -1
  214. package/lib/typescript/src/CompetitionManager/index.d.ts +5 -1
  215. package/lib/typescript/src/CompetitionManager/index.d.ts.map +1 -1
  216. package/lib/typescript/src/Components/Toggle.d.ts +2 -1
  217. package/lib/typescript/src/Components/Toggle.d.ts.map +1 -1
  218. package/lib/typescript/src/CreateEngagement/api/index.d.ts +29 -0
  219. package/lib/typescript/src/CreateEngagement/api/index.d.ts.map +1 -0
  220. package/lib/typescript/src/CreateEngagement/index.d.ts +21 -0
  221. package/lib/typescript/src/CreateEngagement/index.d.ts.map +1 -0
  222. package/lib/typescript/src/MarketComponents/api/index.d.ts +8 -0
  223. package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -1
  224. package/lib/typescript/src/MarketComponents/components/LeagueSchedule.d.ts +10 -0
  225. package/lib/typescript/src/MarketComponents/components/LeagueSchedule.d.ts.map +1 -0
  226. package/lib/typescript/src/index.d.ts +2 -1
  227. package/lib/typescript/src/index.d.ts.map +1 -1
  228. package/package.json +1 -1
  229. package/src/Authenticator/index.tsx +1 -1
  230. package/src/Competition/components/CompetitionInfoCard.tsx +4 -0
  231. package/src/Competition/components/CompetitionLeaderboard.tsx +1 -1
  232. package/src/Competition/index.tsx +16 -29
  233. package/src/CompetitionManager/api/index.ts +49 -6
  234. package/src/CompetitionManager/components/AdminCompetitionList.tsx +247 -176
  235. package/src/CompetitionManager/components/AthleteSelector.tsx +14 -5
  236. package/src/CompetitionManager/components/CompanySelector.tsx +58 -0
  237. package/src/CompetitionManager/components/CompetitionContestsForm.tsx +96 -84
  238. package/src/CompetitionManager/components/CompetitionHeader.tsx +5 -4
  239. package/src/CompetitionManager/components/CompetitionInfoForm.tsx +59 -29
  240. package/src/CompetitionManager/components/CompetitionMatchMarketCard.tsx +9 -14
  241. package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +30 -36
  242. package/src/CompetitionManager/components/ContestSelector.tsx +2 -2
  243. package/src/CompetitionManager/components/ContestSettingsForm.tsx +24 -25
  244. package/src/CompetitionManager/components/GroupSelector.tsx +57 -0
  245. package/src/CompetitionManager/components/MarketSelector.tsx +14 -13
  246. package/src/CompetitionManager/components/PlayerSelector.tsx +1 -1
  247. package/src/CompetitionManager/index.tsx +49 -33
  248. package/src/Components/Toggle.tsx +3 -2
  249. package/src/CreateEngagement/api/index.ts +138 -0
  250. package/src/CreateEngagement/index.tsx +878 -0
  251. package/src/MarketComponents/api/index.ts +60 -1
  252. package/src/MarketComponents/components/LeagueSchedule.tsx +161 -0
  253. package/src/constants/useColors.tsx +1 -1
  254. package/src/index.tsx +2 -0
  255. package/src/types.d.ts +8 -2
@@ -0,0 +1,58 @@
1
+ import React, { useState } from "react";
2
+ import { Button, Text, View } from "../../Components/Themed";
3
+ import { useColors } from "../../constants/useColors";
4
+ import type { CompanyProps } from "../../types";
5
+ import { FlatList, Image } from "react-native";
6
+ import { Icons } from "../../Components";
7
+
8
+
9
+ type CompanySelectorProps = {
10
+ active_company?:CompanyProps,
11
+ companies:CompanyProps[],
12
+ onSelectCompany:(c?:CompanyProps) => void
13
+ }
14
+ const CompanySelector = ({ active_company, companies, onSelectCompany }:CompanySelectorProps) => {
15
+ const Colors = useColors();
16
+ const [ visible, setVisible ] = useState(false);
17
+
18
+ const renderCompanies = (data:{ item:CompanyProps, index:number }) => {
19
+ return (
20
+ <Button
21
+ transparent
22
+ style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:0, borderBottomWidth:1, borderColor:Colors.borders.light }}
23
+ onPress={() => { setVisible(false); onSelectCompany(data.item) }}
24
+ >
25
+ <Image
26
+ source={{ uri: data.item.company_image?.url }}
27
+ style={{ height:40, width:40 }}
28
+ resizeMode='cover'
29
+ />
30
+ <View transparent style={{ flex:1, marginLeft:10 }}>
31
+ <Text theme='h1'>{data.item.company_name}</Text>
32
+ <Text theme='description' style={{ marginTop:3 }}>{data.item.company_description}</Text>
33
+ </View>
34
+ </Button>
35
+ )
36
+ }
37
+
38
+ return (
39
+ <Button float onPress={() => { setVisible(!visible); onSelectCompany(undefined) }}>
40
+ <View transparent style={{ flexDirection:'row', alignItems:'center' }}>
41
+ <Text style={{ flex:1, marginRight:10 }} theme='h1'>{active_company?.company_name ?? 'No Company'}</Text>
42
+ <Icons.ChevronIcon direction={visible?'up':'down'} color={Colors.text.h1} size={8} />
43
+ </View>
44
+ {visible ?
45
+ <View transparent style={{ marginTop:20 }}>
46
+ <FlatList
47
+ data={companies}
48
+ key={'company_selector'}
49
+ keyExtractor={item => item.company_id.toString()}
50
+ renderItem={renderCompanies}
51
+ />
52
+ </View>
53
+ :<></>}
54
+ </Button>
55
+ )
56
+ }
57
+
58
+ export default CompanySelector
@@ -6,12 +6,11 @@ import CompetitionMatchMarketCard from './CompetitionMatchMarketCard';
6
6
  import moment from 'moment-mini';
7
7
  import { Button, Text, View } from '../../Components/Themed';
8
8
  import { useColors } from '../../constants/useColors';
9
-
9
+ import { showConfirmAlert } from '../../Components/ConfirmAlert';
10
10
 
11
11
 
12
12
  type CompetitionContestsFormProps = {
13
13
  action_loading:boolean,
14
- is_valid?:boolean,
15
14
  competition:CompetitionProps,
16
15
  player?:MyPlayerProps,
17
16
  markets:MarketProps[],
@@ -40,8 +39,8 @@ type CompetitionContestsFormProps = {
40
39
 
41
40
 
42
41
  const CompetitionContestsForm = ({
43
- is_valid,
44
42
  competition,
43
+ action_loading,
45
44
  primary_markets,
46
45
  events,
47
46
  athletes,
@@ -82,44 +81,68 @@ const CompetitionContestsForm = ({
82
81
  )
83
82
  }
84
83
 
85
- const renderMarkets = (data: { item:string, index:number, event_id:string, event_type:string }) => {
84
+ const renderMarkets = (data: { item:string, index:number, event_id:string, event_type:string, visible_matches:CompetitionMatchProps[] }) => {
86
85
  const market = markets.find(m => m.market_id == data.item);
87
86
  if(!market){ return <></> }
88
87
  const show_details = show_match_markets.includes(`${data.event_type}:${data.event_id}:${data.item}`) ? true : false
89
-
88
+ const market_matches = competition_matches.filter(cm => cm.market_id_override == data.item && cm.side_id_override);
90
89
  return (
91
- <Button float style={{ flex:1, borderRadius:8, borderWidth:1, borderColor:Colors.borders.light, padding:4, margin:3, minWidth:125 }}
92
- onPress={() => {
93
- if(show_details){ return setShowMatchMarkets(show_match_markets.filter(smm => smm != `${data.event_type}:${data.event_id}:${data.item}`)) }
94
- return setShowMatchMarkets(show_match_markets.concat(`${data.event_type}:${data.event_id}:${data.item}`))
95
- }}>
96
- <View transparent style={{ flexDirection:'row', alignItems:'flex-start' }}>
90
+ <View style={{ flex:1, padding:0, borderBottomWidth:1, borderColor:Colors.borders.light }}>
91
+ <Button transparent style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => {
92
+ if(show_details){ return setShowMatchMarkets(show_match_markets.filter(smm => smm != `${data.event_type}:${data.event_id}:${data.item}`)) }
93
+ return setShowMatchMarkets(show_match_markets.concat(`${data.event_type}:${data.event_id}:${data.item}`))
94
+ }}>
97
95
  <Button
98
96
  title='X'
99
- style={{padding:8}}
100
- type='error'
101
- onPress={async() => {
102
- const confirmed = await confirm('Are you sure you want to delete this market?')
103
- if(!confirmed){ return }
104
- onDeleteMarket(data.event_id, data.event_type, market);
97
+ loading={action_loading}
98
+ style={{padding:10}}
99
+ transparent
100
+ title_color={Colors.text.error}
101
+ onPress={() => {
102
+ showConfirmAlert('Are you sure?', 'This will remove any athlete / team props associated with this market as well.',
103
+ () => onDeleteMarket(data.event_id, data.event_type, market),
104
+ () => console.log('')
105
+ )
105
106
  }}
106
107
  />
107
108
  <View transparent style={{ flex:1 }}>
108
- <Text size={14} theme='h1' weight="bold" textAlign="center">{market.stat_label ?? market.type}</Text>
109
- <Text style={{ marginTop:3 }} size={12} theme='description' textAlign="center">{market.description}</Text>
109
+ <Text theme='h1'>{market.stat_label ?? market.type}</Text>
110
+ <Text style={{ marginTop:3 }} theme='description'>{market.description}</Text>
111
+ {market.level != 'event' && market_matches.length == 0 ?
112
+ <Text style={{ marginTop:3 }} theme='warning'>Please add at least 1 {market.level}</Text>
113
+ :<></>}
110
114
  </View>
111
- </View>
115
+ <View transparent style={{ flexDirection:'row', alignItems:'center', padding:0 }}>
116
+ {market.level != 'event' ?
117
+ <View style={{ margin:5, justifyContent:'center', alignItems:'center' }}>
118
+ <Text theme='h2' size={14} color={Colors.text.action}>{market_matches.length}</Text>
119
+ <Text theme='description' color={Colors.text.action} style={{ marginTop:3 }}>{market.level.toUpperCase()}{market_matches.length == 1 ? '':'S'}</Text>
120
+ </View>
121
+ :
122
+ <View>
123
+ <Icons.ChevronIcon direction={show_details ? 'up' : 'down'} color={Colors.text.action} size={8} />
124
+ </View>
125
+ }
126
+ </View>
127
+ </Button>
112
128
  {market.level == 'athlete' && show_details ?
113
129
  <Button
114
130
  title="ADD ATHLETE"
115
- style={{ marginTop:5 }}
131
+ style={{ padding:10 }}
116
132
  type='success'
117
133
  onPress={() => {
118
134
  onShowAthletes(data.event_id, data.event_type, data.item);
119
135
  }}
120
136
  />
121
137
  :<></>}
122
- </Button>
138
+ {data.visible_matches.length > 0 && show_details ?
139
+ <FlatList
140
+ data={data.visible_matches}
141
+ renderItem={renderCompetitionMatches}
142
+ keyExtractor={(item) => item.competition_match_id.toString()}
143
+ />
144
+ :<></>}
145
+ </View>
123
146
 
124
147
  )
125
148
  }
@@ -153,7 +176,6 @@ const CompetitionContestsForm = ({
153
176
  })
154
177
  }
155
178
  })
156
-
157
179
  return show_cms
158
180
  }
159
181
 
@@ -189,10 +211,10 @@ const CompetitionContestsForm = ({
189
211
 
190
212
  const { image_url, header, description } = getMatchTitle(data.item, market)
191
213
  return (
192
- <View transparent style={{ padding:10, flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.borders.light }}>
214
+ <View transparent style={{ padding:10, flexDirection:'row', alignItems:'center', flexWrap:'wrap', borderBottomWidth:1, borderColor:Colors.borders.light }}>
193
215
  <Button
194
216
  title="X"
195
- style={{ marginRight:5 }}
217
+ style={{ marginRight:5, padding:10 }}
196
218
  type='error'
197
219
  onPress={() => {
198
220
  if(data.item.market_id_override){
@@ -210,7 +232,7 @@ const CompetitionContestsForm = ({
210
232
  />
211
233
  </View>
212
234
  :<></>}
213
- <View transparent style={{ flex:1, marginLeft:10, marginRight:5 }}>
235
+ <View transparent style={{ flexGrow:1, marginLeft:10, marginRight:5, minWidth:200 }}>
214
236
  <Text size={14} weight='bold'>{header}</Text>
215
237
  <Text style={{ marginTop:3 }} size={12} weight='bold'>{description}</Text>
216
238
  </View>
@@ -240,8 +262,8 @@ const CompetitionContestsForm = ({
240
262
  const visible_matches = showDetails(data.item, 'team')
241
263
  const expanded = expanded_contests.includes(`${event.event_id}:team`) ? true : false
242
264
  return (
243
- <View style={{ margin:8 }}>
244
- <Button float style={{ flexDirection:'row', alignItems:'center', padding:15, zIndex:1}} onPress={() => {
265
+ <View float style={{ margin:8 }}>
266
+ <Button style={{ flexDirection:'row', alignItems:'center', padding:15, zIndex:1}} onPress={() => {
245
267
  if(expanded){ return setExpandedContests(expanded_contests.filter(c => c != `${event.event_id}:team`)) }
246
268
  else { return setExpandedContests(expanded_contests.concat(`${event.event_id}:team`)) }
247
269
  }}>
@@ -271,33 +293,28 @@ const CompetitionContestsForm = ({
271
293
  <Icons.ChevronIcon direction={expanded ? 'up' : 'down'} size={8} color={Colors.text.h1} />
272
294
  </Button>
273
295
  {expanded ?
274
- <View float style={{ borderRadius:0, padding:10 }}>
275
- <View transparent style={{ padding:10 }}>
276
- <View transparent style={{ flexDirection:'row', alignItems:'center', marginBottom:5 }}>
277
- <Text style={{ flex:1 }} size={16} weight='bold'>Selected Markets</Text>
278
- <Button
279
- title="Add Markets"
280
- type='info'
281
- onPress={() => {
282
- onShowMarkets(data.item, 'team');
283
- }}
284
- />
296
+ <View transparent>
297
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
298
+ <View transparent style={{ flex:1, marginRight:10 }}>
299
+ <Text theme='h1'>Selected Markets</Text>
300
+ <Text theme='description'>Select Add Markets to manage the markets for this contest</Text>
285
301
  </View>
286
- <View transparent style={{ flexDirection:'row', flexWrap: 'wrap', padding:10 }}>
287
- {unique_market_ids.map((market_id, index) => {
288
- return (
289
- renderMarkets({ item: market_id, index, event_id:data.item, event_type:'team' })
290
- )
291
- })}
292
- </View>
293
- </View>
294
- {visible_matches.length > 0 ?
295
- <FlatList
296
- data={visible_matches}
297
- renderItem={renderCompetitionMatches}
298
- keyExtractor={(item) => item.competition_match_id.toString()}
302
+ <Button
303
+ title="Add Markets"
304
+ style={{ padding:10 }}
305
+ type='action'
306
+ onPress={() => {
307
+ onShowMarkets(data.item, 'team');
308
+ }}
299
309
  />
300
- :<></>}
310
+ </View>
311
+ <View transparent style={{ padding:10 }}>
312
+ {unique_market_ids.map((market_id, index) => {
313
+ return (
314
+ renderMarkets({ item: market_id, index, event_id:data.item, event_type:'team', visible_matches:visible_matches })
315
+ )
316
+ })}
317
+ </View>
301
318
  </View>
302
319
 
303
320
  :<></>}
@@ -306,26 +323,34 @@ const CompetitionContestsForm = ({
306
323
  )
307
324
  }
308
325
 
309
- console.log(unique_team_events)
310
-
311
-
312
326
  return (
313
- <View float style={{ flexGrow:1, borderRadius:0 }}>
314
- <Button float style={{ flexDirection:'row', alignItems:'center', borderRadius:0 }} onPress={() => setExpanded(!expanded)}>
315
- {is_valid ?
316
- <Icons.CheckCirlceIcon size={16} color={Colors.text.success} />
317
- :
318
- <Icons.AlertIcon size={16} color={Colors.text.warning} />
319
- }
327
+ <View float style={{ borderRadius:0 }}>
328
+ <Button float style={{ flexDirection:'row', alignItems:'center', borderRadius:0, padding:20, backgroundColor:Colors.toggle.button.active }} onPress={() => setExpanded(!expanded)}>
320
329
  <View transparent style={{ flex:1, marginRight:10, marginLeft:10 }}>
321
- <Text theme='h1'>Competition Contests</Text>
322
- <Text style={{ marginTop:3 }} theme='description'>Competitions require contests for users to make picks / wagers. Select 'Add Contests' to get started.</Text>
330
+ <Text theme='h1' color={Colors.toggle.text.active}>Competition Contests</Text>
331
+ <Text style={{ marginTop:3 }} theme='description' color={Colors.toggle.text.active}>Competitions require contests for users to make picks / wagers. Select 'Add Contests' to get started.</Text>
323
332
  </View>
324
333
  <Icons.ChevronIcon direction={expanded ? 'up' : 'down'} size={8} color={Colors.text.h1} />
325
334
  </Button>
335
+ {player?.role == 'admin' ?
336
+ <View type='row' style={{ padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
337
+ <View style={{ flex:1 }}>
338
+ <Text theme='h1'>Append To Events</Text>
339
+ <Text style={{ marginTop:3 }} theme='description'>Should the competition show up on events that are included in this competition?</Text>
340
+ </View>
341
+ <Switch
342
+ value={append_to_events}
343
+ onChange={(val) => {
344
+ if(val){ return onUpdateCompetition({ ...competition, linked_event_type: 'team', linked_event_ids: unique_team_events }) }
345
+ return onUpdateCompetition({ ...competition, linked_event_type: 'team', linked_event_ids: undefined })
346
+ }}
347
+ switch_type='on_off'
348
+ />
349
+ </View>
350
+ :<></>}
326
351
  {expanded ?
327
352
  <View type='body' style={{ padding:0 }}>
328
- <View style={{flexDirection:'row', alignItems:'center', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light}}>
353
+ <View style={{flexDirection:'row', alignItems:'center', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light}}>
329
354
  <Button style={{ flex:1, padding:0 }}>
330
355
  <Text theme='h1'>Team Events</Text>
331
356
  <Text style={{ marginTop:3 }} theme='description'>Select team based events to include in this competition</Text>
@@ -336,25 +361,12 @@ const CompetitionContestsForm = ({
336
361
  onPress={() => onShowContests()}
337
362
  />
338
363
  </View>
339
- {player?.role == 'admin' ?
340
- <View type='row' style={{ padding:20 }}>
341
- <View style={{ flex:1 }}>
342
- <Text theme='h1'>Append To Events</Text>
343
- <Text style={{ marginTop:3 }} theme='description'>Should the 'Pick 6' button show up on events that are included in this competition?</Text>
364
+ <View transparent style={{ padding:20 }}>
365
+ <View transparent>
366
+ <Text theme='h1'>Primary Markets</Text>
367
+ <Text theme='description' style={{ marginTop:3 }}>The following markets can be added to all events</Text>
344
368
  </View>
345
- <Switch
346
- value={append_to_events}
347
- onChange={(val) => {
348
- if(val){ return onUpdateCompetition({ ...competition, linked_event_type: 'team', linked_event_ids: unique_team_events }) }
349
- return onUpdateCompetition({ ...competition, linked_event_type: 'team', linked_event_ids: undefined })
350
- }}
351
- switch_type='on_off'
352
- />
353
- </View>
354
- :<></>}
355
- <View style={{ padding:10 }}>
356
- <Text style={{ padding:10 }} theme='h2'>The following markets can be added to all events</Text>
357
- <View style={{ padding:5 }}>
369
+ <View transparent style={{ marginTop:10 }}>
358
370
  <FlatList
359
371
  data={primary_markets}
360
372
  renderItem={renderPrimaryMarkets}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Alert, Image } from 'react-native';
2
+ import { Alert, Image, type ViewStyle } from 'react-native';
3
3
  import type { CompetitionProps, CompetitionSummaryProps } from '../../types';
4
4
  import { useColors } from '../../constants/useColors';
5
5
  import { Button, Text, View } from '../../Components/Themed';
@@ -7,6 +7,7 @@ import { Button, Text, View } from '../../Components/Themed';
7
7
  type CompetitionHeaderProps = {
8
8
  action_loading:boolean,
9
9
  competition:CompetitionProps,
10
+ header_style?:ViewStyle,
10
11
  competition_summaries:CompetitionSummaryProps[],
11
12
  competition_valid: {
12
13
  valid:boolean,
@@ -21,7 +22,7 @@ type CompetitionHeaderProps = {
21
22
  onActivate: () => void
22
23
  }
23
24
 
24
- const CompetitionHeader = ({ action_loading, competition_summaries, competition, competition_valid, onDelete, onActivate, onPause, onResume }:CompetitionHeaderProps) => {
25
+ const CompetitionHeader = ({ header_style, action_loading, competition_summaries, competition, competition_valid, onDelete, onActivate, onPause, onResume }:CompetitionHeaderProps) => {
25
26
  const Colors = useColors();
26
27
  const handleActivate = () => {
27
28
  if(!competition_valid.valid){
@@ -38,8 +39,8 @@ const CompetitionHeader = ({ action_loading, competition_summaries, competition,
38
39
  }
39
40
 
40
41
  return (
41
- <View style={{ minWidth:330 }}>
42
- <View nativeID="competition_header" style={{ flexDirection:'row', alignItems:'center', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
42
+ <View transparent>
43
+ <View nativeID="competition_header" style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light, ...header_style }}>
43
44
  <View>
44
45
  <Image
45
46
  source={{ uri: competition.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1649737862/be_logo_jte2ux.webp' }}
@@ -1,22 +1,24 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { Image } from "react-native"
3
- //import ImageUploader from '../../Components/ImageUploader';
4
- import type { CompetitionProps, FocusPositionProps, MyPlayerProps } from '../../types';
3
+ import type { CompanyProps, CompetitionProps, FocusPositionProps, GroupProps, MyPlayerProps } from '../../types';
5
4
  import { Icons, Switch } from '../../Components';
6
5
  import ImageUploader from '../../Components/ImageUploader';
7
6
  import { Button, Text, TextInput, View } from '../../Components/Themed';
8
7
  import { useColors } from '../../constants/useColors';
8
+ import GroupSelector from './GroupSelector';
9
+ import CompanySelector from './CompanySelector';
9
10
 
10
11
  type CompetitionInfoFormProps = {
11
12
  competition:CompetitionProps,
12
- is_valid?:boolean,
13
13
  player?:MyPlayerProps,
14
+ groups:GroupProps[],
15
+ companies:CompanyProps[],
14
16
  onFocusPosition?:(position:FocusPositionProps) => void,
15
17
  init_expanded?:boolean,
16
18
  onCompetitionUpdate:(competition:CompetitionProps) => void
17
19
  }
18
20
 
19
- const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player, competition, onCompetitionUpdate }:CompetitionInfoFormProps) => {
21
+ const CompetitionInfoForm = ({ onFocusPosition, init_expanded, player, competition, groups, companies, onCompetitionUpdate }:CompetitionInfoFormProps) => {
20
22
  const [ expanded, setExpanded ] = useState(init_expanded ?? false);
21
23
  const [ draft_competition, setDraftCompetition ] = useState<CompetitionProps | undefined>(undefined);
22
24
  const Colors = useColors();
@@ -25,21 +27,21 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
25
27
  },[competition])
26
28
 
27
29
  if(!draft_competition){ return <></> }
30
+ const active_group = groups.find(g => g.group_id == competition.group_id);
31
+ const active_company = companies.find(c => c.company_id == competition.company_id);
32
+
28
33
  const is_changed = JSON.stringify(draft_competition) != JSON.stringify(competition) ? true : false;
29
34
  return (
30
- <View float style={{ flexGrow:1, borderRadius:0 }}>
35
+ <View style={{ borderRadius:0 }}>
31
36
  <Button
32
37
  disabled={init_expanded}
33
- float style={{ flexDirection:'row', alignItems:'center', borderRadius:0}} onPress={() => setExpanded(!expanded)}>
34
- {is_valid ?
35
- <Icons.CheckCirlceIcon size={16} color={Colors.text.success} />
36
- :
37
- <Icons.AlertIcon size={16} color={Colors.text.warning} />
38
- }
39
- <View transparent style={{ flex:1, marginLeft:10 }}>
40
- <Text theme='h1'>Competition Information</Text>
41
- <Text style={{ marginTop:3 }} theme='description'>Manage the high level information of this competition</Text>
42
- </View>
38
+ float
39
+ style={{ flexDirection:'row', alignItems:'center', borderRadius:0, padding:20, backgroundColor:Colors.toggle.button.active}}
40
+ onPress={() => setExpanded(!expanded)}>
41
+ <View transparent style={{ flex:1 }}>
42
+ <Text theme='h1' color={Colors.toggle.text.active}>Competition Information</Text>
43
+ <Text style={{ marginTop:3 }} theme='description' color={Colors.toggle.text.active}>Manage the high level information of this competition</Text>
44
+ </View>
43
45
  {is_changed ?
44
46
  <Button
45
47
  title='SAVE'
@@ -54,8 +56,8 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
54
56
  {expanded ?
55
57
  <View type='body' nativeID="competition_info">
56
58
 
57
- <View type='row' nativeID="competition_image" style={{ alignItems:'flex-start', borderBottomWidth:1, borderColor:Colors.borders.light, padding:10 }}>
58
- <View style={{ flex:1, margin:5 }}>
59
+ <View type='row' nativeID="competition_image" style={{ alignItems:'flex-start', borderBottomWidth:1, borderColor:Colors.borders.light, padding:20 }}>
60
+ <View style={{ flex:1 }}>
59
61
  <Text theme='h1'>Competition Image</Text>
60
62
  <Text style={{ marginTop:3 }} theme='description'>Give this competition an image so it is recognizable to those trying to join.</Text>
61
63
  </View>
@@ -72,8 +74,8 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
72
74
  </ImageUploader>
73
75
  </View>
74
76
 
75
- <View type='row' nativeID="competition_name" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
76
- <View style={{ flex:1, margin:5, minWidth:200 }}>
77
+ <View type='row' nativeID="competition_name" style={{ flexWrap:'wrap', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
78
+ <View style={{ flex:1, minWidth:200 }}>
77
79
  <Text theme='h1'>Competition Name</Text>
78
80
  <Text style={{ marginTop:3 }} theme='description'>Give the competition a memorable name that aligns with the type and payout.</Text>
79
81
  </View>
@@ -85,10 +87,9 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
85
87
  placeholder="Competition Name"
86
88
  />
87
89
  </View>
88
-
89
- <View type='row' nativeID="competition_description" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
90
- <View style={{ flex:1, margin:5, minWidth:200 }}>
91
- <Text theme='h2'>Competition Description</Text>
90
+ <View type='row' nativeID="competition_description" style={{ flexWrap:'wrap', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
91
+ <View style={{ flex:1, minWidth:200 }}>
92
+ <Text theme='h1'>Competition Description</Text>
92
93
  <Text style={{ marginTop:3 }} theme='description'>Give the competition a memorable description that would entice users to participate.</Text>
93
94
  </View>
94
95
  <TextInput
@@ -99,8 +100,8 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
99
100
  placeholder="Pick 5 games ATS from NFL Week 6 matchups"
100
101
  />
101
102
  </View>
102
- <View type='row' nativeID="invite_only" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
103
- <View style={{ flex:1, margin:5, marginRight:15 }}>
103
+ <View type='row' nativeID="invite_only" style={{ flexWrap:'wrap', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
104
+ <View style={{ flex:1, marginRight:15 }}>
104
105
  <Text theme='h1'>Make Private</Text>
105
106
  <Text style={{ marginTop:3 }} theme='description'>Only access this competition using an invite code.</Text>
106
107
  </View>
@@ -108,13 +109,16 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
108
109
  disabled={competition.competition_season_id ? true : false}
109
110
  value={competition.invite_only}
110
111
  switch_type="on_off"
111
- onChange={(value) => onCompetitionUpdate({ ...draft_competition, invite_only: value })}
112
+ onChange={(value) => {
113
+ if(player?.role != 'admin'){ return alert('You do not have access to make public competitions at this time.') }
114
+ onCompetitionUpdate({ ...draft_competition, invite_only: value })
115
+ }}
112
116
  />
113
117
  </View>
114
118
  {player?.role == 'admin' ?
115
- <View type='row' nativeID="invite_only" style={{ flexWrap:'wrap', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }}>
116
- <View style={{ flex:1, margin:5, marginRight:15 }}>
117
- <Text theme='h2'>Make Template</Text>
119
+ <View type='row' nativeID="invite_only" style={{ flexWrap:'wrap', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
120
+ <View style={{ flex:1, marginRight:15 }}>
121
+ <Text theme='h1'>Make Template</Text>
118
122
  <Text style={{ marginTop:3 }} theme='description'>This will allow for other users to copy this competition and create it for themselves.</Text>
119
123
  </View>
120
124
  <Switch
@@ -124,6 +128,32 @@ const CompetitionInfoForm = ({ is_valid, onFocusPosition, init_expanded, player,
124
128
  />
125
129
  </View>
126
130
  :<></>}
131
+ {groups.length > 0 ?
132
+ <View style={{ padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
133
+ <View style={{ marginBottom:10 }}>
134
+ <Text theme='h1'>My Groups</Text>
135
+ <Text style={{ marginTop:3 }} theme='description'>Add this competition to a group that you are a member of</Text>
136
+ </View>
137
+ <GroupSelector
138
+ active_group={active_group}
139
+ groups={groups}
140
+ onSelectGroup={(g) => onCompetitionUpdate({ ...draft_competition, group_id: g?.group_id })}
141
+ />
142
+ </View>
143
+ :<></>}
144
+ {companies.length > 0 ?
145
+ <View style={{ padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
146
+ <View style={{ marginBottom:10 }}>
147
+ <Text theme='h1'>My Companies</Text>
148
+ <Text style={{ marginTop:3 }} theme='description'>Add this competition to a company that you are a member of</Text>
149
+ </View>
150
+ <CompanySelector
151
+ active_company={active_company}
152
+ companies={companies}
153
+ onSelectCompany={(c) => onCompetitionUpdate({ ...draft_competition, company_id: c?.company_id })}
154
+ />
155
+ </View>
156
+ :<></>}
127
157
  </View>
128
158
  :<></>}
129
159
  </View>
@@ -92,20 +92,15 @@ const CompetitionMatchMarketCard = ({ market, competition_match_markets, onUpdat
92
92
  if(!o_side || !trade_side){ return <></> }
93
93
 
94
94
  return (
95
- <View style={{ flexDirection:'row' }}>
96
- <View>
97
- <TouchableOpacity disabled style={{ width:75, padding:5, backgroundColor:o_side.status == 'error' ? Colors.highlights.highlight300Faded :Colors.shades.shade600, borderRadius:4, marginRight:3 }} onPress={() => setDraftCompetitionMatchMarket(o_side)}>
98
- <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{o_side.side.toUpperCase()}{market.var_1_required?` ${ManageCompetitionHelpers.getVar1Label(o_side.var_1 as number, market)}`:''}</Text>
99
- <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{ManageCompetitionHelpers.getOddsLabel(o_side.odds as number)}</Text>
100
- </TouchableOpacity>
101
- </View>
102
- <View>
103
- <TouchableOpacity disabled style={{ width:75, padding:5, backgroundColor:trade_side.status == 'error' ? Colors.highlights.highlight300Faded :Colors.shades.shade600, borderRadius:4, marginLeft:3 }} onPress={() => setDraftCompetitionMatchMarket(trade_side)}>
104
- <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{trade_side.side.toUpperCase()}{market.var_1_required?` ${ManageCompetitionHelpers.getVar1Label(trade_side.var_1 as number, market)}`:''}</Text>
105
- <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{ManageCompetitionHelpers.getOddsLabel(trade_side.odds as number)}</Text>
106
- </TouchableOpacity>
107
- </View>
108
-
95
+ <View style={{ flexGrow:1, flexDirection:'row', margin:5 }}>
96
+ <TouchableOpacity disabled style={{ flexGrow:1, minWidth:75, padding:10, backgroundColor:o_side.status == 'error' ? Colors.highlights.highlight300Faded :Colors.shades.shade600, borderRadius:4, marginRight:3 }} onPress={() => setDraftCompetitionMatchMarket(o_side)}>
97
+ <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{o_side.side.toUpperCase()}{market.var_1_required?` ${ManageCompetitionHelpers.getVar1Label(o_side.var_1 as number, market)}`:''}</Text>
98
+ <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{ManageCompetitionHelpers.getOddsLabel(o_side.odds as number)}</Text>
99
+ </TouchableOpacity>
100
+ <TouchableOpacity disabled style={{ flexGrow:1, minWidth:75, padding:10, backgroundColor:trade_side.status == 'error' ? Colors.highlights.highlight300Faded :Colors.shades.shade600, borderRadius:4, marginLeft:3 }} onPress={() => setDraftCompetitionMatchMarket(trade_side)}>
101
+ <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{trade_side.side.toUpperCase()}{market.var_1_required?` ${ManageCompetitionHelpers.getVar1Label(trade_side.var_1 as number, market)}`:''}</Text>
102
+ <Text textAlign="center" size={12} color={Colors.brand.midnight} weight='semibold'>{ManageCompetitionHelpers.getOddsLabel(trade_side.odds as number)}</Text>
103
+ </TouchableOpacity>
109
104
  </View>
110
105
  )
111
106