be-components 6.5.1 → 6.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +4 -4
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Authenticator/Components/StrategyForm.js +2 -0
  4. package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
  5. package/lib/commonjs/Authenticator/index.js +1 -0
  6. package/lib/commonjs/Authenticator/index.js.map +1 -1
  7. package/lib/commonjs/Clarity/SmartEvents.js +19 -0
  8. package/lib/commonjs/Clarity/SmartEvents.js.map +1 -0
  9. package/lib/commonjs/Components/AutoPageFlatList.js +92 -0
  10. package/lib/commonjs/Components/AutoPageFlatList.js.map +1 -0
  11. package/lib/commonjs/Components/AutoScrollFlatList.js.map +1 -1
  12. package/lib/commonjs/Components/CircularFadeOut.js +34 -0
  13. package/lib/commonjs/Components/CircularFadeOut.js.map +1 -0
  14. package/lib/commonjs/Components/Jerseys.js +5 -2
  15. package/lib/commonjs/Components/Jerseys.js.map +1 -1
  16. package/lib/commonjs/Components/LinearDiagnal.js +3 -1
  17. package/lib/commonjs/Components/LinearDiagnal.js.map +1 -1
  18. package/lib/commonjs/Components/Pagination.js +4 -4
  19. package/lib/commonjs/Components/Pagination.js.map +1 -1
  20. package/lib/commonjs/Components/Themed.js +4 -1
  21. package/lib/commonjs/Components/Themed.js.map +1 -1
  22. package/lib/commonjs/Components/index.js +14 -0
  23. package/lib/commonjs/Components/index.js.map +1 -1
  24. package/lib/commonjs/EventComponents/TeamProfile/index.js.map +1 -1
  25. package/lib/commonjs/Guide/index.js +217 -0
  26. package/lib/commonjs/Guide/index.js.map +1 -0
  27. package/lib/commonjs/MarketComponents/api/index.js +25 -0
  28. package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
  29. package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js +2 -2
  30. package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js.map +1 -1
  31. package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +19 -6
  32. package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
  33. package/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.js +2 -1
  34. package/lib/commonjs/MarketComponents/components/TeamTournamentMarket/index.js.map +1 -1
  35. package/lib/commonjs/RankingsCard/api/index.js +88 -0
  36. package/lib/commonjs/RankingsCard/api/index.js.map +1 -0
  37. package/lib/commonjs/RankingsCard/index.js +663 -0
  38. package/lib/commonjs/RankingsCard/index.js.map +1 -0
  39. package/lib/commonjs/index.js +21 -0
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/commonjs/types.d.js +1 -0
  42. package/lib/commonjs/types.d.js.map +1 -1
  43. package/lib/module/ApiOverrides/index.js +4 -4
  44. package/lib/module/ApiOverrides/index.js.map +1 -1
  45. package/lib/module/Authenticator/Components/StrategyForm.js +2 -0
  46. package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
  47. package/lib/module/Authenticator/index.js +1 -0
  48. package/lib/module/Authenticator/index.js.map +1 -1
  49. package/lib/module/Clarity/SmartEvents.js +13 -0
  50. package/lib/module/Clarity/SmartEvents.js.map +1 -0
  51. package/lib/module/Components/AutoPageFlatList.js +84 -0
  52. package/lib/module/Components/AutoPageFlatList.js.map +1 -0
  53. package/lib/module/Components/AutoScrollFlatList.js.map +1 -1
  54. package/lib/module/Components/CircularFadeOut.js +27 -0
  55. package/lib/module/Components/CircularFadeOut.js.map +1 -0
  56. package/lib/module/Components/Jerseys.js +5 -2
  57. package/lib/module/Components/Jerseys.js.map +1 -1
  58. package/lib/module/Components/LinearDiagnal.js +3 -1
  59. package/lib/module/Components/LinearDiagnal.js.map +1 -1
  60. package/lib/module/Components/Pagination.js +4 -4
  61. package/lib/module/Components/Pagination.js.map +1 -1
  62. package/lib/module/Components/Themed.js +4 -1
  63. package/lib/module/Components/Themed.js.map +1 -1
  64. package/lib/module/Components/index.js +3 -1
  65. package/lib/module/Components/index.js.map +1 -1
  66. package/lib/module/EventComponents/TeamProfile/index.js.map +1 -1
  67. package/lib/module/Guide/index.js +210 -0
  68. package/lib/module/Guide/index.js.map +1 -0
  69. package/lib/module/MarketComponents/api/index.js +25 -0
  70. package/lib/module/MarketComponents/api/index.js.map +1 -1
  71. package/lib/module/MarketComponents/components/AthleteMarket/index.js +2 -2
  72. package/lib/module/MarketComponents/components/AthleteMarket/index.js.map +1 -1
  73. package/lib/module/MarketComponents/components/TeamEventMarket/index.js +19 -6
  74. package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -1
  75. package/lib/module/MarketComponents/components/TeamTournamentMarket/index.js +2 -1
  76. package/lib/module/MarketComponents/components/TeamTournamentMarket/index.js.map +1 -1
  77. package/lib/module/RankingsCard/api/index.js +82 -0
  78. package/lib/module/RankingsCard/api/index.js.map +1 -0
  79. package/lib/module/RankingsCard/index.js +655 -0
  80. package/lib/module/RankingsCard/index.js.map +1 -0
  81. package/lib/module/index.js +4 -1
  82. package/lib/module/index.js.map +1 -1
  83. package/lib/module/types.d.js +1 -0
  84. package/lib/module/types.d.js.map +1 -1
  85. package/lib/typescript/lib/commonjs/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  86. package/lib/typescript/lib/commonjs/Authenticator/index.d.ts.map +1 -1
  87. package/lib/typescript/lib/commonjs/Clarity/SmartEvents.d.ts +14 -0
  88. package/lib/typescript/lib/commonjs/Clarity/SmartEvents.d.ts.map +1 -0
  89. package/lib/typescript/lib/commonjs/Components/AutoPageFlatList.d.ts +12 -0
  90. package/lib/typescript/lib/commonjs/Components/AutoPageFlatList.d.ts.map +1 -0
  91. package/lib/typescript/lib/commonjs/Components/CircularFadeOut.d.ts +9 -0
  92. package/lib/typescript/lib/commonjs/Components/CircularFadeOut.d.ts.map +1 -0
  93. package/lib/typescript/lib/commonjs/Components/Jerseys.d.ts +3 -1
  94. package/lib/typescript/lib/commonjs/Components/Jerseys.d.ts.map +1 -1
  95. package/lib/typescript/lib/commonjs/Components/LinearDiagnal.d.ts +2 -1
  96. package/lib/typescript/lib/commonjs/Components/LinearDiagnal.d.ts.map +1 -1
  97. package/lib/typescript/lib/commonjs/Components/Themed.d.ts.map +1 -1
  98. package/lib/typescript/lib/commonjs/Components/index.d.ts +2 -0
  99. package/lib/typescript/lib/commonjs/Guide/index.d.ts +7 -0
  100. package/lib/typescript/lib/commonjs/Guide/index.d.ts.map +1 -0
  101. package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts +3 -0
  102. package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts.map +1 -1
  103. package/lib/typescript/lib/commonjs/RankingsCard/api/index.d.ts +14 -0
  104. package/lib/typescript/lib/commonjs/RankingsCard/api/index.d.ts.map +1 -0
  105. package/lib/typescript/lib/commonjs/RankingsCard/index.d.ts +7 -0
  106. package/lib/typescript/lib/commonjs/RankingsCard/index.d.ts.map +1 -0
  107. package/lib/typescript/lib/commonjs/index.d.ts +3 -0
  108. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  109. package/lib/typescript/lib/module/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  110. package/lib/typescript/lib/module/Authenticator/index.d.ts.map +1 -1
  111. package/lib/typescript/lib/module/Clarity/SmartEvents.d.ts +13 -0
  112. package/lib/typescript/lib/module/Clarity/SmartEvents.d.ts.map +1 -0
  113. package/lib/typescript/lib/module/Components/AutoPageFlatList.d.ts +12 -0
  114. package/lib/typescript/lib/module/Components/AutoPageFlatList.d.ts.map +1 -0
  115. package/lib/typescript/lib/module/Components/CircularFadeOut.d.ts +9 -0
  116. package/lib/typescript/lib/module/Components/CircularFadeOut.d.ts.map +1 -0
  117. package/lib/typescript/lib/module/Components/Jerseys.d.ts +3 -1
  118. package/lib/typescript/lib/module/Components/Jerseys.d.ts.map +1 -1
  119. package/lib/typescript/lib/module/Components/LinearDiagnal.d.ts +2 -1
  120. package/lib/typescript/lib/module/Components/LinearDiagnal.d.ts.map +1 -1
  121. package/lib/typescript/lib/module/Components/Spring.d.ts +1 -1
  122. package/lib/typescript/lib/module/Components/Themed.d.ts.map +1 -1
  123. package/lib/typescript/lib/module/Components/index.d.ts +3 -1
  124. package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
  125. package/lib/typescript/lib/module/Guide/index.d.ts +8 -0
  126. package/lib/typescript/lib/module/Guide/index.d.ts.map +1 -0
  127. package/lib/typescript/lib/module/LocationTracker/api/index.d.ts +2 -2
  128. package/lib/typescript/lib/module/LocationTracker/api/index.d.ts.map +1 -1
  129. package/lib/typescript/lib/module/MarketComponents/api/index.d.ts +3 -0
  130. package/lib/typescript/lib/module/MarketComponents/api/index.d.ts.map +1 -1
  131. package/lib/typescript/lib/module/MarketComponents/components/TeamEventMarket/index.d.ts +2 -1
  132. package/lib/typescript/lib/module/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
  133. package/lib/typescript/lib/module/MarketComponents/components/TeamTournamentMarket/index.d.ts +2 -1
  134. package/lib/typescript/lib/module/MarketComponents/components/TeamTournamentMarket/index.d.ts.map +1 -1
  135. package/lib/typescript/lib/module/RankingsCard/api/index.d.ts +13 -0
  136. package/lib/typescript/lib/module/RankingsCard/api/index.d.ts.map +1 -0
  137. package/lib/typescript/lib/module/RankingsCard/index.d.ts +9 -0
  138. package/lib/typescript/lib/module/RankingsCard/index.d.ts.map +1 -0
  139. package/lib/typescript/lib/module/index.d.ts +4 -1
  140. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  141. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  142. package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
  143. package/lib/typescript/src/Clarity/SmartEvents.d.ts +13 -0
  144. package/lib/typescript/src/Clarity/SmartEvents.d.ts.map +1 -0
  145. package/lib/typescript/src/Components/AutoPageFlatList.d.ts +15 -0
  146. package/lib/typescript/src/Components/AutoPageFlatList.d.ts.map +1 -0
  147. package/lib/typescript/src/Components/AutoScrollFlatList.d.ts.map +1 -1
  148. package/lib/typescript/src/Components/CircularFadeOut.d.ts +10 -0
  149. package/lib/typescript/src/Components/CircularFadeOut.d.ts.map +1 -0
  150. package/lib/typescript/src/Components/Jerseys.d.ts +3 -1
  151. package/lib/typescript/src/Components/Jerseys.d.ts.map +1 -1
  152. package/lib/typescript/src/Components/LinearDiagnal.d.ts +3 -1
  153. package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -1
  154. package/lib/typescript/src/Components/Pagination.d.ts +2 -2
  155. package/lib/typescript/src/Components/Pagination.d.ts.map +1 -1
  156. package/lib/typescript/src/Components/Themed.d.ts +1 -0
  157. package/lib/typescript/src/Components/Themed.d.ts.map +1 -1
  158. package/lib/typescript/src/Components/index.d.ts +3 -1
  159. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  160. package/lib/typescript/src/EventComponents/TeamProfile/index.d.ts.map +1 -1
  161. package/lib/typescript/src/Guide/index.d.ts +8 -0
  162. package/lib/typescript/src/Guide/index.d.ts.map +1 -0
  163. package/lib/typescript/src/MarketComponents/api/index.d.ts +9 -1
  164. package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -1
  165. package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts +3 -2
  166. package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -1
  167. package/lib/typescript/src/MarketComponents/components/TeamTournamentMarket/index.d.ts +2 -1
  168. package/lib/typescript/src/MarketComponents/components/TeamTournamentMarket/index.d.ts.map +1 -1
  169. package/lib/typescript/src/MarketComponents/index.d.ts +4 -2
  170. package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
  171. package/lib/typescript/src/RankingsCard/api/index.d.ts +20 -0
  172. package/lib/typescript/src/RankingsCard/api/index.d.ts.map +1 -0
  173. package/lib/typescript/src/RankingsCard/index.d.ts +8 -0
  174. package/lib/typescript/src/RankingsCard/index.d.ts.map +1 -0
  175. package/lib/typescript/src/index.d.ts +4 -1
  176. package/lib/typescript/src/index.d.ts.map +1 -1
  177. package/package.json +1 -1
  178. package/src/ApiOverrides/index.ts +4 -4
  179. package/src/Authenticator/Components/StrategyForm.tsx +2 -0
  180. package/src/Authenticator/index.tsx +2 -0
  181. package/src/Clarity/SmartEvents.ts +13 -0
  182. package/src/Components/AutoPageFlatList.tsx +99 -0
  183. package/src/Components/AutoScrollFlatList.tsx +0 -1
  184. package/src/Components/CircularFadeOut.tsx +36 -0
  185. package/src/Components/Jerseys.tsx +5 -3
  186. package/src/Components/LinearDiagnal.tsx +4 -3
  187. package/src/Components/Pagination.tsx +6 -4
  188. package/src/Components/Themed.tsx +6 -4
  189. package/src/Components/index.tsx +4 -0
  190. package/src/EventComponents/TeamProfile/index.tsx +0 -1
  191. package/src/Guide/index.tsx +180 -0
  192. package/src/MarketComponents/api/index.ts +26 -1
  193. package/src/MarketComponents/components/AthleteMarket/index.tsx +2 -2
  194. package/src/MarketComponents/components/TeamEventMarket/index.tsx +17 -6
  195. package/src/MarketComponents/components/TeamTournamentMarket/index.tsx +3 -2
  196. package/src/RankingsCard/api/index.ts +80 -0
  197. package/src/RankingsCard/index.tsx +398 -0
  198. package/src/index.tsx +6 -2
  199. package/src/types.d.ts +53 -2
