be-components 6.1.0 → 6.1.2

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 (228) hide show
  1. package/lib/commonjs/BetMatch/api/index.js +67 -1
  2. package/lib/commonjs/BetMatch/api/index.js.map +1 -1
  3. package/lib/commonjs/BetMatch/components/BetMatchCard.js +100 -46
  4. package/lib/commonjs/BetMatch/components/BetMatchCard.js.map +1 -1
  5. package/lib/commonjs/BetMatch/components/ManageFilter.js +1342 -0
  6. package/lib/commonjs/BetMatch/components/ManageFilter.js.map +1 -0
  7. package/lib/commonjs/BetMatch/index.js +204 -64
  8. package/lib/commonjs/BetMatch/index.js.map +1 -1
  9. package/lib/commonjs/Components/AthleteLozenge.js +81 -0
  10. package/lib/commonjs/Components/AthleteLozenge.js.map +1 -0
  11. package/lib/commonjs/Components/AutoScrollFlatList.js +50 -7
  12. package/lib/commonjs/Components/AutoScrollFlatList.js.map +1 -1
  13. package/lib/commonjs/Components/Icons.js +2 -0
  14. package/lib/commonjs/Components/Icons.js.map +1 -1
  15. package/lib/commonjs/Components/Jerseys.js +30 -11
  16. package/lib/commonjs/Components/Jerseys.js.map +1 -1
  17. package/lib/commonjs/Components/LeagueLozenge.js +59 -0
  18. package/lib/commonjs/Components/LeagueLozenge.js.map +1 -0
  19. package/lib/commonjs/Components/MarketLozenge.js +48 -0
  20. package/lib/commonjs/Components/MarketLozenge.js.map +1 -0
  21. package/lib/commonjs/Components/PlayerLozenge.js +61 -0
  22. package/lib/commonjs/Components/PlayerLozenge.js.map +1 -0
  23. package/lib/commonjs/Components/PremiumIcons.js +366 -0
  24. package/lib/commonjs/Components/PremiumIcons.js.map +1 -0
  25. package/lib/commonjs/Components/TeamLozenge.js +70 -0
  26. package/lib/commonjs/Components/TeamLozenge.js.map +1 -0
  27. package/lib/commonjs/Components/index.js +35 -0
  28. package/lib/commonjs/Components/index.js.map +1 -1
  29. package/lib/commonjs/FlashMarket/index.js +27 -0
  30. package/lib/commonjs/FlashMarket/index.js.map +1 -1
  31. package/lib/commonjs/Premium/api/index.js +50 -0
  32. package/lib/commonjs/Premium/api/index.js.map +1 -0
  33. package/lib/commonjs/Premium/components/ALaCartePremium.js +314 -0
  34. package/lib/commonjs/Premium/components/ALaCartePremium.js.map +1 -0
  35. package/lib/commonjs/Premium/index.js +12 -0
  36. package/lib/commonjs/Premium/index.js.map +1 -0
  37. package/lib/commonjs/ProfileManager/Components/VouchCard.js +3 -3
  38. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  39. package/lib/commonjs/ProfileManager/api/index.js +10 -1
  40. package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
  41. package/lib/commonjs/ProfileManager/index.js +2 -2
  42. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  43. package/lib/commonjs/SocialComponents/api/index.js +12 -0
  44. package/lib/commonjs/SocialComponents/api/index.js.map +1 -1
  45. package/lib/commonjs/index.js +14 -0
  46. package/lib/commonjs/index.js.map +1 -1
  47. package/lib/module/BetMatch/api/index.js +66 -0
  48. package/lib/module/BetMatch/api/index.js.map +1 -1
  49. package/lib/module/BetMatch/components/BetMatchCard.js +102 -48
  50. package/lib/module/BetMatch/components/BetMatchCard.js.map +1 -1
  51. package/lib/module/BetMatch/components/ManageFilter.js +1333 -0
  52. package/lib/module/BetMatch/components/ManageFilter.js.map +1 -0
  53. package/lib/module/BetMatch/index.js +206 -66
  54. package/lib/module/BetMatch/index.js.map +1 -1
  55. package/lib/module/Components/AthleteLozenge.js +73 -0
  56. package/lib/module/Components/AthleteLozenge.js.map +1 -0
  57. package/lib/module/Components/AutoScrollFlatList.js +51 -8
  58. package/lib/module/Components/AutoScrollFlatList.js.map +1 -1
  59. package/lib/module/Components/Icons.js +3 -0
  60. package/lib/module/Components/Icons.js.map +1 -1
  61. package/lib/module/Components/Jerseys.js +30 -11
  62. package/lib/module/Components/Jerseys.js.map +1 -1
  63. package/lib/module/Components/LeagueLozenge.js +51 -0
  64. package/lib/module/Components/LeagueLozenge.js.map +1 -0
  65. package/lib/module/Components/MarketLozenge.js +40 -0
  66. package/lib/module/Components/MarketLozenge.js.map +1 -0
  67. package/lib/module/Components/PlayerLozenge.js +53 -0
  68. package/lib/module/Components/PlayerLozenge.js.map +1 -0
  69. package/lib/module/Components/PremiumIcons.js +359 -0
  70. package/lib/module/Components/PremiumIcons.js.map +1 -0
  71. package/lib/module/Components/TeamLozenge.js +62 -0
  72. package/lib/module/Components/TeamLozenge.js.map +1 -0
  73. package/lib/module/Components/index.js +6 -1
  74. package/lib/module/Components/index.js.map +1 -1
  75. package/lib/module/FlashMarket/index.js +27 -0
  76. package/lib/module/FlashMarket/index.js.map +1 -1
  77. package/lib/module/Premium/api/index.js +43 -0
  78. package/lib/module/Premium/api/index.js.map +1 -0
  79. package/lib/module/Premium/components/ALaCartePremium.js +305 -0
  80. package/lib/module/Premium/components/ALaCartePremium.js.map +1 -0
  81. package/lib/module/Premium/index.js +5 -0
  82. package/lib/module/Premium/index.js.map +1 -0
  83. package/lib/module/ProfileManager/Components/VouchCard.js +3 -3
  84. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  85. package/lib/module/ProfileManager/api/index.js +10 -1
  86. package/lib/module/ProfileManager/api/index.js.map +1 -1
  87. package/lib/module/ProfileManager/index.js +2 -2
  88. package/lib/module/ProfileManager/index.js.map +1 -1
  89. package/lib/module/SocialComponents/api/index.js +12 -0
  90. package/lib/module/SocialComponents/api/index.js.map +1 -1
  91. package/lib/module/index.js +3 -1
  92. package/lib/module/index.js.map +1 -1
  93. package/lib/typescript/lib/commonjs/BetMatch/api/index.d.ts +7 -0
  94. package/lib/typescript/lib/commonjs/BetMatch/api/index.d.ts.map +1 -1
  95. package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCard.d.ts +10 -2
  96. package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCard.d.ts.map +1 -1
  97. package/lib/typescript/lib/commonjs/BetMatch/components/ManageFilter.d.ts +10 -0
  98. package/lib/typescript/lib/commonjs/BetMatch/components/ManageFilter.d.ts.map +1 -0
  99. package/lib/typescript/lib/commonjs/BetMatch/index.d.ts +12 -1
  100. package/lib/typescript/lib/commonjs/BetMatch/index.d.ts.map +1 -1
  101. package/lib/typescript/lib/commonjs/Components/AthleteLozenge.d.ts +11 -0
  102. package/lib/typescript/lib/commonjs/Components/AthleteLozenge.d.ts.map +1 -0
  103. package/lib/typescript/lib/commonjs/Components/AutoScrollFlatList.d.ts.map +1 -1
  104. package/lib/typescript/lib/commonjs/Components/Jerseys.d.ts.map +1 -1
  105. package/lib/typescript/lib/commonjs/Components/LeagueLozenge.d.ts +10 -0
  106. package/lib/typescript/lib/commonjs/Components/LeagueLozenge.d.ts.map +1 -0
  107. package/lib/typescript/lib/commonjs/Components/MarketLozenge.d.ts +10 -0
  108. package/lib/typescript/lib/commonjs/Components/MarketLozenge.d.ts.map +1 -0
  109. package/lib/typescript/lib/commonjs/Components/PlayerLozenge.d.ts +9 -0
  110. package/lib/typescript/lib/commonjs/Components/PlayerLozenge.d.ts.map +1 -0
  111. package/lib/typescript/lib/commonjs/Components/PremiumIcons.d.ts +85 -0
  112. package/lib/typescript/lib/commonjs/Components/PremiumIcons.d.ts.map +1 -0
  113. package/lib/typescript/lib/commonjs/Components/TeamLozenge.d.ts +10 -0
  114. package/lib/typescript/lib/commonjs/Components/TeamLozenge.d.ts.map +1 -0
  115. package/lib/typescript/lib/commonjs/Components/index.d.ts +5 -0
  116. package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts.map +1 -1
  117. package/lib/typescript/lib/commonjs/Premium/api/index.d.ts +18 -0
  118. package/lib/typescript/lib/commonjs/Premium/api/index.d.ts.map +1 -0
  119. package/lib/typescript/lib/commonjs/Premium/components/ALaCartePremium.d.ts +12 -0
  120. package/lib/typescript/lib/commonjs/Premium/components/ALaCartePremium.d.ts.map +1 -0
  121. package/lib/typescript/lib/commonjs/Premium/index.d.ts +6 -0
  122. package/lib/typescript/lib/commonjs/Premium/index.d.ts.map +1 -0
  123. package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts +1 -0
  124. package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts.map +1 -1
  125. package/lib/typescript/lib/commonjs/SocialComponents/api/index.d.ts +6 -6
  126. package/lib/typescript/lib/commonjs/SocialComponents/api/index.d.ts.map +1 -1
  127. package/lib/typescript/lib/commonjs/index.d.ts +2 -0
  128. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  129. package/lib/typescript/lib/module/BetMatch/api/index.d.ts +7 -0
  130. package/lib/typescript/lib/module/BetMatch/api/index.d.ts.map +1 -1
  131. package/lib/typescript/lib/module/BetMatch/components/BetMatchCard.d.ts +10 -2
  132. package/lib/typescript/lib/module/BetMatch/components/BetMatchCard.d.ts.map +1 -1
  133. package/lib/typescript/lib/module/BetMatch/components/ManageFilter.d.ts +10 -0
  134. package/lib/typescript/lib/module/BetMatch/components/ManageFilter.d.ts.map +1 -0
  135. package/lib/typescript/lib/module/BetMatch/index.d.ts +12 -1
  136. package/lib/typescript/lib/module/BetMatch/index.d.ts.map +1 -1
  137. package/lib/typescript/lib/module/Components/AthleteLozenge.d.ts +11 -0
  138. package/lib/typescript/lib/module/Components/AthleteLozenge.d.ts.map +1 -0
  139. package/lib/typescript/lib/module/Components/AutoScrollFlatList.d.ts.map +1 -1
  140. package/lib/typescript/lib/module/Components/Jerseys.d.ts.map +1 -1
  141. package/lib/typescript/lib/module/Components/LeagueLozenge.d.ts +10 -0
  142. package/lib/typescript/lib/module/Components/LeagueLozenge.d.ts.map +1 -0
  143. package/lib/typescript/lib/module/Components/MarketLozenge.d.ts +10 -0
  144. package/lib/typescript/lib/module/Components/MarketLozenge.d.ts.map +1 -0
  145. package/lib/typescript/lib/module/Components/PlayerLozenge.d.ts +9 -0
  146. package/lib/typescript/lib/module/Components/PlayerLozenge.d.ts.map +1 -0
  147. package/lib/typescript/lib/module/Components/PremiumIcons.d.ts +86 -0
  148. package/lib/typescript/lib/module/Components/PremiumIcons.d.ts.map +1 -0
  149. package/lib/typescript/lib/module/Components/TeamLozenge.d.ts +10 -0
  150. package/lib/typescript/lib/module/Components/TeamLozenge.d.ts.map +1 -0
  151. package/lib/typescript/lib/module/Components/index.d.ts +6 -1
  152. package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
  153. package/lib/typescript/lib/module/FlashMarket/index.d.ts.map +1 -1
  154. package/lib/typescript/lib/module/Premium/api/index.d.ts +17 -0
  155. package/lib/typescript/lib/module/Premium/api/index.d.ts.map +1 -0
  156. package/lib/typescript/lib/module/Premium/components/ALaCartePremium.d.ts +17 -0
  157. package/lib/typescript/lib/module/Premium/components/ALaCartePremium.d.ts.map +1 -0
  158. package/lib/typescript/lib/module/Premium/index.d.ts +6 -0
  159. package/lib/typescript/lib/module/Premium/index.d.ts.map +1 -0
  160. package/lib/typescript/lib/module/ProfileManager/api/index.d.ts +1 -0
  161. package/lib/typescript/lib/module/ProfileManager/api/index.d.ts.map +1 -1
  162. package/lib/typescript/lib/module/SocialComponents/api/index.d.ts +6 -6
  163. package/lib/typescript/lib/module/SocialComponents/api/index.d.ts.map +1 -1
  164. package/lib/typescript/lib/module/index.d.ts +3 -1
  165. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  166. package/lib/typescript/src/BetMatch/api/index.d.ts +8 -1
  167. package/lib/typescript/src/BetMatch/api/index.d.ts.map +1 -1
  168. package/lib/typescript/src/BetMatch/components/BetMatchCard.d.ts +12 -4
  169. package/lib/typescript/src/BetMatch/components/BetMatchCard.d.ts.map +1 -1
  170. package/lib/typescript/src/BetMatch/components/ManageFilter.d.ts +12 -0
  171. package/lib/typescript/src/BetMatch/components/ManageFilter.d.ts.map +1 -0
  172. package/lib/typescript/src/BetMatch/index.d.ts +23 -2
  173. package/lib/typescript/src/BetMatch/index.d.ts.map +1 -1
  174. package/lib/typescript/src/Components/AthleteLozenge.d.ts +13 -0
  175. package/lib/typescript/src/Components/AthleteLozenge.d.ts.map +1 -0
  176. package/lib/typescript/src/Components/AutoScrollFlatList.d.ts.map +1 -1
  177. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  178. package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -1
  179. package/lib/typescript/src/Components/LeagueLozenge.d.ts +13 -0
  180. package/lib/typescript/src/Components/LeagueLozenge.d.ts.map +1 -0
  181. package/lib/typescript/src/Components/MarketLozenge.d.ts +13 -0
  182. package/lib/typescript/src/Components/MarketLozenge.d.ts.map +1 -0
  183. package/lib/typescript/src/Components/PlayerLozenge.d.ts +11 -0
  184. package/lib/typescript/src/Components/PlayerLozenge.d.ts.map +1 -0
  185. package/lib/typescript/src/Components/PremiumIcons.d.ts +27 -0
  186. package/lib/typescript/src/Components/PremiumIcons.d.ts.map +1 -0
  187. package/lib/typescript/src/Components/TeamLozenge.d.ts +12 -0
  188. package/lib/typescript/src/Components/TeamLozenge.d.ts.map +1 -0
  189. package/lib/typescript/src/Components/index.d.ts +6 -1
  190. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  191. package/lib/typescript/src/FlashMarket/index.d.ts.map +1 -1
  192. package/lib/typescript/src/Premium/api/index.d.ts +12 -0
  193. package/lib/typescript/src/Premium/api/index.d.ts.map +1 -0
  194. package/lib/typescript/src/Premium/components/ALaCartePremium.d.ts +16 -0
  195. package/lib/typescript/src/Premium/components/ALaCartePremium.d.ts.map +1 -0
  196. package/lib/typescript/src/Premium/index.d.ts +13 -0
  197. package/lib/typescript/src/Premium/index.d.ts.map +1 -0
  198. package/lib/typescript/src/ProfileManager/api/index.d.ts +6 -2
  199. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  200. package/lib/typescript/src/SocialComponents/api/index.d.ts +1 -1
  201. package/lib/typescript/src/SocialComponents/api/index.d.ts.map +1 -1
  202. package/lib/typescript/src/index.d.ts +3 -1
  203. package/lib/typescript/src/index.d.ts.map +1 -1
  204. package/package.json +1 -1
  205. package/src/BetMatch/api/index.ts +54 -2
  206. package/src/BetMatch/components/BetMatchCard.tsx +82 -43
  207. package/src/BetMatch/components/ManageFilter.tsx +830 -0
  208. package/src/BetMatch/index.tsx +142 -45
  209. package/src/Components/AthleteLozenge.tsx +52 -0
  210. package/src/Components/AutoScrollFlatList.tsx +50 -15
  211. package/src/Components/Icons.tsx +5 -0
  212. package/src/Components/Jerseys.tsx +19 -10
  213. package/src/Components/LeagueLozenge.tsx +36 -0
  214. package/src/Components/MarketLozenge.tsx +29 -0
  215. package/src/Components/PlayerLozenge.tsx +37 -0
  216. package/src/Components/PremiumIcons.tsx +201 -0
  217. package/src/Components/TeamLozenge.tsx +44 -0
  218. package/src/Components/index.tsx +10 -0
  219. package/src/FlashMarket/index.tsx +15 -0
  220. package/src/Premium/api/index.ts +32 -0
  221. package/src/Premium/components/ALaCartePremium.tsx +145 -0
  222. package/src/Premium/index.tsx +5 -0
  223. package/src/ProfileManager/Components/VouchCard.tsx +3 -3
  224. package/src/ProfileManager/api/index.ts +12 -3
  225. package/src/ProfileManager/index.tsx +2 -2
  226. package/src/SocialComponents/api/index.ts +9 -1
  227. package/src/index.tsx +4 -0
  228. package/src/types.d.ts +37 -1
