be-components 5.4.4 → 5.4.6

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 (46) hide show
  1. package/lib/commonjs/Components/Icons.js +27 -0
  2. package/lib/commonjs/Components/Icons.js.map +1 -1
  3. package/lib/commonjs/GolfScoreboard/api/index.js +119 -0
  4. package/lib/commonjs/GolfScoreboard/api/index.js.map +1 -1
  5. package/lib/commonjs/GolfScoreboard/components/LeaderBetSelector.js +282 -0
  6. package/lib/commonjs/GolfScoreboard/components/LeaderBetSelector.js.map +1 -0
  7. package/lib/commonjs/GolfScoreboard/index.js +202 -15
  8. package/lib/commonjs/GolfScoreboard/index.js.map +1 -1
  9. package/lib/module/Components/Icons.js +27 -0
  10. package/lib/module/Components/Icons.js.map +1 -1
  11. package/lib/module/GolfScoreboard/api/index.js +119 -0
  12. package/lib/module/GolfScoreboard/api/index.js.map +1 -1
  13. package/lib/module/GolfScoreboard/components/LeaderBetSelector.js +273 -0
  14. package/lib/module/GolfScoreboard/components/LeaderBetSelector.js.map +1 -0
  15. package/lib/module/GolfScoreboard/index.js +203 -16
  16. package/lib/module/GolfScoreboard/index.js.map +1 -1
  17. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  18. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  19. package/lib/typescript/lib/commonjs/GolfScoreboard/api/index.d.ts +6 -0
  20. package/lib/typescript/lib/commonjs/GolfScoreboard/api/index.d.ts.map +1 -1
  21. package/lib/typescript/lib/commonjs/GolfScoreboard/components/LeaderBetSelector.d.ts +16 -0
  22. package/lib/typescript/lib/commonjs/GolfScoreboard/components/LeaderBetSelector.d.ts.map +1 -0
  23. package/lib/typescript/lib/commonjs/GolfScoreboard/index.d.ts +4 -1
  24. package/lib/typescript/lib/commonjs/GolfScoreboard/index.d.ts.map +1 -1
  25. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  26. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  27. package/lib/typescript/lib/module/GolfScoreboard/api/index.d.ts +6 -0
  28. package/lib/typescript/lib/module/GolfScoreboard/api/index.d.ts.map +1 -1
  29. package/lib/typescript/lib/module/GolfScoreboard/components/LeaderBetSelector.d.ts +16 -0
  30. package/lib/typescript/lib/module/GolfScoreboard/components/LeaderBetSelector.d.ts.map +1 -0
  31. package/lib/typescript/lib/module/GolfScoreboard/index.d.ts +4 -1
  32. package/lib/typescript/lib/module/GolfScoreboard/index.d.ts.map +1 -1
  33. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  34. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  35. package/lib/typescript/src/GolfScoreboard/api/index.d.ts +8 -1
  36. package/lib/typescript/src/GolfScoreboard/api/index.d.ts.map +1 -1
  37. package/lib/typescript/src/GolfScoreboard/components/LeaderBetSelector.d.ts +18 -0
  38. package/lib/typescript/src/GolfScoreboard/components/LeaderBetSelector.d.ts.map +1 -0
  39. package/lib/typescript/src/GolfScoreboard/index.d.ts +5 -1
  40. package/lib/typescript/src/GolfScoreboard/index.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/Components/Icons.tsx +16 -0
  43. package/src/GolfScoreboard/api/index.tsx +96 -2
  44. package/src/GolfScoreboard/components/LeaderBetSelector.tsx +192 -0
  45. package/src/GolfScoreboard/index.tsx +152 -18
  46. package/src/types.d.ts +30 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../../../commonjs/Components/Icons.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2KA;;;QAwBC;AAoqFD;;;QA6BC;AAzpED;;;QAiCC;AAipED;;;QA2CC;AA57FD;;;QAqCC;AAijGD;;;QAyBC;AAlKD;;;QAqCC;AA0BD;;;QA+CC;AAxED;;;QAwBC;AAjYD;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;;;QA+BC;AAi0CD;;;;QAyHC;AAjkBD;;;QA4BC;AAgYD;;;QA2CC;AAsxCD;;QAqBC;AArtDD;;;QAyBC;AAjFD;;;QA0BC;AAoVD;;;QAwEC;AA1GD;;;QAiCC;AAzFD;;;QAgCC;AAxED;;;QAuCC;AA/ED;;;QAuCC;AAlhCD;;QAuBC;AApPD;;;QA4BC;AA0jCD;;;QA6EC;AA7OD;;;QAwBC;AA9FD;;;QAkCC;AA6DD;;;QAoDC;AAvkBD;;QAsDC;AAk4ED;;;QAeC;AA3yED;;QA6DC;AA6rDD;;;QA2BC;AA1+DD;;;QA0BC;AAmWD;;QA2CC;AApoBD;;;QAyBC;AACD;;;QA2BC;AAglBD;;QA2CC;AApWD;;QAiDC;AACD;;QAkDC;AAzLD;;;;QA6BC"}
@@ -2,10 +2,16 @@ export const __esModule: boolean;
2
2
  export namespace GolfApi {
3
3
  function setEnvironment(): void;
4
4
  function getTournamentById(tournament_id: any): Promise<any>;
5
+ function getScorecard(tournament_id: any, athlete_id: any, round_number: any): Promise<any>;
6
+ function getGolfStats(tournament_id: any): Promise<any>;
5
7
  function getScoreboard(tournament_id: any): Promise<any>;
6
8
  function getLeagueById(league_id: any): Promise<any>;
7
9
  }
