be-components 6.0.8 → 6.1.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 (124) hide show
  1. package/lib/commonjs/BetMatch/api/index.js +183 -0
  2. package/lib/commonjs/BetMatch/api/index.js.map +1 -0
  3. package/lib/commonjs/BetMatch/components/BetMatchCard.js +469 -0
  4. package/lib/commonjs/BetMatch/components/BetMatchCard.js.map +1 -0
  5. package/lib/commonjs/BetMatch/components/BetMatchCardSmall.js +132 -0
  6. package/lib/commonjs/BetMatch/components/BetMatchCardSmall.js.map +1 -0
  7. package/lib/commonjs/BetMatch/index.js +280 -0
  8. package/lib/commonjs/BetMatch/index.js.map +1 -0
  9. package/lib/commonjs/Components/AutoScrollFlatList.js +135 -0
  10. package/lib/commonjs/Components/AutoScrollFlatList.js.map +1 -0
  11. package/lib/commonjs/Components/Icons.js +26 -0
  12. package/lib/commonjs/Components/Icons.js.map +1 -1
  13. package/lib/commonjs/Components/index.js +7 -0
  14. package/lib/commonjs/Components/index.js.map +1 -1
  15. package/lib/commonjs/FlashMarket/FlashHolder.js +15 -10
  16. package/lib/commonjs/FlashMarket/FlashHolder.js.map +1 -1
  17. package/lib/commonjs/MarketComponents/components/MyOrderList/api/index.js +7 -1
  18. package/lib/commonjs/MarketComponents/components/MyOrderList/api/index.js.map +1 -1
  19. package/lib/commonjs/MarketComponents/components/OrderGradeBar.js +5 -1
  20. package/lib/commonjs/MarketComponents/components/OrderGradeBar.js.map +1 -1
  21. package/lib/commonjs/index.js +7 -0
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/module/BetMatch/api/index.js +176 -0
  24. package/lib/module/BetMatch/api/index.js.map +1 -0
  25. package/lib/module/BetMatch/components/BetMatchCard.js +461 -0
  26. package/lib/module/BetMatch/components/BetMatchCard.js.map +1 -0
  27. package/lib/module/BetMatch/components/BetMatchCardSmall.js +125 -0
  28. package/lib/module/BetMatch/components/BetMatchCardSmall.js.map +1 -0
  29. package/lib/module/BetMatch/index.js +271 -0
  30. package/lib/module/BetMatch/index.js.map +1 -0
  31. package/lib/module/Components/AutoScrollFlatList.js +127 -0
  32. package/lib/module/Components/AutoScrollFlatList.js.map +1 -0
  33. package/lib/module/Components/Icons.js +26 -0
  34. package/lib/module/Components/Icons.js.map +1 -1
  35. package/lib/module/Components/index.js +2 -1
  36. package/lib/module/Components/index.js.map +1 -1
  37. package/lib/module/FlashMarket/FlashHolder.js +15 -10
  38. package/lib/module/FlashMarket/FlashHolder.js.map +1 -1
  39. package/lib/module/MarketComponents/components/MyOrderList/api/index.js +7 -1
  40. package/lib/module/MarketComponents/components/MyOrderList/api/index.js.map +1 -1
  41. package/lib/module/MarketComponents/components/OrderGradeBar.js +5 -1
  42. package/lib/module/MarketComponents/components/OrderGradeBar.js.map +1 -1
  43. package/lib/module/index.js +2 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/typescript/lib/commonjs/BetMatch/api/index.d.ts +19 -0
  46. package/lib/typescript/lib/commonjs/BetMatch/api/index.d.ts.map +1 -0
  47. package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCard.d.ts +12 -0
  48. package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCard.d.ts.map +1 -0
  49. package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCardSmall.d.ts +12 -0
  50. package/lib/typescript/lib/commonjs/BetMatch/components/BetMatchCardSmall.d.ts.map +1 -0
  51. package/lib/typescript/lib/commonjs/BetMatch/index.d.ts +6 -0
  52. package/lib/typescript/lib/commonjs/BetMatch/index.d.ts.map +1 -0
  53. package/lib/typescript/lib/commonjs/Components/AutoScrollFlatList.d.ts +13 -0
  54. package/lib/typescript/lib/commonjs/Components/AutoScrollFlatList.d.ts.map +1 -0
  55. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  56. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  57. package/lib/typescript/lib/commonjs/Components/index.d.ts +1 -0
  58. package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts +2 -1
  59. package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/MarketComponents/components/MyOrderList/api/index.d.ts +3 -0
  61. package/lib/typescript/lib/commonjs/MarketComponents/components/MyOrderList/api/index.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/MarketComponents/components/OrderGradeBar.d.ts +2 -1
  63. package/lib/typescript/lib/commonjs/MarketComponents/components/OrderGradeBar.d.ts.map +1 -1
  64. package/lib/typescript/lib/commonjs/index.d.ts +1 -0
  65. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  66. package/lib/typescript/lib/module/BetMatch/api/index.d.ts +18 -0
  67. package/lib/typescript/lib/module/BetMatch/api/index.d.ts.map +1 -0
  68. package/lib/typescript/lib/module/BetMatch/components/BetMatchCard.d.ts +12 -0
  69. package/lib/typescript/lib/module/BetMatch/components/BetMatchCard.d.ts.map +1 -0
  70. package/lib/typescript/lib/module/BetMatch/components/BetMatchCardSmall.d.ts +12 -0
  71. package/lib/typescript/lib/module/BetMatch/components/BetMatchCardSmall.d.ts.map +1 -0
  72. package/lib/typescript/lib/module/BetMatch/index.d.ts +6 -0
  73. package/lib/typescript/lib/module/BetMatch/index.d.ts.map +1 -0
  74. package/lib/typescript/lib/module/Components/AutoScrollFlatList.d.ts +14 -0
  75. package/lib/typescript/lib/module/Components/AutoScrollFlatList.d.ts.map +1 -0
  76. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  77. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  78. package/lib/typescript/lib/module/Components/index.d.ts +2 -1
  79. package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
  80. package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts +2 -1
  81. package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts.map +1 -1
  82. package/lib/typescript/lib/module/MarketComponents/components/MyOrderList/api/index.d.ts +3 -0
  83. package/lib/typescript/lib/module/MarketComponents/components/MyOrderList/api/index.d.ts.map +1 -1
  84. package/lib/typescript/lib/module/MarketComponents/components/OrderGradeBar.d.ts +2 -1
  85. package/lib/typescript/lib/module/MarketComponents/components/OrderGradeBar.d.ts.map +1 -1
  86. package/lib/typescript/lib/module/index.d.ts +2 -1
  87. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  88. package/lib/typescript/src/BetMatch/api/index.d.ts +19 -0
  89. package/lib/typescript/src/BetMatch/api/index.d.ts.map +1 -0
  90. package/lib/typescript/src/BetMatch/components/BetMatchCard.d.ts +16 -0
  91. package/lib/typescript/src/BetMatch/components/BetMatchCard.d.ts.map +1 -0
  92. package/lib/typescript/src/BetMatch/components/BetMatchCardSmall.d.ts +15 -0
  93. package/lib/typescript/src/BetMatch/components/BetMatchCardSmall.d.ts.map +1 -0
  94. package/lib/typescript/src/BetMatch/index.d.ts +9 -0
  95. package/lib/typescript/src/BetMatch/index.d.ts.map +1 -0
  96. package/lib/typescript/src/Components/AutoScrollFlatList.d.ts +18 -0
  97. package/lib/typescript/src/Components/AutoScrollFlatList.d.ts.map +1 -0
  98. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  99. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  100. package/lib/typescript/src/Components/index.d.ts +2 -1
  101. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  102. package/lib/typescript/src/FlashMarket/FlashHolder.d.ts +2 -1
  103. package/lib/typescript/src/FlashMarket/FlashHolder.d.ts.map +1 -1
  104. package/lib/typescript/src/MarketComponents/components/MyOrderList/api/index.d.ts +3 -0
  105. package/lib/typescript/src/MarketComponents/components/MyOrderList/api/index.d.ts.map +1 -1
  106. package/lib/typescript/src/MarketComponents/components/OrderGradeBar.d.ts +2 -1
  107. package/lib/typescript/src/MarketComponents/components/OrderGradeBar.d.ts.map +1 -1
  108. package/lib/typescript/src/MarketComponents/index.d.ts +2 -1
  109. package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
  110. package/lib/typescript/src/index.d.ts +2 -1
  111. package/lib/typescript/src/index.d.ts.map +1 -1
  112. package/package.json +1 -1
  113. package/src/BetMatch/api/index.ts +145 -0
  114. package/src/BetMatch/components/BetMatchCard.tsx +227 -0
  115. package/src/BetMatch/components/BetMatchCardSmall.tsx +70 -0
  116. package/src/BetMatch/index.tsx +192 -0
  117. package/src/Components/AutoScrollFlatList.tsx +169 -0
  118. package/src/Components/Icons.tsx +17 -0
  119. package/src/Components/index.tsx +3 -0
  120. package/src/FlashMarket/FlashHolder.tsx +8 -5
  121. package/src/MarketComponents/components/MyOrderList/api/index.ts +4 -1
  122. package/src/MarketComponents/components/OrderGradeBar.tsx +3 -2
  123. package/src/index.tsx +3 -0
  124. package/src/types.d.ts +36 -0