@@ -1,25 +1,38 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Text, View } from "../Components/Themed";
2
+ import { Button, Text, View } from "../Components/Themed";
3
3
  import { MyOrdersHelpers } from '../MarketComponents/components/MyOrderList/api';
4
- import type { AthleteProps, EventProps, LeagueProps, MarketProps, MatchProps, OrderProps, PlayerFilterProps, PublicPlayerProps, TeamProps, TournamentProps } from '../types';
4
+ import type { AthleteProps, EventProps, LeagueProps, MarketProps, MatchProps, MyPlayerProps, OrderProps, PlayerFilterProps, PlayerPremiumItem, PremiumItemProps, PublicPlayerProps, TeamProps, TournamentProps } from '../types';
5
5
  import { BetMatchApi } from './api';
6
- import { ActivityIndicator, FlatList } from 'react-native';
6
+ import { ActivityIndicator, FlatList, Modal, StyleSheet, TouchableWithoutFeedback } from 'react-native';
7
7
  import BetMatchCardSmall from './components/BetMatchCardSmall';
8
8
  import { SocialOrderHelpers } from '../SocialComponents/api';
9
9
  import moment from 'moment-mini';
10
10
  import { useColors } from '../constants/useColors';
11
11
  import BetMatchCard from './components/BetMatchCard';