8
10
  export namespace GolfHelpers {
11
+ function getGolfersOnHole(golf_leaders: any, hole_number: any, active_round: any): any[];
12
+ function getCurrentHole(golf_leader: any, active_round: any): any;
13
+ function getParTradeFromHoleStats(tournament_id: any, athlete: any, market: any, hole_stats: any): any[];
14
+ function getHoleStats(hole_number: any, golf_statistics: any, active_round: any): any;
9
15
  function formatPlace(place: any): string;
10
16
  }
11
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/GolfScoreboard/api/index.js"],"names":[],"mappings":";;IAWkB,gCAGf;IACkB,6DAOlB;IACc,yDASd;IACc,qDAOd;;;IAGY,yCAuBZ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../commonjs/GolfScoreboard/api/index.js"],"names":[],"mappings":";;IAYkB,gCAGf;IACkB,6DAOlB;IACa,4FAQb;IACa,wDAQb;IACc,yDASd;IACc,qDAOd;;;IAGiB,yFAmBjB;IACe,kEAUf;IACyB,yGAsCzB;IACa,sFA6Bb;IACY,yCAuBZ"}
@@ -0,0 +1,16 @@
1
+ export const __esModule: boolean;
2
+ export default LeaderBetSelector;
3
+ declare function LeaderBetSelector({ athlete, golf_leader, golf_statistics, best_available_orders, latest_trades, tournament, markets, active_round, golf_course, onClose, onOrder }: {
4
+ athlete: any;
5
+ golf_leader: any;
6
+ golf_statistics: any;
7
+ best_available_orders: any;
8
+ latest_trades: any;
9
+ tournament: any;
10
+ markets: any;
11
+ active_round: any;
12
+ golf_course: any;
13
+ onClose: any;
14
+ onOrder: any;
15
+ }): any;
16
+ //# sourceMappingURL=LeaderBetSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaderBetSelector.d.ts","sourceRoot":"","sources":["../../../../../commonjs/GolfScoreboard/components/LeaderBetSelector.js"],"names":[],"mappings":";;AAoBA;;;;;;;;;;;;QAmQC"}
@@ -1,6 +1,9 @@
1
1
  export const __esModule: boolean;
2
2
  export default GolfScoreboard;