@@ -0,0 +1,99 @@
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import {
3
+ FlatList,
4
+ StyleSheet,
5
+ } from 'react-native';
6
+ import { View } from './Themed';
7
+ import Pagination from './Pagination';
8
+
9
+ interface AutoPageFlatListProps<T> {
10
+ data: T[];
11
+ reset_key:string,
12
+ renderItem: ({ item }: { item: T }) => JSX.Element;
13
+ horizontal?: boolean;
14
+ time_on_page?: number; // seconds
15
+ itemHeight?: number; // required for vertical paging
16
+ itemWidth?: number; // required for horizontal paging
17
+ }
18
+
19
+ function AutoPageFlatList<T>({
20
+ reset_key,
21
+ data,
22
+ renderItem,
23
+ horizontal = false,
24
+ time_on_page,
25
+ itemHeight = 200,
26
+ itemWidth = 200,
27
+ }: AutoPageFlatListProps<T>) {
28
+ const [page, setPage] = useState(0);
29
+ const [containerSize, setContainerSize] = useState<number>(0);
30
+
31
+ const intervalRef = useRef<NodeJS.Timeout | null>(null);
32
+
33
+ const sizePerItem = horizontal ? itemWidth : itemHeight;
34
+ const itemsPerPage = containerSize ? Math.max(Math.floor(containerSize / sizePerItem), 1) : 1;
35
+ const totalPages = Math.ceil(data.length / itemsPerPage);
36
+
37
+ // Auto-advance effect
38
+ useEffect(() => {
39
+ if (!time_on_page || totalPages <= 1) return;
40
+
41
+ intervalRef.current = setInterval(() => {
42
+ setPage((prev) => (prev + 1) % totalPages);
43
+ }, time_on_page * 1000);
44
+
45
+ return () => {
46
+ if (intervalRef.current) clearInterval(intervalRef.current);
47
+ };
48
+ }, [time_on_page, totalPages]);
49
+
50
+ useEffect(() => {
51
+ setPage(0)
52
+ },[reset_key])
53
+
54
+ const onContainerLayout = (e: any) => {
55
+ const size = horizontal ? e.nativeEvent.layout.width : e.nativeEvent.layout.height;
56
+ setContainerSize(size);
57
+ };
58
+
59
+ const currentData = data.slice(page * itemsPerPage, page * itemsPerPage + itemsPerPage);
60
+
61
+ const nextPage = () => setPage((p) => Math.min(p + 1, totalPages - 1));
62
+ const prevPage = () => setPage((p) => Math.max(p - 1, 0));
63
+
64
+ return (
65
+ <View transparent style={styles.container} onLayout={onContainerLayout}>
66
+ <View transparent style={{ flex:1 }}>
67
+ <FlatList
68
+ data={currentData}
69
+ renderItem={renderItem}
70
+ keyExtractor={(_, idx) => String(idx)}
71
+ horizontal={horizontal}
72
+ showsHorizontalScrollIndicator={false}
73
+ showsVerticalScrollIndicator={false}
74
+ />
75
+ </View>
76
+ <View transparent>
77
+ <Pagination
78
+ pages={totalPages}
79
+ onNext={nextPage}
80
+ onPrevious={prevPage}
81
+ offset={page}
82
+ />
83
+ </View>
84
+ </View>
85
+ );
86
+ }
87
+
88
+ const styles = StyleSheet.create({
89
+ container: { flex: 1 },
90
+ controls: {
91
+ flexDirection: 'row',
92
+ justifyContent: 'space-between',
93
+ padding: 8,
94
+ },
95
+ arrow: { fontSize: 24, paddingHorizontal: 8 },
96
+ disabled: { color: '#ccc' },
97
+ });
98
+
99
+ export default AutoPageFlatList;
@@ -171,7 +171,6 @@ const AutoScrollingFlatList = <T,>({
171
171
  };
172
172
 
173
173
  const windowSize = Dimensions.get('window');
174
-
175
174
  return (
176
175
  <View
177
176
  {...(wrapperProps as any)}
@@ -0,0 +1,36 @@
1
+ import React, { useRef, useEffect } from 'react';
2
+ import { Animated, StyleSheet } from 'react-native';
3
+
4
+ interface Props {
5
+ start: boolean;
6
+ animationTime?: number; // seconds
7
+ onComplete?: () => void;
8
+ children?: React.ReactNode;
9
+ }
10
+
11
+ export default function FadeOutOverlay({
12
+ start,
13
+ animationTime = 2,
14
+ onComplete,
15
+ children,
16
+ }: Props) {
17
+ const opacity = useRef(new Animated.Value(1)).current;
18
+
19
+ useEffect(() => {
20
+ if (start) {
21
+ Animated.timing(opacity, {
22
+ toValue: 0,
23
+ duration: animationTime * 1000,
24
+ useNativeDriver: true,
25
+ }).start(() => {
26
+ onComplete?.();
27
+ });
28
+ }
29
+ }, [start]);
30
+
31
+ return (
32
+ <Animated.View style={[StyleSheet.absoluteFill, { opacity }]}>
33
+ {children}
34
+ </Animated.View>
35
+ );
36
+ }
@@ -65,13 +65,15 @@ const AthleteImage = ({ athlete, size, number_size, league }:AthleteImageProps)
65
65
  type TeamImageProps = {
66
66
  team: TeamProps,
67
67
  league? :LeagueProps,
68
- size:number
68
+ size:number,
69
+ padding?:number,
70
+ backgroundColor?:string
69
71
  }
70
- const TeamImage = ({ team, league , size} : TeamImageProps) => {
72
+ const TeamImage = ({ team, league , size, padding, backgroundColor} : TeamImageProps) => {
71
73
  let image_size = size ?? 20
72
74
 
73
75
  return (
74
- <View style={{ alignSelf:'center', justifyContent:'center', alignItems:'center', borderRadius:100, backgroundColor:Colors.shades.white }}>
76
+ <View style={{ alignSelf:'center', justifyContent:'center', alignItems:'center', borderRadius:100, backgroundColor:backgroundColor ?? Colors.shades.white, padding }}>
75
77
  {team.image?.url ?
76
78
  <RN_Image source={{ uri: team.image.url }} style={{ height:image_size * 2, width:image_size * 2, borderRadius:100 }} resizeMode='center'/>
77
79
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { View, StyleSheet } from "react-native"
2
+ import { View, StyleSheet, type ViewStyle } from "react-native"
3
3
  import {LinearGradient} from "expo-linear-gradient";
4
4
  import Colors from '../constants/colors';
5
5
  import Text from './Text';
@@ -8,16 +8,17 @@ type LinearDiagnalProps = {
8
8
  label?: string,
9
9
  label_size?:number,
10
10
  label_color?:string,
11
+ parent_style?:ViewStyle,
11
12
  left_color:string,
12
13
  right_color:string
13
14
  no_buffer?:boolean,
14
15
  style?:any,
15
16
  children?:any
16
17
  }
17
- const LinearDiagnal = ({ left_color, right_color, no_buffer, label, label_size, label_color, style, children }:LinearDiagnalProps) => {
18
+ const LinearDiagnal = ({ left_color, right_color, parent_style, no_buffer, label, label_size, label_color, style, children }:LinearDiagnalProps) => {
18
19
  const [ height, setHeight ] = useState(0);
19
20
  return (
20
- <View style={{ flexDirection:'row' }} onLayout={(ev) => {
21
+ <View style={{ flexDirection:'row', ...parent_style }} onLayout={(ev) => {
21
22
  const { height } = ev.nativeEvent.layout
22
23
  setHeight(height)
23
24
  }}>
@@ -9,8 +9,8 @@ type PaginationProps = {
9
9
  pages?:number,
10
10
  next_title?:string,
11
11
  previous_title?:string,
12
- onPrevious: () => void,
13
- onNext: () => void,
12
+ onPrevious?: () => void,
13
+ onNext?: () => void,
14
14
  onSelectPage?:(page:number) => void
15
15
  }
16
16
 
@@ -36,7 +36,7 @@ const Pagination = ({ offset, pages, onPrevious, onNext, next_title, previous_ti
36
36
 
37
37
  return (
38
38
  <View transparent style={{ flexDirection: 'row', alignItems:'center', ...style }}>
39
-
39
+ {onPrevious ?
40
40
  <Button
41
41
  disabled={offset == 0}
42
42
  style={{ opacity: offset == 0 ? 0.4: 1 }}
@@ -44,7 +44,7 @@ const Pagination = ({ offset, pages, onPrevious, onNext, next_title, previous_ti
44
44
  type='text'
45
45
  onPress={() => onPrevious()}
46
46
  />
47
-
47
+ :<></>}
48
48
  <View transparent style={{ flex:1 }} onLayout={(ev) => {
49
49
  const { width } = ev.nativeEvent.layout;
50
50
  setWidth(width);
@@ -59,6 +59,7 @@ const Pagination = ({ offset, pages, onPrevious, onNext, next_title, previous_ti
59
59
 
60
60
  />
61
61
  </View>
62
+ {onNext ?
62
63
  <Button
63
64
  title={next_title ?? 'NEXT'}
64
65
  style={{ opacity: pages && pages == offset + 1 ? 0.4 : 1 }}
@@ -66,6 +67,7 @@ const Pagination = ({ offset, pages, onPrevious, onNext, next_title, previous_ti
66
67
  type='text'
67
68
  onPress={() => onNext()}
68
69
  />
70
+ :<></>}
69
71
  </View>
70
72
  )
71
73
  }
@@ -99,13 +99,13 @@ export const View = forwardRef(({ ...props }:ViewProps, ref:any) => {
99
99
  let floated = (float || type=='input') ? color_mode == 'dark' ? MyViewStyles.floatDark : MyViewStyles.floatLight : {}
100
100
  let flexDirection:'row'|'column' = type == 'row' ? 'row' : 'column'
101
101
  let alignItems:'center'|undefined = type == 'row' ? 'center' : undefined
102
-
103
- return <DefaultView ref={ref} style={[{ backgroundColor:color, borderRadius, borderColor: border_color, borderWidth: border_width, ...floated }, { flexDirection, alignItems }, style]} {...otherProps} />;
102
+ return <DefaultView nativeID={props.nativeID} ref={ref} style={[{ backgroundColor:color, borderRadius, borderColor: border_color, borderWidth: border_width, ...floated }, { flexDirection, alignItems }, style]} {...otherProps} />;
104
103
  })
105
104
 
106
105
 
107
106
  type BEButtonProps = {
108
107
  float?:boolean,
108
+ nativeID?:string,
109
109
  backgroundColor?:string,
110
110
  title?:string,
111
111
  loading?:boolean,
@@ -149,7 +149,8 @@ export const Button = (props:ButtonProps) => {
149
149
  return {
150
150
  background_color:C.buttons.background.action,
151
151
  text_color:C.text.white,
152
- border_width:0
152
+ border_width:0,
153
+ border_color:'transparent'
153
154
  }
154
155
  case 'text':
155
156
  return {
@@ -199,7 +200,8 @@ let floated = float ? color_mode == 'dark' ? MyViewStyles.floatDark : MyViewStyl
199
200
 
200
201
  return (
201
202
  <TouchableOpacity
202
- style={[{ borderRadius:8, backgroundColor:!transparent?background_color:'transparent', borderColor:border_color, borderWidth: border_width, padding:15, opacity:loading?0.5:1, ...floated }, style]}
203
+ nativeID={props.nativeID}
204
+ style={[{ borderRadius:8, backgroundColor:!transparent?background_color:'transparent', borderColor:border_color, borderWidth: border_width, padding:15, opacity:loading?0.5:1, ...floated }, style]}
203
205
  disabled={loading || otherProps.disabled}
204
206
  { ...otherProps }
205
207
  >
@@ -15,12 +15,16 @@ import LeagueLozenge from './LeagueLozenge';
15
15
  import MarketLozenge from './MarketLozenge';
16
16
  import AthleteLozenge from './AthleteLozenge';
17
17
  import PlayerLozenge from './PlayerLozenge';
18
+ import AutoPageFlatList from './AutoPageFlatList';
19
+ import CircularFadeOut from './CircularFadeOut';
18
20
 
19
21
  export {
20
22
  Button,
21
23
  Text,
22
24
  Spring,
23
25
  AutoScrollingFlatList,
26
+ CircularFadeOut,
27
+ AutoPageFlatList,
24
28
  Switch,
25
29
  MarketLozenge,
26
30
  TextInput,
@@ -173,7 +173,6 @@ const TeamProfile = ({ team_id, height, distinct_id, show_grades, show_id, init_
173
173
  onOrder={onOrder}
174
174
  onViewEvent={onViewEvent}
175
175
  onViewAdditionalMarkets={onViewAdditionalMarkets}
176
-
177
176
  />
178
177
  </View>
179
178
  </View>
@@ -0,0 +1,180 @@
1
+ import React, { useRef, useState, useEffect } from "react";
2
+ import { Platform, useWindowDimensions } from "react-native";
3
+ import type { GuideWrapProps } from "../types";
4
+ import { Button, Text, View } from "../Components/Themed";
5
+ import { useColors } from "../constants/useColors";
6
+ import { Icons } from "../Components";
7
+
8
+ export type GuideWrapperProps = {
9
+ children: React.ReactNode;
10
+ guide?: GuideWrapProps;
11
+ };
12
+
13
+ type Layout = { x: number; y: number; width: number; height: number };
14
+
15
+ export default function GuideWrapper({ children, guide }: GuideWrapperProps) {
16
+ const Colors = useColors();
17
+ const wrapper_guid = guide ?? {};
18
+ const { tour, active, onComplete } = wrapper_guid;
19
+ const refs = useRef<{ [key: string]: any }>({});
20
+ const [currentStep, setCurrentStep] = useState(0);
21
+ const [layout, setLayout] = useState<Layout | null>(null);
22
+ const [ container_layout, setContainerLayout ] = useState({ height: 0, width:0, x:0, y:0 });
23
+ const { width } = useWindowDimensions();
24
+ //Check if it is negative
25
+ const MIN_WIDTH = 300
26
+ let right = false
27
+ if(layout){
28
+ let right_side = layout.x + MIN_WIDTH
29
+ if(right_side > container_layout.width){ right = true }
30
+ //Check if it goes over the bottom
31
+ }
32
+
33
+ const sortedTour = tour ? [...tour].sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0)) : []
34
+ const step = sortedTour[currentStep];
35
+ const ref = step ? refs.current[step.nativeID] : undefined
36
+
37
+
38
+ // Measure the current step element
39
+ useEffect(() => {
40
+ if (!step || !ref || !active) return;
41
+
42
+ if (Platform.OS === "web") {
43
+ const rect = ref.getBoundingClientRect();
44
+ setLayout({
45
+ x: rect.left - container_layout.x,
46
+ y: rect.top - container_layout.y,
47
+ width: rect.width,
48
+ height: rect.height
49
+ });
50
+ } else if (ref && typeof ref.measure === "function") {
51
+ ref.measure(
52
+ (width: number, height: number, pageX: number, pageY: number) => {
53
+ setLayout({ x: pageX, y: pageY, width, height });
54
+ }
55
+ );
56
+ }
57
+ }, [active, currentStep, step, ref, container_layout.x]);
58
+
59
+ // Recursively attach refs to children with nativeID
60
+ const attachRefs = (nodes: React.ReactNode): React.ReactNode => {
61
+ return React.Children.map(nodes, (child: any) => {
62
+ if (!React.isValidElement(child)) return child;
63
+
64
+ const props = (child.props as any) || {};
65
+ const nativeID = props.nativeID;
66
+ const newChildren = props.children ? attachRefs(props.children) : props.children;
67
+
68
+ if (nativeID) {
69
+ return React.cloneElement(child, {
70
+ ref: (ref: any) => {
71
+ if (ref) refs.current[nativeID] = ref;
72
+ },
73
+ children: newChildren,
74
+ } as any);
75
+ } else if (newChildren !== props.children) {
76
+ return React.cloneElement(child, { children: newChildren } as any);
77
+ }
78
+
79
+ return child;
80
+ });
81
+ };
82
+
83
+ if (!tour || !active) return <>{children}</>;
84
+
85
+ if (!step) return <>{attachRefs(children)}</>;
86
+
87
+
88
+
89
+ const handleNext = () => {
90
+ if (currentStep + 1 < sortedTour.length) {
91
+ setCurrentStep(currentStep + 1);
92
+ } else {
93
+ onComplete?.("complete");
94
+ }
95
+ };
96
+
97
+ const handlePrev = () => {
98
+ if (currentStep > 0) setCurrentStep(currentStep - 1);
99
+ };
100
+
101
+ if (!layout) return <>{attachRefs(children)}</>;
102
+ const isLastStep = currentStep === sortedTour.length - 1;
103
+ return (
104
+ <View style={{ flexGrow: 1 }} onLayout={(ev) => {
105
+ const l = ev.nativeEvent.layout
106
+ setContainerLayout({ height:l.height, width: l.width, x: l.x, y:l.y })
107
+ }}>
108
+ {/* Attach refs to children */}
109
+ {attachRefs(children)}
110
+
111
+ {/* Highlight border around active element */}
112
+ <View
113
+ transparent
114
+ style={{
115
+ position:'absolute',
116
+ zIndex: 9999999,
117
+ borderWidth:2,
118
+ borderColor:Colors.text.success,
119
+ borderRadius:4,
120
+ top: layout.y - 5,
121
+ left: layout.x - 5,
122
+ width: layout.width + 5,
123
+ height: layout.height + 10,
124
+ }}
125
+ >
126
+ <View
127
+ float
128
+ style={{
129
+ position:'absolute',
130
+ maxWidth: width - 10,
131
+ minWidth:300,
132
+ borderColor:Colors.text.success,
133
+ bottom: 0 + layout.height + 15,
134
+ left: right ? undefined : layout.x + 5,
135
+ right: right ? 5 : undefined
136
+ }}
137
+ >
138
+ {step.title ?
139
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
140
+ <Icons.AlertIcon size={14} color={Colors.text.warning} />
141
+ <View transparent style={{flex:1, marginLeft:10, marginRight:10, borderLeftWidth:1, borderColor:Colors.borders.light}}>
142
+ <Text theme="h1">{step.title}</Text>
143
+ </View>
144
+ <Button
145
+ style={{ height:30, width:30, borderRadius:100, padding:0, justifyContent:'center', alignItems:'center' }}
146
+ title="X"
147
+ type="error"
148
+ onPress={() => onComplete ? onComplete('cancelled') : console.log('')}
149
+ />
150
+ </View>
151
+ :<></>}
152
+ {step.body ?
153
+ <View type="body" style={{ padding:5 }}>
154
+ <Text theme="h2">{step.body}</Text>
155
+ </View>
156
+ :<></>}
157
+ <View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
158
+ {currentStep > 0 && (
159
+ <Button
160
+ type='action'
161
+ onPress={handlePrev}
162
+ style={{ padding:10, flex:1, margin:2 }}
163
+ title="BACK"
164
+ />
165
+ )}
166
+ {!step.clickable && (
167
+ <Button
168
+ type='success'
169
+ style={{ padding:10, flex:1, margin:2 }}
170
+ onPress={handleNext}
171
+ title={isLastStep ? "Done" : "Next"}
172
+ />
173
+ )}
174
+ </View>
175
+ </View>
176
+ </View>
177
+ </View>
178
+ );
179
+ }
180
+
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
2
  import { APIOverrides } from "../../ApiOverrides"
3
- import type { AthleteProps, AthleteStatProps, BestAvailableOrderProps, BestAvailableResponseProps, ContestStatProps, EventOrderStatProps, EventProps, ExternalPriceProps, LeagueProps, MarketProps, MarketSideOptionProps, MarketStatsProps, MatchProps, MyPlayerProps, OrderProps, PodcastProps, PositionProps, PublicPlayerProps, TeamProps, TournamentProps, TradeProps } from "../../types"
3
+ import type { AthleteProps, AthleteStatProps, BestAvailableOrderProps, BestAvailableResponseProps, ContestStatProps, EventOrderStatProps, EventProps, ExternalPriceProps, LeagueProps, MarketProps, MarketSideOptionProps, MarketStatsProps, MatchProps, MyPlayerProps, OrderProps, PodcastProps, PositionProps, PublicPlayerProps, TeamProps, TeamRankingProps, TeamRecordProps, TournamentProps, TradeProps } from "../../types"
4
4
  import moment, { type Moment } from 'moment-mini';
5
5
  import { MarketMaketHelpers } from '../../MarketMaker/api';
6
6
 
@@ -88,6 +88,22 @@ const MarketComponentApi = {
88
88
  return []
89
89
  }
90
90
  },
91
+ getScheduledTournamentsByTeams: async(team_ids:string):Promise<TournamentProps[]> => {
92
+ try {
93
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/tournaments/teams/${team_ids}`);
94
+ return resp.data.tournaments
95
+ } catch (e) {
96
+ return []
97
+ }
98
+ },
99
+ getScheduledTournamentsByAthletes: async(athlete_ids:string):Promise<TournamentProps[]> => {
100
+ try {
101
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/tournaments/athletes/${athlete_ids}`);
102
+ return resp.data.tournaments
103
+ } catch (e) {
104
+ return []
105
+ }
106
+ },
91
107
  getMarketStatsByEvent: async(event_id:string, event_type:string):Promise<MarketStatsProps[]> => {
92
108
  try {
93
109
  const resp = await axios.get(`${MK_SVC_API}/v1/markets/event/stats/${event_type}/${event_id}`);
@@ -248,6 +264,15 @@ const MarketComponentApi = {
248
264
  }
249
265
 
250
266
  },
267
+ getTeamById: async(team_id:string):Promise<undefined | { team:TeamProps, team_rankings:TeamRankingProps[], team_records:TeamRecordProps[], league:LeagueProps }> => {
268
+ try {
269
+ console.log('getting data')
270
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/teams/team/${team_id}`);
271
+ return resp.data
272
+ } catch (e) {
273
+ return undefined
274
+ }
275
+ },
251
276
  getLeagues:async():Promise<LeagueProps[]> => {
252
277
  try {
253
278
  const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues`);
@@ -98,8 +98,8 @@ const AthleteMarket = ({ event, show_event, disabled_markets, float, image_size,
98
98
  />
99
99
  :<></>}
100
100
  <View style={{ flexGrow:1, padding:10, paddingBottom:0 }}>
101
- <Text weight='bold' style={{ maxWidth:100 }} theme='h2' textAlign='center'>{athlete.first_name} {athlete.last_name}</Text>
102
- <Text style={{ marginTop:3 }} theme='description' textAlign='center' size={12}>{athlete.team?`${athlete.team.abbr}`:''} ({athlete.position})</Text>
101
+ <Text weight='bold' style={{ maxWidth:100 }} theme='h2' textAlign={direction == 'horizontal' ?'left' :'center'}>{athlete.first_name} {athlete.last_name}</Text>
102
+ <Text style={{ marginTop:3 }} theme='description' textAlign={direction == 'horizontal' ?'left' :'center'} size={12}>{athlete.team?`${athlete.team.abbr}`:''} ({athlete.position})</Text>
103
103
  </View>
104
104
  </View>
105
105
  <View transparent style={{ flexGrow:1, justifyContent:direction=='vertical'?'center':'flex-end', padding:10 }}>