12
+ import Pagination from '../Components/Pagination';
12
13
 
13
14
  type BetMatchProps = {
14
15
  player_filter_id:string,
15
16
  style?:any,
16
- player_id:string
17
+ mode:'desktop'|'mobile',
18
+ me?:MyPlayerProps,
19
+ insets?:{ top:number, bottom:number, right?:number, left?:number }
20
+ show_grades?:boolean,
21
+ show_external_prices?:boolean,
22
+ onViewPremium?:() => void,
23
+ callback_order?: { result: 'success'|'cancel', order_id:string },
24
+ onPurchasePremium:(ppi:PlayerPremiumItem) => void,
25
+ player_premium_items?:PlayerPremiumItem[],
26
+ premium_items?:PremiumItemProps[],
27
+ onViewPlayer:(player:PublicPlayerProps) => void,
28
+ onSelectGrade:(order:OrderProps) => void,
29
+ onOrder:(order:OrderProps) => void
17
30
  }
18
31
  const sections = ['filter','orders', 'bet']
19
- const BetMatch = ({ player_filter_id }:BetMatchProps) => {
32
+ const BetMatch = ({ me, player_filter_id, mode, insets, player_premium_items, premium_items, callback_order, onViewPlayer, onSelectGrade, onOrder, onPurchasePremium, onViewPremium }:BetMatchProps) => {
20
33
  const Colors = useColors();
21
- const [ module_size, setModuleSize ] = useState({ width:0, height:0 });
22
- const [ viewing_order_id, setViewingOrderId ] = useState<string|undefined>(undefined);
34
+
35
+ const [ viewing_order_index, setViewingOrderIndex ] = useState<number>(-1);
23
36
  const [ static_data, setStaticData ] = useState<{
24
37
  static_loading:boolean,
25
38
  leagues:LeagueProps[],
@@ -31,12 +44,13 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
31
44
  const [ filter_data, setFilterData ] = useState<{
32
45
  loading:boolean,
33
46
  player_filter?:PlayerFilterProps,
47
+ action_loading:boolean,
34
48
  orders:OrderProps[],
35
49
  }>({
36
- loading:false, orders:[]
50
+ loading:false, orders:[], action_loading:false
37
51
  });
38
- const { loading, player_filter, orders } = filter_data;
39
- const viewing_order = orders.find(o => o.order_id == viewing_order_id);
52
+ const { loading, player_filter, orders, action_loading } = filter_data;
53
+ const viewing_order = orders[viewing_order_index];
40
54
  const [ contest_data, setContestData ] = useState<{
41
55
  contest_loading:boolean,
42
56
  players:PublicPlayerProps[],
@@ -48,7 +62,7 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
48
62
  }>({
49
63
  contest_loading: false, players: [], events: [], tournaments: [], matches: [], teams:[], athletes: []
50
64
  });
51
- const { players, events, tournaments, matches, teams, athletes } = contest_data;
65
+ const { contest_loading, players, events, tournaments, matches, teams, athletes } = contest_data;
52
66
 
53
67
  useEffect(() => {
54
68
  BetMatchApi.setEnvironment()
@@ -56,6 +70,18 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
56
70
  getStaticData();
57
71
  },[player_filter_id]);
58
72
 
73
+ useEffect(() => {
74
+ if(!callback_order){ return }
75
+ //filter out the order!
76
+ setTimeout(() => {
77
+ if(callback_order.result == 'success'){
78
+ setFilterData({ ...filter_data, orders: orders.filter(o => o.order_id != callback_order.order_id), action_loading: false })
79
+ } else {
80
+ setFilterData({ ...filter_data, action_loading: false })
81
+ }
82
+ }, 500);
83
+ },[callback_order])
84
+
59
85
  const runFilter = async(id:string) => {
60
86
  setFilterData({ ...filter_data, loading: true });
61
87
  const pf = await BetMatchApi.getPlayerFilterById(id);
@@ -93,6 +119,7 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
93
119
  const tms = await BetMatchApi.getTeamsByIds(team_ids);
94
120
  setContestData({
95
121
  ...contest_data,
122
+ contest_loading: false,
96
123
  players: plyers,
97
124
  events: evs,
98
125
  tournaments: tourns,
@@ -102,6 +129,25 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
102
129
  })
103
130
  }
104
131
 
132
+ const handleReject = async(order:OrderProps) => {
133
+ setFilterData({ ...filter_data, action_loading: true });
134
+ await BetMatchApi.saveBetMatchResponse({
135
+ order_id: order.order_id,
136
+ response:'decline',
137
+ be_type: 'market',
138
+ bet_match_response_id:'',
139
+ player_id: '',
140
+ create_datetime:'', last_update_datetime:''
141
+ })
142
+ setTimeout(() => {
143
+ setFilterData({
144
+ ...filter_data,
145
+ orders: orders.filter(o => o.order_id != order.order_id)
146
+ })
147
+ }, 250);
148
+ }
149
+
150
+
105
151
  const renderOrders = (data:{ item:OrderProps, index:number }) => {
106
152
  const player = players.find(p => p.player_id == data.item.player_id);
107
153
  if(!player){ return <></> }
@@ -116,7 +162,7 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
116
162
  time_detail={time}
117
163
  league={league}
118
164
  order={data.item}
119
- onOrder={(order) => setViewingOrderId(order.order_id)}
165
+ onOrder={() => setViewingOrderIndex(data.index)}
120
166
  />
121
167
  </View>
122
168
  )
@@ -126,7 +172,6 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
126
172
  switch(data.item){
127
173
  case 'filter':
128
174
  if(!player_filter){ return <></> }
129
- if(viewing_order){ return <></> }
130
175
  return (
131
176
  <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
132
177
  <View transparent style={{ flex:1, marginRight:10 }}>
@@ -140,53 +185,105 @@ const BetMatch = ({ player_filter_id }:BetMatchProps) => {
140
185
  </View>
141
186
  )
142
187
  case 'orders':
143
- if(viewing_order){ return <></> }
144
188
  return (
145
- <View style={{ flexDirection:'row', flexWrap:'wrap' }}>
146
- {orders.map((item, index) => {
147
- return renderOrders({ item, index })
148
- })}
149
- </View>
150
- )
151
- case 'bet':
152
- if(!viewing_order){ return <></> }
153
- const player = players.find(p => p.player_id == viewing_order.player_id);
154
- if(!player){ return <></> }
155
- const { team, athlete, league, title, time } = SocialOrderHelpers.getContestDetails(viewing_order, events, tournaments, matches, athletes, teams, leagues)
156
- return (
157
- <View style={{ flex:1, padding:20 }}>
158
- <BetMatchCard
159
- player={player}
160
- height={module_size.height - 60}
161
- order={viewing_order}
162
- team={team}
163
- athlete={athlete}
164
- league={league}
165
- time_detail={time}
166
- contest_title={title}
167
- onOrder={(order) => console.log(order)}
168
- />
189
+ <View>
190
+ {loading || contest_loading ?
191
+ <View transparent style={{ justifyContent:'center', alignItems:'center', padding:50 }}>
192
+ <ActivityIndicator size='large' color={Colors.text.h1} />
193
+ <Text theme='h1' color={Colors.text.h1} style={{ marginTop:10 }}>Running Your Filter...</Text>
194
+ </View>
195
+ :<></>}
196
+ <View style={{ flexDirection:'row', flexWrap:'wrap' }}>
197
+ {orders.map((item, index) => {
198
+ return renderOrders({ item, index })
199
+ })}
200
+ </View>
169
201
  </View>
170
202
  )
203
+
171
204
  default: return <></>
172
205
  }
173
206
  }
207
+ const viewing_player = players.find(p => p.player_id == viewing_order?.player_id);
208
+ const { team, athlete, league, title, time } = SocialOrderHelpers.getContestDetails(viewing_order, events, tournaments, matches, athletes, teams, leagues)
174
209
  return (
175
- <View style={{ flex:1 }} onLayout={(ev) => {
176
- const { width, height } = ev.nativeEvent.layout;
177
- setModuleSize({ width, height })
178
- }}>
179
- {loading ?
180
- <ActivityIndicator size='large' color={Colors.text.h1} />
181
- :<></>}
210
+ <View style={{ flex:1 }}>
182
211
  <FlatList
183
212
  data={sections}
184
213
  key={'filter_sections'}
185
214
  keyExtractor={item => item}
186
215
  renderItem={renderSections}
187
216
  />
217
+ <Modal
218
+ style={styles.modalContainer}
219
+ animationType={mode=='desktop' ? 'fade' : 'slide'}
220
+ transparent
221
+ visible={viewing_order ? true : false}
222
+ >
223
+ <TouchableWithoutFeedback style={{ flex:1 }} onPress={() => setViewingOrderIndex(-1)}>
224
+ <View type="blur" style={mode=='desktop' ? styles.desktopContainer : { ...styles.viewContainer }}>
225
+ <TouchableWithoutFeedback>
226
+ <View transparent style={mode=='desktop' ?{ width:500, maxHeight:750, borderRadius:22 }:{ flex:1, paddingTop:insets?.top ?? 0, paddingBottom:insets?.bottom ?? 0 }}>
227
+ {viewing_order ?
228
+ <View transparent style={{ padding:10, paddingRight:20, paddingLeft:20, flex:1 }}>
229
+ <BetMatchCard
230
+ player={viewing_player}
231
+ order={viewing_order}
232
+ team={team}
233
+ player_premium_items={player_premium_items}
234
+ premium_items={premium_items}
235
+ me={me}
236
+ athlete={athlete}
237
+ league={league}
238
+ action_loading={action_loading}
239
+ time_detail={time}
240
+ contest_title={title}
241
+ onViewPlayer={onViewPlayer}
242
+ onPurchasePremium={onPurchasePremium}
243
+ onViewPremium={onViewPremium}
244
+ onSelectGrade={onSelectGrade}
245
+ onOrder={(order) => {
246
+ setFilterData({ ...filter_data, action_loading: true });
247
+ onOrder(order);
248
+ }}
249
+ onReject={(order) => handleReject(order)}
250
+ />
251
+ </View>
252
+ :<></>}
253
+ <View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:5, paddingBottom: (insets?.bottom ?? 0) + 5, borderRadius:8 }}>
254
+ <Button
255
+ float
256
+ title='X'
257
+ title_color={Colors.text.error}
258
+ style={{ borderRadius:100, height:35, width:35, padding:0, justifyContent:'center', alignItems:'center' }}
259
+ onPress={() => {
260
+ if(action_loading){ setFilterData({ ...filter_data, action_loading: false }) }
261
+ setViewingOrderIndex(-1)
262
+ }}
263
+ />
264
+ <View transparent style={{ flex:1 }}>
265
+ <Pagination
266
+ pages={orders.length}
267
+ onSelectPage={(page) => setViewingOrderIndex(page)}
268
+ onNext={() => setViewingOrderIndex(viewing_order_index + 1)}
269
+ onPrevious={() => setViewingOrderIndex(viewing_order_index - 1)}
270
+ offset={viewing_order_index}
271
+ />
272
+ </View>
273
+ </View>
274
+ </View>
275
+ </TouchableWithoutFeedback>
276
+ </View>
277
+ </TouchableWithoutFeedback>
278
+ </Modal>
188
279
  </View>
189
280
  )
190
281
  }