3
- declare function GolfScoreboard({ tournament_id }: {
3
+ declare function GolfScoreboard({ tournament_id, markets, best_available, onOrder }: {
4
4
  tournament_id: any;
5
+ markets: any;
6
+ best_available: any;
7
+ onOrder: any;
5
8
  }): any;
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/GolfScoreboard/index.js"],"names":[],"mappings":";;AAiBA;;QAwKC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/GolfScoreboard/index.js"],"names":[],"mappings":";;AAoBA;;;;;QAgWC"}
@@ -4,6 +4,7 @@ declare namespace _default {
4
4
  export { EyeOnIcon };
5
5
  export { MarketClosedIcon };
6
6
  export { AlertIcon };
7
+ export { GolferIcon };
7
8
  export { GIFIcon };
8
9
  export { QuestionIcon };
9
10
  export { BarstoolIcon };
@@ -107,6 +108,10 @@ declare function AlertIcon({ color, size }: {
107
108
  color: any;
108
109
  size: any;
109
110
  }): React.CElement<import("react-native-svg").SvgProps | Readonly<import("react-native-svg").SvgProps>, Svg>;
111
+ declare function GolferIcon({ color, size }: {
112
+ color: any;
113
+ size: any;
114
+ }): React.CElement<import("react-native-svg").SvgProps | Readonly<import("react-native-svg").SvgProps>, Svg>;
110
115
  declare function GIFIcon({ color, size }: {
111
116
  color: any;
112
117
  size: any;
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../../../module/Components/Icons.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkKA;;;6GAwBC;AAoqFD;;;6GA6BC;AAzpED;;;6GAiCC;AAipED;;;6GA2CC;AA57FD;;;6GAqCC;AAijGD;;;6GAyBC;AAlKD;;;6GAqCC;AA0BD;;;6GA+CC;AAxED;;;6GAwBC;AAjYD;;;6GA2BC;AAr7BD;;;6GAyBC;AAmzCD;;;6GAyBC;AAhYD;;;6GAkCC;AA5bD;;;6GA4BC;AAr9BD;;;6GAsBC;AAi+CD;;;6GAuBC;AAxJD;;;6GAwBC;AAzqBD;;;6GA4BC;AAqND;;;6GAqCC;AA5FD;;;6GAyBC;AAvFD;;;6GA6DC;AA5FD;;;6GA8BC;AA32DD;;6GA4BC;AACD;;6GAgCC;AACD;;;6GAsBC;AA4+DD;;;6GAkCC;AACD;;;6GAmCC;AAjiDD;;;6GAkCC;AAmxDD;;;6GAyBC;AApID;;;6GA8CC;AA7iBD;;;6GA4BC;AAt9BD;;;6GAmCC;AA2hDD;;;6GAyBC;AAhsBD;;;6GAkCC;AA7FD;;;6GA6B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D;;;6GAwBC;AA9FD;;;6GAkCC;AA6DD;;;6GAoDC;AAvkBD;;6GAsDC;AAk4ED;;;6GAeC;AA3yED;;6GA6DC;AA6rDD;;;6GA2BC;AA1+DD;;;6GA0BC;AAmWD;;6GA2CC;AApoBD;;;6GAyBC;AACD;;;6GA2BC;AAglBD;;6GA2CC;AApWD;;6GAiDC;AACD;;6GAkDC;AAzLD;;;;6GA6BC;gBArgB+F,kBAAkB;kBAFhG,OAAO"}
@@ -1,10 +1,16 @@
1
1
  export namespace GolfApi {
2
2
  function setEnvironment(): void;
3
3
  function getTournamentById(tournament_id: any): Promise<any>;
4
+ function getScorecard(tournament_id: any, athlete_id: any, round_number: any): Promise<any>;
5
+ function getGolfStats(tournament_id: any): Promise<any>;
4
6
  function getScoreboard(tournament_id: any): Promise<any>;
5
7
  function getLeagueById(league_id: any): Promise<any>;
6
8
  }
7
9
  export namespace GolfHelpers {
10
+ function getGolfersOnHole(golf_leaders: any, hole_number: any, active_round: any): any[];
11
+ function getCurrentHole(golf_leader: any, active_round: any): any;
12
+ function getParTradeFromHoleStats(tournament_id: any, athlete: any, market: any, hole_stats: any): any[];
13
+ function getHoleStats(hole_number: any, golf_statistics: any, active_round: any): any;
8
14
  function formatPlace(place: any): string;
9
15
  }
10
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/GolfScoreboard/api/index.js"],"names":[],"mappings":";IAIkB,gCAGf;IACkB,6DAOlB;IACc,yDASd;IACc,qDAOd;;;IAGY,yCAuBZ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/GolfScoreboard/api/index.js"],"names":[],"mappings":";IAKkB,gCAGf;IACkB,6DAOlB;IACa,4FAQb;IACa,wDAQb;IACc,yDASd;IACc,qDAOd;;;IAGiB,yFAmBjB;IACe,kEAUf;IACyB,yGAsCzB;IACa,sFA6Bb;IACY,yCAuBZ"}
@@ -0,0 +1,16 @@
1
+ export default LeaderBetSelector;
2
+ declare function LeaderBetSelector({ athlete, golf_leader, golf_statistics, best_available_orders, latest_trades, tournament, markets, active_round, golf_course, onClose, onOrder }: {
3
+ athlete: any;
4
+ golf_leader: any;
5
+ golf_statistics: any;
6
+ best_available_orders: any;
7
+ latest_trades: any;
8
+ tournament: any;
9
+ markets: any;
10
+ active_round: any;
11
+ golf_course: any;
12
+ onClose: any;
13
+ onOrder: any;
14
+ }): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
15
+ import React from 'react';
16
+ //# sourceMappingURL=LeaderBetSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaderBetSelector.d.ts","sourceRoot":"","sources":["../../../../../module/GolfScoreboard/components/LeaderBetSelector.js"],"names":[],"mappings":";AAWA;;;;;;;;;;;;kGAmQC;kBA9Q0C,OAAO"}
@@ -1,6 +1,9 @@
1
1
  export default GolfScoreboard;
2
- declare function GolfScoreboard({ tournament_id }: {
2
+ declare function GolfScoreboard({ tournament_id, markets, best_available, onOrder }: {
3
3
  tournament_id: any;
4
+ markets: any;
5
+ best_available: any;
6
+ onOrder: any;
4
7
  }): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
5
8
  import React from 'react';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/GolfScoreboard/index.js"],"names":[],"mappings":";AAQA;;kGAwKC;kBAhL0C,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/GolfScoreboard/index.js"],"names":[],"mappings":";AAWA;;;;;kGAgWC;kBA3W0C,OAAO"}
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  EyeOnIcon: ({ color, size }: IconProps) => React.JSX.Element;
12
12
  MarketClosedIcon: ({ color, size }: IconProps) => React.JSX.Element;
13
13
  AlertIcon: ({ color, size }: IconProps) => React.JSX.Element;
14
+ GolferIcon: ({ color, size }: IconProps) => React.JSX.Element;
14
15
  GIFIcon: ({ color, size }: IconProps) => React.JSX.Element;
15
16
  QuestionIcon: ({ color, size }: IconProps) => React.JSX.Element;
16
17
  BarstoolIcon: ({ color, size }: IconProps) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../../../src/Components/Icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,SAAS,GAAG;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAC,MAAM,CAAC;IACxB,IAAI,CAAC,EAAC,MAAM,CAAC;IACb,SAAS,CAAC,EAAC,IAAI,GAAC,MAAM,GAAC,MAAM,GAAC,OAAO,CAAA;CACxC,CAAA;;kCAgEqC,SAAS;qCAmwCR,SAAS;iCA3+Bd,SAAS;wCAwgCH,SAAS;iCA71Cd,SAAS;+BAu7CX,SAAS;oCA5DJ,SAAS;oCA6BT,SAAS;kCAfX,SAAS;+BAnLZ,SAAS;gCAlaP,SAAS;gCAsnBV,SAAS;mCAjLN,SAAS;gCAlMX,SAAS;uCArbH,SAAS;kCA+sBd,SAAS;gCAxEX,SAAS;uCA1SA,SAAS;iCAsGd,SAAS;kCA3BT,SAAS;gCApBX,SAAS;gCAdT,SAAS;4BAr1Bf,SAAS;6BAcR,SAAS;gCAgBN,SAAS;iCAq6BN,SAAS;iCAiBT,SAAS;wCAxrBN,SAAS;uCAy0BR,SAAS;sCArDV,SAAS;sCAzOV,SAAS;sCAjbP,SAAS;oCA2tBZ,SAAS;iCAvTV,SAAS;sCAjCJ,SAAS;uCA97BV,SAAS;oCAyoCV,SAAS;iCAzNZ,SAAS;mCAp3BT,SAAS;kCAwWZ,SAAS;mDA/QU,SAAS;iCA4wB1B,SAAS;gCAlBT,SAAS;2CA3BC,SAAS;kCAhBlB,SAAS;gCA7fd,SAAS;4BAqz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sGd,SAAS;kCA3BT,SAAS;gCApBX,SAAS;gCAdT,SAAS;4BAr1Bf,SAAS;6BAcR,SAAS;gCAgBN,SAAS;iCAq6BN,SAAS;iCAiBT,SAAS;wCAxrBN,SAAS;uCAy0BR,SAAS;sCArDV,SAAS;sCAzOV,SAAS;sCAjbP,SAAS;oCA2tBZ,SAAS;iCAvTV,SAAS;sCAjCJ,SAAS;uCA97BV,SAAS;oCAyoCV,SAAS;iCAzNZ,SAAS;mCAp3BT,SAAS;kCAwWZ,SAAS;mDA/QU,SAAS;iCA4wB1B,SAAS;gCAlBT,SAAS;2CA3BC,SAAS;kCAhBlB,SAAS;gCA7fd,SAAS;4BAqzBV,SAAS;oCAxUD,SAAS;mCAjBV,SAAS;oCAryBX,SAAS;uCAoxBH,SAAS;6BA5qBpB,SAAS;sCAgpBE,SAAS;0BA9bvB,SAAS;oCAgvBG,SAAS;2BA7TlB,SAAS;iCAlsBL,SAAS;8CAsnBM,SAAS;oCAlMrB,SAAS;uCA+KL,SAAS;8BA0nBlB,SAAS;sCA1xBF,SAAS;oCA5BX,SAAS;oCAiKR,SAAS;uCAhBN,SAAS;8BA1BlB,SAAS;sCAdD,SAAS;kCAdb,SAAS;6BApdf,SAAS;mCAxGH,SAAS;kCA4gBT,SAAS;+BA1EZ,SAAS;kCAhCR,SAAS;qCA6CL,SAAS;iCAjPb,SAAS;gCAwnCV,SAAS;6BA1jCZ,SAAS;uCA6yBC,SAAS;iCAx4Bf,SAAS;uCA0KH,SAAS;gCAhShB,SAAS;iCAeR,SAAS;qCAsSP,SAAS;6BA1If,SAAS;+BAmBP,SAAS;oDAzDY,SAAS;;AAwuC/D,wBAyFC"}
@@ -1,15 +1,22 @@
1
- import type { AthleteProps, GolfCourseProps, GolfLeaderProps, LeagueProps, TournamentProps } from "../../types";
1
+ import type { AthleteProps, GolfCourseProps, GolfHoleStatistics, GolfLeaderProps, GolfScorecardProps, GolfTournamentStatisticsProps, LeagueProps, MarketProps, TournamentProps, TradeProps } from "../../types";
2
2
  export declare const GolfApi: {
3
3
  setEnvironment: () => void;
4
4
  getTournamentById: (tournament_id: string) => Promise<TournamentProps | undefined>;
5
+ getScorecard: (tournament_id: string, athlete_id?: string, round_number?: number) => Promise<GolfScorecardProps[]>;
6
+ getGolfStats: (tournament_id: string) => Promise<GolfTournamentStatisticsProps | undefined>;
5
7
  getScoreboard: (tournament_id: string) => Promise<undefined | {
6
8
  golf_course: GolfCourseProps;
7
9
  golf_leaders: GolfLeaderProps[];
8
10
  athletes: AthleteProps[];
11
+ active_round?: number;
9
12
  }>;
10
13
  getLeagueById: (league_id: string) => Promise<LeagueProps | undefined>;
11
14
  };
12
15
  export declare const GolfHelpers: {
16
+ getGolfersOnHole: (golf_leaders: GolfLeaderProps[], hole_number: number, active_round?: number) => GolfLeaderProps[];
17
+ getCurrentHole: (golf_leader: GolfLeaderProps, active_round?: number) => number;
18
+ getParTradeFromHoleStats: (tournament_id: string, athlete: AthleteProps, market?: MarketProps, hole_stats?: GolfHoleStatistics) => TradeProps[];
19
+ getHoleStats: (hole_number: number, golf_statistics?: GolfTournamentStatisticsProps, active_round?: number) => GolfHoleStatistics | undefined;
13
20
  formatPlace: (place: number) => string;
14
21
  };
15
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/GolfScoreboard/api/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhH,eAAO,MAAM,OAAO;;uCAKuB,MAAM,KAAE,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;mCAQhD,MAAM,KAAE,OAAO,CAAC,SAAS,GAAG;QAAE,WAAW,EAAC,eAAe,CAAC;QAAC,YAAY,EAAC,eAAe,EAAE,CAAC;QAAC,QAAQ,EAAC,YAAY,EAAE,CAAA;KAAE,CAAC;+BAU1H,MAAM,KAAE,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;CAQzE,CAAA;AAED,eAAO,MAAM,WAAW;yBACA,MAAM;CAyB7B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/GolfScoreboard/api/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAKhN,eAAO,MAAM,OAAO;;uCAKuB,MAAM,KAAE,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;kCAQjD,MAAM,eAAc,MAAM,iBAAgB,MAAM,KAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;kCAS/E,MAAM,KAAE,OAAO,CAAC,6BAA6B,GAAG,SAAS,CAAC;mCASzD,MAAM,KAAE,OAAO,CAAC,SAAS,GAAG;QAAE,WAAW,EAAC,eAAe,CAAC;QAAC,YAAY,EAAC,eAAe,EAAE,CAAC;QAAC,QAAQ,EAAC,YAAY,EAAE,CAAC;QAAC,YAAY,CAAC,EAAC,MAAM,CAAA;KAAE,CAAC;+BAUhJ,MAAM,KAAE,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;CAQzE,CAAA;AAED,eAAO,MAAM,WAAW;qCACY,eAAe,EAAE,eAAc,MAAM,iBAAgB,MAAM,KAAE,eAAe,EAAE;kCAYjF,eAAe,iBAAgB,MAAM;8CAOzB,MAAM,WAAU,YAAY,WAAU,WAAW,eAAc,kBAAkB;gCAqC/F,MAAM,oBAAmB,6BAA6B,iBAAgB,MAAM;yBAmBnF,MAAM;CAyB7B,CAAA"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { AthleteProps, BestAvailableOrderProps, GolfCourseProps, GolfLeaderProps, GolfTournamentStatisticsProps, MarketProps, OrderProps, TournamentProps, TradeProps } from '../../types';
3
+ type LeaderBetSelectorProps = {
4
+ tournament: TournamentProps;
5
+ best_available_orders: BestAvailableOrderProps[];
6
+ latest_trades: TradeProps[];
7
+ golf_leader: GolfLeaderProps;
8
+ golf_course: GolfCourseProps;
9
+ athlete: AthleteProps;
10
+ markets: MarketProps[];
11
+ golf_statistics?: GolfTournamentStatisticsProps;
12
+ active_round?: number;
13
+ onClose: () => void;
14
+ onOrder: (order: OrderProps) => void;
15
+ };
16
+ declare const LeaderBetSelector: ({ athlete, golf_leader, golf_statistics, best_available_orders, latest_trades, tournament, markets, active_round, golf_course, onClose, onOrder }: LeaderBetSelectorProps) => React.JSX.Element;
17
+ export default LeaderBetSelector;
18
+ //# sourceMappingURL=LeaderBetSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeaderBetSelector.d.ts","sourceRoot":"","sources":["../../../../../src/GolfScoreboard/components/LeaderBetSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,eAAe,EAAiB,eAAe,EAAsB,6BAA6B,EAAE,WAAW,EAAyB,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAU1P,KAAK,sBAAsB,GAAG;IAC1B,UAAU,EAAC,eAAe,CAAC;IAC3B,qBAAqB,EAAC,uBAAuB,EAAE,CAAC;IAChD,aAAa,EAAC,UAAU,EAAE,CAAC;IAC3B,WAAW,EAAC,eAAe,CAAC;IAC5B,WAAW,EAAC,eAAe,CAAC;IAC5B,OAAO,EAAC,YAAY,CAAC;IACrB,OAAO,EAAC,WAAW,EAAE,CAAC;IACtB,eAAe,CAAC,EAAC,6BAA6B,CAAC;IAC/C,YAAY,CAAC,EAAC,MAAM,CAAC;IACrB,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,OAAO,EAAC,CAAC,KAAK,EAAC,UAAU,KAAK,IAAI,CAAA;CACrC,CAAA;AAGD,QAAA,MAAM,iBAAiB,GAAI,mJAAkJ,sBAAsB,sBAkKlM,CAAA;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
+ import type { BestAvailableOrderProps, MarketProps, OrderProps } from '../types';
2
3
  type GolfScoreboardProps = {
3
4
  tournament_id: string;
5
+ markets: MarketProps[];
6
+ best_available: BestAvailableOrderProps[];
7
+ onOrder: (order: OrderProps) => void;
4
8
  };
5
- declare const GolfScoreboard: ({ tournament_id }: GolfScoreboardProps) => React.JSX.Element;
9
+ declare const GolfScoreboard: ({ tournament_id, markets, best_available, onOrder }: GolfScoreboardProps) => React.JSX.Element;
6
10
  export default GolfScoreboard;
7
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/GolfScoreboard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,KAAK,mBAAmB,GAAG;IACvB,aAAa,EAAC,MAAM,CAAA;CACvB,CAAA;AAGD,QAAA,MAAM,cAAc,GAAI,mBAAkB,mBAAmB,sBA2H5D,CAAA;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/GolfScoreboard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAgB,uBAAuB,EAA+F,WAAW,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;AAU7M,KAAK,mBAAmB,GAAG;IACvB,aAAa,EAAC,MAAM,CAAC;IACrB,OAAO,EAAC,WAAW,EAAE,CAAC;IACtB,cAAc,EAAC,uBAAuB,EAAE,CAAC;IACzC,OAAO,EAAC,CAAC,KAAK,EAAC,UAAU,KAAK,IAAI,CAAA;CACrC,CAAA;AAGD,QAAA,MAAM,cAAc,GAAI,qDAAoD,mBAAmB,sBA2P9F,CAAA;AAED,eAAe,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-components",
3
- "version": "5.4.4",
3
+ "version": "5.4.6",
4
4
  "description": "Components for BettorEdge Apps",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1489,6 +1489,21 @@ const GIFIcon = ({ color, size }:IconProps) => {
1489
1489
  )
1490
1490
  }
1491
1491
 
1492
+ const GolferIcon = ({ color, size }:IconProps) => {
1493
+ const ratio = 0.6
1494
+ const height = size ?? 18
1495
+ const width = height * ratio
1496
+ return (
1497
+ <Svg width={`${width}px`} height={`${height}px`} viewBox="0 0 24 40">
1498
+ <G id="Page-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
1499
+ <G id="golf-svgrepo-com" fill={color??Colors.brand.midnight} fillRule="nonzero">
1500
+ <Path d="M0,2.87769784 C0,3.16546763 0,3.45323741 0,3.45323741 C0,4.60431655 0.863309353,5.4676259 2.01438849,5.4676259 C2.87769784,5.4676259 3.45323741,4.89208633 3.74100719,4.02877698 L3.74100719,4.02877698 L4.31683453,2.58992806 L20.4319424,9.20863309 L9.20892086,16.9784173 C8.05784173,17.8417266 8.05784173,18.9928058 8.34561151,20.1438849 L10.9355396,26.1870504 L7.19453237,37.4100719 C6.61899281,38.8489209 7.77007194,40 8.92115108,40 C9.78446043,40 10.36,39.7122302 10.6477698,38.5611511 L14.6765468,27.0503597 L14.9643165,27.9136691 L14.9643165,37.9856115 C14.9643165,37.9856115 14.9643165,40 16.978705,40 C18.9930935,40 18.9930935,37.9856115 18.9930935,37.9856115 L18.9930935,28.4892086 C18.9930935,27.9136691 18.9930935,27.6258993 18.7053237,27.0503597 L14.6765468,17.2661871 L22.4463309,11.7985612 C23.0218705,11.2230216 23.5974101,10.9352518 23.5974101,10.0719424 C23.5974101,9.20863309 23.0218705,8.63309353 22.4463309,8.34532374 L1.72690647,0 C1.4742446,0 1.38733813,0.0515107914 1.15107914,0.287769784 L0,2.87769784 Z M6.04345324,8.34532374 C3.74129496,8.34532374 1.72690647,10.3597122 1.72690647,12.6618705 C1.72690647,14.9640288 3.74129496,16.9784173 6.04345324,16.9784173 C8.34561151,16.9784173 10.36,14.9640288 10.36,12.6618705 C10.36,10.3597122 8.34532374,8.34532374 6.04345324,8.34532374 Z" id="path11758"></Path>
1501
+ </G>
1502
+ </G>
1503
+ </Svg>
1504
+ )
1505
+ }
1506
+
1492
1507
  export default {
1493
1508
  SearchIcon,
1494
1509
  LiquidityIcon,
@@ -1496,6 +1511,7 @@ export default {
1496
1511
  MarketClosedIcon,
1497
1512
  //BetScopeSuccessIcon,
1498
1513
  AlertIcon,
1514
+ GolferIcon,
1499
1515
  GIFIcon,
1500
1516
  QuestionIcon,
1501
1517
  BarstoolIcon,
@@ -1,6 +1,7 @@
1
1
  import axios from "axios";
2
2
  import { APIOverrides } from "../../ApiOverrides";
3
- import type { AthleteProps, GolfCourseProps, GolfLeaderProps, LeagueProps, TournamentProps } from "../../types";
3
+ import type { AthleteProps, GolfCourseProps, GolfHoleStatistics, GolfLeaderProps, GolfScorecardProps, GolfTournamentStatisticsProps, LeagueProps, MarketProps, TournamentProps, TradeProps } from "../../types";
4
+ import { MarketComponentHelpers } from "../../MarketComponents/api";
4
5
 
5
6
  let EVENT_SVC_API = ''
6
7
 
@@ -17,7 +18,25 @@ export const GolfApi = {
17
18
  return undefined
18
19
  }
19
20
  },
20
- getScoreboard: async(tournament_id:string):Promise<undefined | { golf_course:GolfCourseProps, golf_leaders:GolfLeaderProps[], athletes:AthleteProps[] }> => {
21
+ getScorecard: async(tournament_id:string, athlete_id?:string, round_number?:number):Promise<GolfScorecardProps[]> => {
22
+ try {
23
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/tournaments/golf/scorecard/${tournament_id}?athlete_id=${athlete_id}&round_number=${round_number}`);
24
+ return resp.data.golf_scorecards
25
+ } catch (e) {
26
+ console.log(e)
27
+ return []
28
+ }
29
+ },
30
+ getGolfStats: async(tournament_id:string):Promise<GolfTournamentStatisticsProps | undefined> => {
31
+ try {
32
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/tournaments/golf/statistics/${tournament_id}`);
33
+ return resp.data.golf_tournament_statistics
34
+ } catch (e) {
35
+ console.log(e);
36
+ return undefined
37
+ }
38
+ },
39
+ getScoreboard: async(tournament_id:string):Promise<undefined | { golf_course:GolfCourseProps, golf_leaders:GolfLeaderProps[], athletes:AthleteProps[], active_round?:number }> => {
21
40
  try {
22
41
  const resp = await axios.get(`${EVENT_SVC_API}/v1/tournaments/golf/details/${tournament_id}`);
23
42
  //console.log(resp.data);
@@ -38,6 +57,81 @@ export const GolfApi = {
38
57
  }
39
58
 
40
59
  export const GolfHelpers = {
60
+ getGolfersOnHole: (golf_leaders:GolfLeaderProps[], hole_number:number, active_round?:number):GolfLeaderProps[] => {
61
+ if(!active_round){ return [] }
62
+ let golfers:GolfLeaderProps[] = []
63
+ golf_leaders.map(l => {
64
+ if(l.cut){ return }
65
+ let round = l.leader_rounds.find(r => r.round_number == active_round);
66
+ if(!round){ return }
67
+ let curr_hole = round.thru + 1
68
+ if(curr_hole == hole_number){ golfers.push(l) }
69
+ })
70
+ return golfers
71
+ },
72
+ getCurrentHole: (golf_leader:GolfLeaderProps, active_round?:number) => {
73
+ if(!active_round){ return 19 }
74
+ let round = golf_leader.leader_rounds.find(r => r.round_number == active_round)
75
+ if(!round){ return 19 }
76
+ let curr_hole = round.thru + 1
77
+ return curr_hole
78
+ },
79
+ getParTradeFromHoleStats: (tournament_id:string, athlete:AthleteProps, market?:MarketProps, hole_stats?:GolfHoleStatistics) => {
80
+ if(!market){ return [] }
81
+ let trades:TradeProps[] = []
82
+ let over_probability = 0.5
83
+ let under_probability = 0.5
84
+ if(hole_stats){
85
+ let diff_pct = hole_stats.avg_diff / hole_stats.par
86
+ over_probability = 0.5 + diff_pct
87
+ under_probability = 1 - over_probability
88
+ }
89
+ market.side_options.map(so => {
90
+ let prob = so.side == 'under' ? under_probability : over_probability
91
+ let odds = MarketComponentHelpers.calcAmericanOddsFromProbability(prob);
92
+ let trade:TradeProps = {
93
+ trade_id:'',
94
+ var_1:0,
95
+ trade_amt:0,
96
+ cumulative_amt:0,
97
+ market_type:'FOR_MONEY',
98
+ odds: odds,
99
+ probability: prob,
100
+ side: so.side,
101
+ side_type: so.id_source,
102
+ side_id: athlete.athlete_id,
103
+ reversed_side_id: athlete.athlete_id,
104
+ create_datetime: '', last_update_datetime: '',
105
+ market_id: market.market_id,
106
+ event_id:tournament_id,
107
+ event_type: 'tournament',
108
+ latest: true,
109
+ position_ids: []
110
+ };
111
+ trades.push(trade);
112
+ })
113
+ return trades
114
+
115
+ },
116
+ getHoleStats: (hole_number:number, golf_statistics?:GolfTournamentStatisticsProps, active_round?:number) => {
117
+ if(!golf_statistics){ return undefined }
118
+ let round_stats = golf_statistics.round_statistics.find(r => r.round_number == active_round);
119
+ if(!round_stats){
120
+ round_stats = golf_statistics.round_statistics[0]
121
+ }
122
+ if(!round_stats) { return undefined }
123
+ let hole_stat = round_stats.hole_statistics.find(h => h.hole_number == hole_number);
124
+ if(!hole_stat) { return undefined }
125
+ if(hole_stat.strokes_avg == 0){
126
+ //We dont have any data here!! Lets try and get a previous round if we can
127
+ let new_stat = golf_statistics.round_statistics[0]
128
+ if(new_stat){
129
+ let new_hole_stat = new_stat.hole_statistics.find(h => h.hole_number == hole_number);
130
+ if(new_hole_stat && new_hole_stat.strokes_avg > 0){ hole_stat = { ...new_hole_stat, previous_round: new_stat.round_number }}
131
+ }
132
+ }
133
+ return hole_stat
134
+ },
41
135
  formatPlace :(place:number) => {
42
136
  switch(place){
43
137
  case 1:
@@ -0,0 +1,192 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Button, Text, View } from "../../Components/Themed"
3
+ import type { AthleteProps, BestAvailableOrderProps, GolfCourseProps, GolfHoleProps, GolfLeaderProps, GolfScorecardProps, GolfTournamentStatisticsProps, MarketProps, MarketSideOptionProps, OrderProps, TournamentProps, TradeProps } from '../../types';
4
+ import { ActivityIndicator, FlatList } from 'react-native';
5
+ import { GolfApi, GolfHelpers } from '../api';
6
+ import { Icons } from '../../Components';
7
+ import { useColors } from '../../constants/useColors';
8
+ import MarketButton from '../../MarketComponents/components/MarketButton';
9
+ import { MarketComponentHelpers } from '../../MarketComponents/api';
10
+ import { MarketButtonHelpers } from '../../MarketComponents/components/MarketButton/api';
11
+ import { AthleteImage } from '../../Components/Jerseys';
12
+
13
+ type LeaderBetSelectorProps = {
14
+ tournament:TournamentProps,
15
+ best_available_orders:BestAvailableOrderProps[],
16
+ latest_trades:TradeProps[],
17
+ golf_leader:GolfLeaderProps,
18
+ golf_course:GolfCourseProps,
19
+ athlete:AthleteProps,
20
+ markets:MarketProps[],
21
+ golf_statistics?:GolfTournamentStatisticsProps,
22
+ active_round?:number,
23
+ onClose:() => void,
24
+ onOrder:(order:OrderProps) => void
25
+ }
26
+ const leader_bet_sections = ['leader','market_details','holes']
27
+
28
+ const LeaderBetSelector = ({ athlete, golf_leader, golf_statistics, best_available_orders, latest_trades, tournament, markets, active_round, golf_course, onClose, onOrder }:LeaderBetSelectorProps) => {
29
+ const [ leader_data, setLeaderData ] = useState<{
30
+ loading:boolean,
31
+ scorecards:GolfScorecardProps[]
32
+ }>({
33
+ loading:false,
34
+ scorecards:[]
35
+ });
36
+ const { loading, scorecards } = leader_data
37
+
38
+ useEffect(() => {
39
+ getData();
40
+ },[athlete?.athlete_id]);
41
+
42
+ const getData = async() => {
43
+ setLeaderData({ ...leader_data, loading:true });
44
+ const scorecards = await GolfApi.getScorecard(tournament.tournament_id, athlete.athlete_id, active_round);
45
+ let score_card = scorecards.filter(c => c.athlete_id == athlete.athlete_id && c.round_number == active_round);
46
+ setLeaderData({
47
+ loading:false,
48
+ scorecards: score_card
49
+ })
50
+ }
51
+
52
+ const Colors = useColors();
53
+ const current_hole = GolfHelpers.getCurrentHole(golf_leader, active_round);
54
+ const renderSides = (data:{ item:MarketSideOptionProps, index:number, market:MarketProps, trades:TradeProps[] }) => {
55
+ const ba_order = best_available_orders.find(o => o.market_id == data.market.market_id && o.side_type == 'athlete' && o.side_id == athlete.athlete_id && o.side == data.item.side && o.show);
56
+ const side_details = MarketComponentHelpers.getTournamentSideIds(data.market, data.item, athlete, undefined);
57
+ if(!side_details){ return <></> }
58
+ let trade = MarketButtonHelpers.getVisibleTrade('best_available', data.market, data.item, latest_trades, best_available_orders, side_details.side_id, side_details.reversed_side_id);
59
+ if(!trade){
60
+ trade = data.trades.find(t => t.side == data.item.side);
61
+ if(!trade){
62
+ trade = MarketButtonHelpers.getTradeFromMarket(data.market, tournament.tournament_id, 'team', data.item.side, data.item.id_source, side_details.side_id, side_details.reversed_side_id);
63
+ }
64
+ }
65
+ return (
66
+ <View key={`${tournament.tournament_id}_${athlete.athlete_id}_${data.item.side}`} style={{ margin:2, height:50, width:75 }}>
67
+ <MarketButton
68
+ side_option={data.item}
69
+ market={data.market}
70
+ trade={trade}
71
+ show_grades={false}
72
+ locked={false}
73
+ order={ba_order}
74
+ onLongPress={() => console.log('LONG PRESSED')}
75
+ onPress={(order) => {
76
+ const order_title = MarketComponentHelpers.getOrderTitleForTournament(order, data.market, tournament, athlete);
77
+ if(!order_title){ return alert('Unable to process order') }
78
+ onOrder({ ...order, title: order_title, league_id: tournament.league_id })
79
+ }}
80
+ />
81
+ </View>
82
+ )
83
+ }
84
+
85
+ const renderHoles = (data:{ item:GolfHoleProps, index:number }) => {
86
+ const market = markets.find(m => m.length_variable == data.item.number);
87
+ const stats = GolfHelpers.getHoleStats(data.item.number, golf_statistics, active_round);
88
+ const active = current_hole == data.item.number
89
+ const allowed = data.item.number > current_hole && market ? true : false
90
+ const completed = current_hole > data.item.number ? true : false
91
+ const score = scorecards.find(s => s.hole_number == data.item.number && s.round_number == active_round);
92
+ const trades = GolfHelpers.getParTradeFromHoleStats(tournament.tournament_id, athlete, market, stats);
93
+
94
+ return (
95
+ <View style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomWidth:1, borderColor:Colors.borders.light, backgroundColor:completed ? Colors.views.header : undefined }}>
96
+ {active ?
97
+ <Icons.GolferIcon color={Colors.text.h1} size={20} />
98
+ :<></>}
99
+ <View transparent style={{ flex:1, marginLeft:10 }}>
100
+ <Text theme='h2'>Hole {data.item.number} {'\u2022'} Par {data.item.par}</Text>
101
+ {stats ?
102
+ <Text theme='description' style={{ marginTop:4 }}>Avg Strokes: {stats.strokes_avg}</Text>
103
+ :<></>}
104
+ </View>
105
+ <View>
106
+ {allowed && market ?
107
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
108
+ <FlatList
109
+ data={market.side_options}
110
+ key={'side_options_bet_leader'}
111
+ horizontal
112
+ keyExtractor={(item) => `${market.market_id}_${item.side}`}
113
+ renderItem={({ item, index }) => renderSides({ item, index, market, trades })}
114
+
115
+ />
116
+ </View>
117
+ :
118
+ <View transparent style={{ flexDirection:'row', alignItems:'center' }}>
119
+ {score && completed?
120
+ <Text style={{ marginRight:10 }} theme='h2' color={score.strokes < data.item.par ? Colors.text.error : Colors.text.action}>{score.strokes}</Text>
121
+ :<></>}
122
+ <Button disabled float style={{ padding:10 }}>
123
+ <Icons.LockClosedIcon color={Colors.text.h1} size={16} />
124
+ </Button>
125
+ </View>
126
+ }
127
+ </View>
128
+ </View>
129
+ )
130
+ }
131
+
132
+ const renderSections = (data: { item:string, index:number }) => {
133
+ switch(data.item){
134
+ case 'market_details':
135
+ return (
136
+ <View type='header' style={{ borderTopWidth:1, borderColor:Colors.borders.light, padding:10 }}>
137
+ <Text theme='h2'>Par Betting</Text>
138
+ <Text theme='description' style={{ marginTop:4 }}>Bet on over / under par on each hole! Par results in a no-bet.</Text>
139
+ </View>
140
+ )
141
+ case 'holes':
142
+ return (
143
+ <FlatList
144
+ data={golf_course.holes.sort((a,b) => b.number - a.number)}
145
+ key={'hole_list_bet_leader'}
146
+ keyExtractor={(item) => `${item.number}_bet_leader`}
147
+ renderItem={renderHoles}
148
+ />
149
+ )
150
+ default: return <></>
151
+ }
152
+ }
153
+ return (
154
+ <View type='blur' style={{ position:'absolute', flex:1, bottom:0, left:0, right:0, top:0, justifyContent:'flex-end' }}>
155
+ <View float style={{ flex:1, maxHeight: 800, maxWidth:600 }}>
156
+ <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
157
+ <AthleteImage
158
+ athlete={athlete}
159
+ size={16}
160
+ />
161
+ <View transparent style={{ flex:1, marginLeft:10 }}>
162
+ <Text theme='h1'>{athlete.first_name} {athlete.last_name}</Text>
163
+ <Text theme='description' style={{ marginTop:4 }}>Current Hole {current_hole}</Text>
164
+ </View>
165
+ <Text theme='h1' color={golf_leader.score < 0 ?Colors.text.error : Colors.text.action}>{golf_leader.score_label}</Text>
166
+ <Button
167
+ title='X'
168
+ float
169
+ style={{ marginLeft:15, height:30, width:30, borderRadius:100, padding:0, justifyContent:'center', alignItems:'center' }}
170
+ onPress={() => onClose()}
171
+ />
172
+ </View>
173
+ <View transparent style={{ flex:1 }}>
174
+ {loading ?
175
+ <ActivityIndicator
176
+ style={{ padding:10, alignSelf:'center' }}
177
+ color={Colors.text.h1}
178
+ />
179
+ :<></>}
180
+ <FlatList
181
+ key='list_bet_leader_sections'
182
+ keyExtractor={(item) => item}
183
+ renderItem={renderSections}
184
+ data={leader_bet_sections}
185
+ />
186
+ </View>
187
+ </View>
188
+ </View>
189
+ )
190
+ }
191
+
192
+ export default LeaderBetSelector