@@ -1534,6 +1534,22 @@ const GolferIcon = ({ color, size }:IconProps) => {
1534
1534
  )
1535
1535
  }
1536
1536
 
1537
+ const LocationIcon = ({ color, size }:IconProps) => {
1538
+ const ratio = 0.833
1539
+ const height = size ?? 18
1540
+ const width = height * ratio
1541
+
1542
+ return (
1543
+ <Svg width={`${width}px`} height={`${height}px`} viewBox="0 0 34 40">
1544
+ <G id="app-icons" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
1545
+ <G id="location-1-svgrepo-com" fill={color ?? Colors.brand.midnight}>
1546
+ <Path d="M17.2995556,35.5411111 C17.0148889,35.75 16.7495556,35.9395556 16.5071111,36.1095556 C16.2484444,35.938 15.9615556,35.7406667 15.6504444,35.5182222 C14.1835556,34.4686667 12.2811111,32.928 10.4075111,31.0064444 C6.56448889,27.0648889 3.33333333,22.0335556 3.33333333,16.6666667 C3.33333333,9.30286667 9.30286667,3.33333333 16.6666667,3.33333333 C24.0304444,3.33333333 30,9.30286667 30,16.6666667 C30,21.976 26.6264444,26.9928889 22.6428889,30.9762222 C20.7102222,32.9091111 18.7653333,34.4664444 17.2995556,35.5411111 Z M33.3333333,16.6666667 C33.3333333,20.0320028 32.2715689,23.184986 30.6840192,26.0184205 C25.9817575,34.4109455 16.6666667,40 16.6666667,40 C15.8333333,40 0,30 0,16.6666667 C0,7.46191111 7.46191111,0 16.6666667,0 C25.8713333,0 33.3333333,7.46191111 33.3333333,16.6666667 Z M20,16.6666667 C20,18.5075556 18.5075556,20 16.6666667,20 C14.8257778,20 13.3333333,18.5075556 13.3333333,16.6666667 C13.3333333,14.8257111 14.8257778,13.3333333 16.6666667,13.3333333 C18.5075556,13.3333333 20,14.8257111 20,16.6666667 Z M23.3333333,16.6666667 C23.3333333,20.3486667 20.3486667,23.3333333 16.6666667,23.3333333 C12.9846667,23.3333333 10,20.3486667 10,16.6666667 C10,12.9847778 12.9846667,10 16.6666667,10 C20.3486667,10 23.3333333,12.9847778 23.3333333,16.6666667 Z" id="Shape"></Path>
1547
+ </G>
1548
+ </G>
1549
+ </Svg>
1550
+ )
1551
+ }
1552
+
1537
1553
  export default {
1538
1554
  SearchIcon,
1539
1555
  LiquidityIcon,
@@ -1542,6 +1558,7 @@ export default {
1542
1558
  //BetScopeSuccessIcon,
1543
1559
  AlertIcon,
1544
1560
  GolferIcon,
1561
+ LocationIcon,
1545
1562
  GIFIcon,
1546
1563
  QuestionIcon,
1547
1564
  BarstoolIcon,
@@ -9,10 +9,13 @@ import Switch from './Switch';
9
9
  import ConfirmationModal from './ConfirmationModal';
10
10
  import Toggle from './Toggle';
11
11
  import ProgressBar from './ProgressBar';
12
+ import AutoScrollingFlatList from './AutoScrollFlatList';
13
+
12
14
  export {
13
15
  Button,
14
16
  Text,
15
17
  Spring,
18
+ AutoScrollingFlatList,
16
19
  Switch,
17
20
  TextInput,
18
21
  ProgressBar,
@@ -17,6 +17,7 @@ type FlashHolderProps = {
17
17
  player?:MyPlayerProps
18
18
  contest_type?:string,
19
19
  contest_id?:string,
20
+ hide_tabs?:boolean,
20
21
  side_type?:string,
21
22
  location?:LocationProps,
22
23
  side_id?:string,
@@ -26,7 +27,7 @@ type FlashHolderProps = {
26
27
  onRequestAuthenticate: () => void
27
28
  }
28
29
  const sections = [ 'selector','explainer','flash_market','options','footer' ]
29
- const FlashHolder = ({ float, distinct_id, league_id, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onRequestAuthenticate, onFocusPosition, onRequestLocation } : FlashHolderProps) => {
30
+ const FlashHolder = ({ float, distinct_id, hide_tabs, league_id, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onRequestAuthenticate, onFocusPosition, onRequestLocation } : FlashHolderProps) => {
30
31
  const Colors = useColors();
31
32
  const [ needs_reload, setNeedsReload ] = useState(false);
32
33
  const [ socket_campaigns, setSocketCampaigns ] = useState<PollCampaignProps[]>([]);
@@ -136,13 +137,13 @@ const FlashHolder = ({ float, distinct_id, league_id, player_id, player, locatio
136
137
 
137
138
  const loadData = async(options?:{ reload:boolean }) => {
138
139
  FlashMarketApi.setEnvironment();
140
+ setFlashData({ ...flash_data, holder_loading: true });
139
141
  if(poll_id){
140
142
  //need to grab the poll
141
- setFlashData({ ...flash_data, loaded:true });
143
+ setFlashData({ ...flash_data, loaded:true, holder_loading: false });
142
144
  return handleSelectPoll(poll_id, options);
143
145
  }
144
146
  let found_polls:PollProps[] = []
145
- setFlashData({ ...flash_data, holder_loading:true });
146
147
  if(league_id || contest_type || contest_id || side_type || side_id){
147
148
  found_polls = await FlashMarketApi.getActiveLinkedFlashMarkets(league_id, contest_type, contest_id, side_type, side_id);
148
149
  } else {
@@ -212,6 +213,7 @@ const FlashHolder = ({ float, distinct_id, league_id, player_id, player, locatio
212
213
  const renderSections = (data:{item:string, index:number}) => {
213
214
  switch(data.item){
214
215
  case 'selector':
216
+ if(hide_tabs){ return <></> }
215
217
  return (
216
218
  <View transparent style={{ flexDirection:'row' }}>
217
219
  <View transparent style={{ flex:1 }}>
@@ -242,6 +244,7 @@ const FlashHolder = ({ float, distinct_id, league_id, player_id, player, locatio
242
244
  )
243
245
  case 'explainer':
244
246
  if(active_flash_market){ return <></> }
247
+ if(hide_tabs){ return <></> }
245
248
  return (
246
249
  <View transparent style={{ padding:10, borderTopWidth:1, borderColor:Colors.borders.light }}>
247
250
  <Text theme='h2'>Select a tab above to view the market</Text>
@@ -260,7 +263,7 @@ const FlashHolder = ({ float, distinct_id, league_id, player_id, player, locatio
260
263
  poll_summaries={poll_summaries}
261
264
  poll_campaign={poll_campaign}
262
265
  flash_market_fees={flash_market_fees}
263
- loading={loading}
266
+ loading={loading || holder_loading}
264
267
  hide_image
265
268
  card_style={{ borderWidth:2, borderColor:Colors.text.success, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}
266
269
  init_expanded
@@ -277,7 +280,7 @@ const FlashHolder = ({ float, distinct_id, league_id, player_id, player, locatio
277
280
  }
278
281
  }
279
282
  return (
280
- <View float={float} style={{ margin:flash_markets.length > 0 ? 10 : undefined }}>
283
+ <View float={float}>
281
284
  {flash_markets.length > 0 || active_flash_market ?
282
285
  <FlatList
283
286
  key={'flash_sections'}
@@ -8,7 +8,10 @@ export const MyOrdersHelpers = {
8
8
  let event_ids = [ ...new Set(orders.filter(o => o.event_type == 'team').map(o => o.event_id))]
9
9
  let tournament_ids = [ ...new Set(orders.filter(o => o.event_type == 'tournament').map(o => o.event_id))]
10
10
  let match_ids = [ ...new Set(orders.filter(o => o.event_type == 'match').map(o => o.event_id))]
11
- return { event_ids, tournament_ids, match_ids }
11
+ let athlete_ids = [ ...new Set(orders.filter(o => o.side_type == 'athlete').map(o => o.side_id))]
12
+ let team_ids = [ ...new Set(orders.filter(o => o.side_type == 'team').map(o => o.side_id)) ]
13
+ let player_ids = [ ...new Set(orders.map(o => o.player_id)) ]
14
+ return { event_ids, tournament_ids, match_ids, athlete_ids, team_ids, player_ids }
12
15
  },
13
16
  getHedgesFromPositions: (orders:OrderProps[], markets:MarketProps[]):HedgeProps[] => {
14
17
  //1) Set up arrays to store hedges
@@ -17,13 +17,14 @@ type GradeBoxType = {
17
17
 
18
18
  type OrderGradeBarProps = {
19
19
  mask?:boolean,
20
+ style?:any,
20
21
  grade?: number,
21
22
  view_type: 'card'|'book'|'market',
22
23
  onSelectGrade?:() => void
23
24
  }
24
25
 
25
26
  //OrderGradeBar React Component
26
- const OrderGradeBar = ({ grade, view_type, mask, onSelectGrade }:OrderGradeBarProps ) => {
27
+ const OrderGradeBar = ({ grade, view_type, style, mask, onSelectGrade }:OrderGradeBarProps ) => {
27
28
  const Colors = useColors();
28
29
 
29
30
  //Stage the boxes and set the min / max and colors
@@ -97,7 +98,7 @@ const OrderGradeBar = ({ grade, view_type, mask, onSelectGrade }:OrderGradeBarPr
97
98
  }
98
99
 
99
100
  return (
100
- <View transparent>
101
+ <View transparent style={{ ...style }}>
101
102
  <Button style={{ padding:0 }} transparent disabled={onSelectGrade ? false : true} onPress={() => onSelectGrade ? onSelectGrade() : console.log('')}>
102
103
  {view_type === 'card' ?
103
104
  <FlatList style={{ alignSelf:'center' }} horizontal data={grade_boxes} renderItem={renderGradeBoxes} keyExtractor={(item) => item.min.toString()} />
package/src/index.tsx CHANGED
@@ -50,6 +50,8 @@ import GolfScoreboard from './GolfScoreboard';
50
50
  import FlashMarket from './FlashMarket';
51
51
  import FlashHolder from './FlashMarket/FlashHolder';
52
52
  import BEPostHog from './PostHog';
53
+ import BetMatch from './BetMatch';
54
+
53
55
 
54
56
 
55
57
  export {
@@ -57,6 +59,7 @@ export {
57
59
  Observer,
58
60
  BEEventApi,
59
61
  BELinkApi,
62
+ BetMatch,
60
63
  Ticker,
61
64
  LeaderboardCard,
62
65
  LocationTracker,
package/src/types.d.ts CHANGED
@@ -2133,6 +2133,42 @@ export interface EventOrderStatProps {
2133
2133
  market_type: string;
2134
2134
  }
2135
2135
 
2136
+
2137
+ export interface PlayerFilterProps {
2138
+ player_filter_id:string,
2139
+ player_id:string,
2140
+ pinned:boolean,
2141
+ name: string
2142
+ premium?:boolean,
2143
+ filter: OrderFilterProps,
2144
+ status:'active'|'inactive'|'deleted',
2145
+ create_datetime:any,
2146
+ last_update_datetime:any
2147
+ }
2148
+
2149
+
2150
+ export interface OrderFilterProps {
2151
+ market_type: 'FOR_MONEY'|'FREE'
2152
+ order_id?:string, //If populated, then this overrides all other options
2153
+ following_only:boolean,
2154
+ custom_players?:boolean,
2155
+ market_level?:string,
2156
+ external_book?:string,
2157
+ event_id?:string,
2158
+ market_types?:string,
2159
+ team_ids:string[],
2160
+ minimum_grade:number,
2161
+ athlete_ids:string[],
2162
+ event_type?:'team'|'tournament'|'match',
2163
+ market_ids:string[],
2164
+ league_ids:string[],
2165
+ live_only:boolean,
2166
+ player_ids:string[],
2167
+ location?:any,
2168
+ location_range_miles?:number,
2169
+ region?:string
2170
+ }
2171
+
2136
2172
  export type EventNameTypes = 'generated_link' |'incoming_user' |'identify_user' |'visibility_on' |'visibility_off'|
2137
2173
  'page_hit'|'sign_up'|'game_view'|'game_join'|'game_result'|'order_create'|'order_result'|'vouch_start'|'vouch_attempt'|
2138
2174
  'account_add_start'|'account_add_result'|'transaction_attempt'|'transaction_result'|'message_support'|'room_view'|'view_social'|