191
282
 
283
+ const styles = StyleSheet.create({
284
+ modalContainer: { flex:1 },
285
+ viewContainer: { flex:1, justifyContent:'flex-end' },
286
+ desktopContainer:{ flex:1, justifyContent:'center', alignItems:'center' }
287
+ })
288
+
192
289
  export default BetMatch
@@ -0,0 +1,52 @@
1
+ import React from 'react'
2
+ import type { AthleteProps, LeagueProps } from '../types'
3
+ import { Button, Text, View } from './Themed'
4
+ import { useColors } from '../constants/useColors'
5
+ import { AthleteImage } from './Jerseys'
6
+
7
+
8
+ type AthleteLozengeProps = {
9
+ leagues:LeagueProps[],
10
+ athlete: AthleteProps,
11
+ is_active?:boolean,
12
+ abbr_only?:boolean,
13
+ text_size?:number,
14
+ onSelect: (athlete:AthleteProps) => void
15
+ }
16
+ export const AthleteLozenge = ({ leagues, athlete, text_size, is_active, abbr_only, onSelect }:AthleteLozengeProps) => {
17
+ const Colors = useColors();
18
+ const league = leagues.find(l => l.league_id == athlete.league_id);
19
+ const handleSelect = () => {
20
+ if(!onSelect){ return }
21
+ onSelect(athlete)
22
+ }
23
+
24
+ return (
25
+ <Button float
26
+ style={{ flexGrow:1, flexDirection:'row', alignItems:'center', margin:4, borderWidth:1, borderRadius:100, padding:0, borderColor:is_active ? Colors.text.success : Colors.borders.light }} onPress={() => handleSelect()}>
27
+ {abbr_only ?
28
+ <View transparent style={{ padding:10 }}>
29
+ <Text size={text_size??16} theme='h2' color={is_active ? Colors.text.success : undefined}>{athlete.position}: {athlete.abbr_name}</Text>
30
+ </View>
31
+ :
32
+ <View transparent style={{ flexDirection:'row', padding:2 }}>
33
+ <AthleteImage
34
+ athlete={athlete}
35
+ league={league}
36
+ size={(text_size ?? 16) * 2}
37
+ number_size={8}
38
+
39
+ />
40
+ <View transparent style={{marginLeft:10, marginRight:10}}>
41
+ <Text size={text_size??16} theme='h2' color={is_active ? Colors.text.success : undefined}>{athlete.abbr_name}</Text>
42
+ {athlete.team ?
43
+ <Text style={{ marginTop:3 }} size={10} color={is_active ? Colors.text.success : undefined}>{league?`${league.league_name}: `:''}{athlete.team.abbr}</Text>
44
+ :<></>}
45
+ </View>
46
+ </View>
47
+ }
48
+ </Button>
49
+ )
50
+ }
51
+
52
+ export default AthleteLozenge
@@ -7,6 +7,7 @@ import {
7
7
  type NativeScrollEvent,
8
8
  type NativeSyntheticEvent,
9
9
  Platform,
10
+ Dimensions,
10
11
  } from 'react-native';
11
12
 
12
13
  type AutoScrollingFlatListProps<T> = {
@@ -38,7 +39,7 @@ const AutoScrollingFlatList = <T,>({
38
39
  const scrollStartTime = useRef<number | null>(null);
39
40
 
40
41
  const [ready, setReady] = useState(false);
41
- const [isPaused, setIsPaused] = useState(false); // replaces isHovered
42
+ const [isPaused, setIsPaused] = useState(false);
42
43
  const [containerSize, setContainerSize] = useState(0);
43
44
 
44
45
  const handleLayout = (e: LayoutChangeEvent) => {
@@ -53,40 +54,34 @@ const AutoScrollingFlatList = <T,>({
53
54
  ? e.nativeEvent.layout.width
54
55
  : e.nativeEvent.layout.height;
55
56
 
57
+ if(size == 0){ return }
56
58
  itemSizes.current[index] = size;
57
-
58
- const allMeasured =
59
- itemSizes.current.length === data.length &&
60
- itemSizes.current.every((v) => typeof v === 'number');
61
-
59
+ const allMeasured = itemSizes.current.length === data.length && itemSizes.current.every((v): v is number => typeof v === 'number');
62
60
  if (allMeasured && !ready) {
63
61
  totalSize.current = itemSizes.current
64
62
  .filter((v): v is number => typeof v === 'number')
65
63
  .reduce((acc, val) => acc + val, 0);
66
64
  setReady(true);
67
65
  }
66
+
68
67
  };
69
68
 
70
69
  const handleScroll = (e: NativeSyntheticEvent<NativeScrollEvent>) => {
71
70
  const currentOffset = horizontal
72
71
  ? e.nativeEvent.contentOffset.x
73
72
  : e.nativeEvent.contentOffset.y;
74
-
75
73
  offset.current = currentOffset;
76
74
  };
77
75
 
78
76
  useEffect(() => {
79
- const isWeb = Platform.OS === 'web';
80
-
81
- if (!ready || (isWeb && isPaused) || speed <= 0 || containerSize === 0) return;
82
-
77
+ if (!ready || isPaused || speed <= 0 || containerSize === 0) return;
78
+ if(totalSize.current == 0){ return }
83
79
  const frameInterval = 16;
84
80
  const pixelsPerFrame = (speed * frameInterval) / 1000;
85
81
  scrollStartTime.current = Date.now();
86
82
 
87
83
  scrollTimer.current = setInterval(() => {
88
84
  offset.current += pixelsPerFrame;
89
-
90
85
  const maxOffset = totalSize.current - containerSize;
91
86
  const now = Date.now();
92
87
  const reachedEnd = offset.current >= maxOffset;
@@ -114,6 +109,13 @@ const AutoScrollingFlatList = <T,>({
114
109
  };
115
110
  }, [ready, speed, isPaused, containerSize, onCompleteScroll, minDuration]);
116
111
 
112
+ // Kick off scroll once ready
113
+ useEffect(() => {
114
+ if (ready && !isPaused && speed > 0 && containerSize > 0) {
115
+ listRef.current?.scrollToOffset({ offset: offset.current, animated: false });
116
+ }
117
+ }, [ready, isPaused, speed, containerSize]);
118
+
117
119
  // Reset state/refs on resetKey change
118
120
  useEffect(() => {
119
121
  if (scrollTimer.current) clearInterval(scrollTimer.current);
@@ -125,6 +127,20 @@ const AutoScrollingFlatList = <T,>({
125
127
  setIsPaused(false);
126
128
  }, [resetKey]);
127
129
 
130
+ // Ensure auto-scroll works after first mobile touch
131
+ useEffect(() => {
132
+ if (Platform.OS !== 'web') return;
133
+
134
+ const unlock = () => {
135
+ setIsPaused(false);
136
+ };
137
+
138
+ document.addEventListener('touchstart', unlock, { once: true });
139
+ return () => {
140
+ document.removeEventListener('touchstart', unlock);
141
+ };
142
+ }, []);
143
+
128
144
  const wrappedRenderItem = ({ item, index }: { item: T; index: number }) => (
129
145
  <View onLayout={(e) => updateItemLayout(index, e)} style={{ flexShrink: 0 }}>
130
146
  {renderItem({ item, index })}
@@ -136,19 +152,36 @@ const AutoScrollingFlatList = <T,>({
136
152
  ? {
137
153
  onMouseEnter: () => setIsPaused(true),
138
154
  onMouseLeave: () => setIsPaused(false),
139
- onTouchStart: () => setIsPaused(true), // pause on mobile tap
155
+ onTouchStart: () => {
156
+ if (scrollStartTime.current !== null) {
157
+ setIsPaused(true);
158
+ }
159
+ },
140
160
  onTouchEnd: () => setIsPaused(false),
141
161
  }
142
162
  : {
143
- onTouchStart: () => setIsPaused(true),
163
+ onTouchStart: () => {
164
+ if (scrollStartTime.current !== null) {
165
+ setIsPaused(true);
166
+ }
167
+ },
144
168
  onTouchEnd: () => setIsPaused(false),
145
169
  };
146
170
 
171
+ const windowSize = Dimensions.get('window');
172
+
147
173
  return (
148
174
  <View
149
175
  {...(wrapperProps as any)}
150
176
  onLayout={handleLayout}
151
- style={[{ overflow: 'hidden' }, style]}
177
+ style={[
178
+ {
179
+ overflow: 'hidden', flex:1,
180
+ height: horizontal ? '100%' : windowSize.height,
181
+ width: horizontal ? windowSize.width : '100%',
182
+ },
183
+ style,
184
+ ]}
152
185
  >
153
186
  <FlatList
154
187
  ref={listRef}
@@ -157,6 +190,8 @@ const AutoScrollingFlatList = <T,>({
157
190
  keyExtractor={(_, i) => i.toString()}
158
191
  horizontal={horizontal}
159
192
  scrollEnabled={true}
193
+ initialNumToRender={data.length}
194
+ //removeClippedSubviews={true}
160
195
  onScroll={handleScroll}
161
196
  scrollEventThrottle={16}
162
197
  showsHorizontalScrollIndicator={false}
@@ -1550,6 +1550,11 @@ const LocationIcon = ({ color, size }:IconProps) => {
1550
1550
  )
1551
1551
  }
1552
1552
 
1553
+ //Premium!!
1554
+
1555
+
1556
+
1557
+
1553
1558
  export default {
1554
1559
  SearchIcon,
1555
1560
  LiquidityIcon,
@@ -24,15 +24,15 @@ const AthleteImage = ({ athlete, size, number_size, league }:AthleteImageProps)
24
24
  }
25
25
  switch(league.league_name){
26
26
  case 'UFC':
27
- return <MMAJersey />
27
+ return <MMAJersey size={size} />
28
28
  case 'BOXING':
29
- return <MMAJersey />
29
+ return <MMAJersey size={size} />
30
30
  case 'MLB':
31
- return <MLBJersey jersey_fill={athlete.team?.primary_color ?? Colors.brand.midnight} stripe_fill={athlete.team?.secondary_color ?? Colors.brand.mint}/>
31
+ return <MLBJersey size={size} jersey_fill={athlete.team?.primary_color ?? Colors.brand.midnight} stripe_fill={athlete.team?.secondary_color ?? Colors.brand.mint}/>
32
32
  case 'PGA':
33
33
  return <PGAJersey size={size}/>
34
34
  case 'NHL':
35
- return <NHLJersey jersey_fill={athlete.team?.primary_color ?? Colors.brand.midnight} stripe_fill={athlete.team?.secondary_color ?? Colors.brand.mint}/>
35
+ return <NHLJersey size={size} jersey_fill={athlete.team?.primary_color ?? Colors.brand.midnight} stripe_fill={athlete.team?.secondary_color ?? Colors.brand.mint}/>
36
36
  case 'NBA':
37
37
  return <NBAJersey size={size} jersey_fill={athlete.team?.primary_color ?? Colors.brand.midnight} stripe_fill={athlete.team?.secondary_color ?? Colors.brand.mint} />
38
38
  case 'HORSE':
@@ -151,9 +151,12 @@ const NBAJersey = ({ jersey_fill, stripe_fill, size }:{ size?:number, jersey_fil
151
151
  )
152
152
  }
153
153
 
154
- const MMAJersey = () => {
154
+ const MMAJersey = ({size}:{size?:number}) => {
155
+ const ratio = 0.78
156
+ const height = size ?? 40
157
+ const width = height * ratio
155
158
  return (
156
- <Svg width="39px" height="50px" viewBox="0 0 39 50">
159
+ <Svg width={`${width}px`} height={`${height}px`} viewBox="0 0 39 50">
157
160
  <G id="Page-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
158
161
  <G id="MMA_Glove" fillRule="nonzero">
159
162
  <Polygon id="Path" fill="#002A51" points="14.5902716 37.2615039 21.5487452 37.2615039 31.5375218 37.2615039 34.0066576 37.7104377 35.2973423 39.3378227 35.7462761 41.8630752 35.7462761 45.5667789 35.2973423 47.3063973 34.2311245 48.8215488 32.323156 49.5510662 15.9931896 49.5510662 13.5240538 48.372615 12.2894859 46.0718294 12.0089023 42.3681257 12.7384197 39.2255892"></Polygon>
@@ -211,9 +214,12 @@ const Horse = ({ size }:{size?:number}) => {
211
214
  }
212
215
 
213
216
 
214
- const NHLJersey = ({ jersey_fill, stripe_fill }:{ jersey_fill:string, stripe_fill:string }) => {
217
+ const NHLJersey = ({ jersey_fill, stripe_fill, size }:{ jersey_fill:string, stripe_fill:string, size?:number }) => {
218
+ const ratio = 0.882
219
+ const height = size ?? 40
220
+ const width = height * ratio
215
221
  return (
216
- <Svg width="45px" height="51px" viewBox="0 0 45 51">
222
+ <Svg width={`${width}px`} height={`${height}px`} viewBox="0 0 45 51">
217
223
  <G id="Page-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
218
224
  <G id="HockeyJerseyTemplate-1" transform="translate(1.000000, -0.000000)">
219
225
  <Path d="M21.8934492,50.1075287 C29.7517492,50.1075287 33.7066492,46.6889287 33.7066492,46.6889287 C33.3190492,41.6757287 33.2352492,36.4133287 33.2352492,36.4133287 C33.8640492,39.2624287 36.6538492,46.4634287 36.6538492,46.4634287 C40.0629492,46.4927287 43.7955492,45.5499287 43.7955492,45.5499287 C43.7955492,44.3025287 41.4281492,20.0472287 39.4436492,12.6199287 C37.4590492,5.19268874 35.9657492,4.03390874 34.8069492,3.42485874 C33.6481492,2.81500874 26.2738492,0.185014644 26.2738492,0.185014644 L26.3577492,0.185014644 C26.3577492,0.185014644 21.4987492,1.60244874 17.4386492,0.185014644 L17.5225492,0.185014644 C17.5225492,0.185014644 10.1482492,2.81500874 8.9886592,3.42405874 C7.8290892,4.03311874 6.3365092,5.19268874 4.3519492,12.6191287 C2.3673892,20.0464287 0,44.3017287 0,45.5499287 C0,45.5499287 3.7334092,46.4927287 7.1417292,46.4634287 C7.1417292,46.4634287 9.9314992,39.2624287 10.5603492,36.4133287 C10.5603492,36.4133287 10.3538492,42.5631287 10.0889492,46.6889287 C10.0889492,46.6889287 14.0350492,50.1075287 21.8934492,50.1075287 Z" id="Path" fill={jersey_fill} fillRule="nonzero"></Path>
@@ -235,9 +241,12 @@ const NHLJersey = ({ jersey_fill, stripe_fill }:{ jersey_fill:string, stripe_fil
235
241
  }
236
242
 
237
243
 
238
- const MLBJersey = ({ jersey_fill, stripe_fill }:{ jersey_fill:string, stripe_fill:string }) => {
244
+ const MLBJersey = ({ jersey_fill, stripe_fill, size }:{ jersey_fill:string, stripe_fill:string, size?:number }) => {
245
+ const ratio = 0.857
246
+ const height = size ?? 40
247
+ const width = height * ratio
239
248
  return (
240
- <Svg width="42px" height="49px" viewBox="0 0 42 49">
249
+ <Svg width={`${width}px`} height={`${height}px`} viewBox="0 0 42 49">
241
250
  <G id="Page-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
242
251
  <G id="Baseball" transform="translate(1.000000, 0.000000)">
243
252
  <Path d="M3.44369,25.7043763 L0,17.6691763 L1.1479,17.2386763 L9.18316,14.2254763 L13.40966,13.1688763 L16.18536,12.3883763 C18.36636,14.2256763 21.23606,15.3735763 23.99096,12.3887763 L26.97556,13.0775763 L31.56706,14.2254763 L39.02846,17.2386763 L40.17636,17.6691763 L36.73266,25.7043763 L35.43216,25.5418763 L32.14106,25.1304763 L33.19456,41.9868763 L33.28896,43.4967763 C31.94976,43.8793763 29.15656,44.8742763 28.69736,45.7925763 C28.23816,46.7108763 23.91446,47.7056763 21.80996,48.0883763 L18.94026,48.0883763 C17.21846,48.0883763 12.62686,46.9404763 11.47896,45.7925763 C10.56066,44.8742763 8.41786,43.8793763 7.46136,43.4967763 L7.51506,41.7754763 L8.03526,25.1304763 L4.7442,25.5418763 L3.44369,25.7043763 Z" id="Path" fill={jersey_fill} fillRule="nonzero"></Path>
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import { Image, type ViewStyle } from "react-native"
3
+ import type { LeagueProps } from '../types'
4
+ import { Button, Text } from './Themed'
5
+ import { useColors } from '../constants/useColors'
6
+
7
+
8
+ type LeagueLozengeProps = {
9
+ league: LeagueProps,
10
+ is_active?:boolean,
11
+ text_size?:number,
12
+ style?:ViewStyle,
13
+ onSelect: (league:LeagueProps) => void
14
+ }
15
+ export const LeagueLozenge = ({ league, style, is_active, text_size, onSelect }:LeagueLozengeProps) => {
16
+ const Colors = useColors();
17
+ const handleSelect = () => {
18
+ if(!onSelect){ return }
19
+ onSelect(league)
20
+ }
21
+
22
+ return (
23
+ <Button float style={{ flexDirection:'row', alignItems:'center', margin:4, borderWidth:1, borderColor:is_active?Colors.text.success: Colors.borders.light, borderRadius:100, padding:10, paddingRight:text_size??20, paddingLeft:text_size??20, ...style }} onPress={() => handleSelect()}>
24
+ {league.league_image ?
25
+ <Image
26
+ source={{ uri: league.league_image }}
27
+ style={{ height:18, width:18, marginRight:5 }}
28
+ resizeMode='cover'
29
+ />
30
+ :<></>}
31
+ <Text size={text_size??16} color={is_active ? Colors.text.success : undefined} theme='h2'>{league.league_name}</Text>
32
+ </Button>
33
+ )
34
+ }
35
+
36
+ export default LeagueLozenge
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Button, Text } from './Themed'
3
+ import { useColors } from '../constants/useColors'
4
+ import type { MarketProps } from '../types'
5
+ import type { ViewStyle } from 'react-native'
6
+
7
+ type MarketLozengeProps = {
8
+ market: MarketProps,
9
+ text_size?:number,
10
+ is_active?:boolean,
11
+ style?:ViewStyle,
12
+ onSelect: (market:MarketProps) => void
13
+ }
14
+ export const MarketLozenge = ({ style, market, text_size, is_active, onSelect }:MarketLozengeProps) => {
15
+ const Colors = useColors();
16
+ const handleSelect = () => {
17
+ if(!onSelect){ return }
18
+ onSelect(market)
19
+ }
20
+
21
+ return (
22
+ <Button float style={{ flexDirection:'row', alignItems:'center', margin:4, borderWidth:1, borderColor:is_active?Colors.text.success: Colors.borders.light, borderRadius:100, padding:10, paddingRight:text_size??20, paddingLeft:text_size??20, ...style }} onPress={() => handleSelect()}>
23
+
24
+ <Text size={text_size??16} color={is_active ? Colors.text.success : undefined} theme='h2'>{market.stat_label?market.stat_label:market.type}</Text>
25
+ </Button>
26
+ )
27
+ }
28
+
29
+ export default MarketLozenge
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+ import { Button, Text, View } from './Themed'
3
+ import { useColors } from '../constants/useColors'
4
+ import type { PublicPlayerProps } from '../types'
5
+ import { Image } from 'react-native'
6
+
7
+ type PlayerLozengeProps = {
8
+ player: PublicPlayerProps,
9
+ is_active?:boolean,
10
+ hide_name?:boolean,
11
+ onSelect: (player:PublicPlayerProps) => void
12
+ }
13
+ export const PlayerLozenge = ({ player, hide_name, is_active, onSelect }:PlayerLozengeProps) => {
14
+ const Colors = useColors();
15
+
16
+ const handleSelect = () => {
17
+ if(!onSelect){ return }
18
+ onSelect(player)
19
+ }
20
+
21
+ return (
22
+ <Button float style={{ flexGrow:!hide_name ?1 : undefined,flexDirection:'row', alignItems:'center', margin:4, borderColor:is_active?Colors.text.success:Colors.borders.light, borderWidth:1, padding:2, borderRadius:100 }} onPress={() => handleSelect()}>
23
+ <Image
24
+ source={{ uri: player.profile_pic && player.profile_pic != '' ? player.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
25
+ style={{ height:36, width:36, borderRadius:100 }}
26
+ resizeMode='cover'
27
+ />
28
+ {!hide_name ?
29
+ <View transparent style={{ flexGrow:1, padding:10 }}>
30
+ <Text theme='h2' color={is_active ? Colors.text.success: undefined}>@{player.username}</Text>
31
+ </View>
32
+ :<></>}
33
+ </Button>
34
+ )
35
+ }
36
+
37
+ export default PlayerLozenge