be-components 1.6.0 → 1.6.1
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.
- package/lib/commonjs/CompetitionManager/components/AthleteSelector.js +50 -1
- package/lib/commonjs/CompetitionManager/components/AthleteSelector.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +90 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/MarketComponents/api/index.js +213 -0
- package/lib/commonjs/MarketComponents/api/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js +179 -0
- package/lib/commonjs/MarketComponents/components/AthleteMarket/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/EventMarket/index.js +205 -0
- package/lib/commonjs/MarketComponents/components/EventMarket/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/MarketButton/api/index.js +179 -0
- package/lib/commonjs/MarketComponents/components/MarketButton/api/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/MarketButton/index.js +58 -0
- package/lib/commonjs/MarketComponents/components/MarketButton/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/api/index.js +48 -0
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/api/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js +479 -0
- package/lib/commonjs/MarketComponents/components/TeamEventMarket/index.js.map +1 -0
- package/lib/commonjs/MarketComponents/index.js +12 -0
- package/lib/commonjs/MarketComponents/index.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/CompetitionManager/components/AthleteSelector.js +50 -1
- package/lib/module/CompetitionManager/components/AthleteSelector.js.map +1 -1
- package/lib/module/Components/Icons.js +90 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/MarketComponents/api/index.js +207 -0
- package/lib/module/MarketComponents/api/index.js.map +1 -0
- package/lib/module/MarketComponents/components/AthleteMarket/index.js +172 -0
- package/lib/module/MarketComponents/components/AthleteMarket/index.js.map +1 -0
- package/lib/module/MarketComponents/components/EventMarket/index.js +198 -0
- package/lib/module/MarketComponents/components/EventMarket/index.js.map +1 -0
- package/lib/module/MarketComponents/components/MarketButton/api/index.js +172 -0
- package/lib/module/MarketComponents/components/MarketButton/api/index.js.map +1 -0
- package/lib/module/MarketComponents/components/MarketButton/index.js +51 -0
- package/lib/module/MarketComponents/components/MarketButton/index.js.map +1 -0
- package/lib/module/MarketComponents/components/TeamEventMarket/api/index.js +42 -0
- package/lib/module/MarketComponents/components/TeamEventMarket/api/index.js.map +1 -0
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js +470 -0
- package/lib/module/MarketComponents/components/TeamEventMarket/index.js.map +1 -0
- package/lib/module/MarketComponents/index.js +5 -0
- package/lib/module/MarketComponents/index.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/AthleteSelector.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +3 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/api/index.d.ts +22 -0
- package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/AthleteMarket/index.d.ts +25 -0
- package/lib/typescript/src/MarketComponents/components/AthleteMarket/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/EventMarket/index.d.ts +21 -0
- package/lib/typescript/src/MarketComponents/components/EventMarket/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/MarketButton/api/index.d.ts +15 -0
- package/lib/typescript/src/MarketComponents/components/MarketButton/api/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/MarketButton/index.d.ts +12 -0
- package/lib/typescript/src/MarketComponents/components/MarketButton/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/api/index.d.ts +10 -0
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/api/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts +25 -0
- package/lib/typescript/src/MarketComponents/components/TeamEventMarket/index.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/index.d.ts +25 -0
- package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/CompetitionManager/components/AthleteSelector.tsx +36 -0
- package/src/Components/Icons.tsx +50 -0
- package/src/MarketComponents/api/index.ts +143 -0
- package/src/MarketComponents/components/AthleteMarket/index.tsx +109 -0
- package/src/MarketComponents/components/EventMarket/index.tsx +115 -0
- package/src/MarketComponents/components/MarketButton/api/index.ts +152 -0
- package/src/MarketComponents/components/MarketButton/index.tsx +37 -0
- package/src/MarketComponents/components/TeamEventMarket/api/index.ts +35 -0
- package/src/MarketComponents/components/TeamEventMarket/index.tsx +295 -0
- package/src/MarketComponents/index.tsx +5 -0
- package/src/index.tsx +2 -0
- package/src/types.d.ts +78 -2
- package/lib/commonjs/Markets/api/index.js +0 -28
- package/lib/commonjs/Markets/api/index.js.map +0 -1
- package/lib/commonjs/Markets/components/MarketButton.js +0 -25
- package/lib/commonjs/Markets/components/MarketButton.js.map +0 -1
- package/lib/module/Markets/api/index.js +0 -23
- package/lib/module/Markets/api/index.js.map +0 -1
- package/lib/module/Markets/components/MarketButton.js +0 -18
- package/lib/module/Markets/components/MarketButton.js.map +0 -1
- package/lib/typescript/src/Markets/api/index.d.ts +0 -7
- package/lib/typescript/src/Markets/api/index.d.ts.map +0 -1
- package/lib/typescript/src/Markets/components/MarketButton.d.ts +0 -11
- package/lib/typescript/src/Markets/components/MarketButton.d.ts.map +0 -1
- package/src/Markets/api/index.ts +0 -18
- package/src/Markets/components/MarketButton.tsx +0 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/MarketComponents/components/EventMarket/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAyB,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAS3J,KAAK,gBAAgB,GAAG;IACpB,KAAK,EAAC,UAAU,CAAC;IACjB,KAAK,CAAC,EAAC,MAAM,CAAC;IACd,MAAM,EAAC,WAAW,CAAC;IACnB,kBAAkB,CAAC,EAAC,OAAO,CAAC;IAC5B,aAAa,EAAC,UAAU,EAAE,CAAC;IAC3B,qBAAqB,EAAC,uBAAuB,EAAE,CAAC;IAChD,iBAAiB,EAAC,mBAAmB,EAAE,CAAC;IACxC,kBAAkB,EAAC,YAAY,GAAC,gBAAgB,CAAC;IACjD,OAAO,EAAC,CAAC,KAAK,EAAC,UAAU,KAAK,IAAI,CAAC;IACnC,MAAM,EAAC,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAC,MAAM,CAAC;QAAC,UAAU,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAClF,CAAA;AAED,QAAA,MAAM,WAAW,+IAA+I,gBAAgB,sBAwF/K,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BestAvailableOrderProps, MarketProps, MarketSideOptionProps, OrderProps, TradeProps } from "../../../../types";
|
|
2
|
+
export declare const MarketButtonHelpers: {
|
|
3
|
+
getButtonLabel: (market: MarketProps, side_option: MarketSideOptionProps, trade: TradeProps) => {
|
|
4
|
+
var_1: string;
|
|
5
|
+
odds: string;
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
getVisibleTrade: (default_price_view: 'best_available' | 'last_trade', market: MarketProps, side_option: MarketSideOptionProps, latest_trades: TradeProps[], best_available_orders: BestAvailableOrderProps[], side_id: string, reversed_side_id: string) => TradeProps | undefined;
|
|
9
|
+
reverseBAOrder: (order: BestAvailableOrderProps, market: MarketProps, side_id: string) => BestAvailableOrderProps | undefined;
|
|
10
|
+
getTradeFromMarket: (market: MarketProps, event_id: string, event_type: 'match' | 'tournament' | 'team', side: string, side_type: string, side_id: string, reversed_side_id: string) => TradeProps;
|
|
11
|
+
getTradeFromAvailableOrder: (ba: BestAvailableOrderProps, reversed_side_id: string) => TradeProps;
|
|
12
|
+
reverseTradeFromOrder: (order: BestAvailableOrderProps, market: MarketProps) => TradeProps;
|
|
13
|
+
getOrderFromTrade: (trade: TradeProps, unit_size?: number) => OrderProps;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/MarketComponents/components/MarketButton/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI7H,eAAO,MAAM,mBAAmB;6BACJ,WAAW,eAAc,qBAAqB,SAAQ,UAAU;;;;;0CAKnD,gBAAgB,GAAC,YAAY,UAAS,WAAW,eAAc,qBAAqB,iBAAgB,UAAU,EAAE,yBAAwB,uBAAuB,EAAE,WAAU,MAAM,oBAAmB,MAAM;4BAqBxN,uBAAuB,UAAS,WAAW,WAAU,MAAM,KAAE,uBAAuB,GAAG,SAAS;iCAgB3F,WAAW,YAAW,MAAM,cAAc,OAAO,GAAC,YAAY,GAAC,MAAM,QAAO,MAAM,aAAY,MAAM,WAAU,MAAM,oBAAmB,MAAM,KAAE,UAAU;qCAsBpJ,uBAAuB,oBAAmB,MAAM,KAAE,UAAU;mCAsB/D,uBAAuB,UAAS,WAAW,KAAE,UAAU;+BAoB3D,UAAU,cAAa,MAAM,KAAE,UAAU;CAsCtE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MarketProps, MarketSideOptionProps, OrderProps, TradeProps } from '../../../types';
|
|
3
|
+
type MarketButtonProps = {
|
|
4
|
+
market: MarketProps;
|
|
5
|
+
side_option: MarketSideOptionProps;
|
|
6
|
+
side_label?: string;
|
|
7
|
+
trade: TradeProps;
|
|
8
|
+
onPress: (order: OrderProps) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const MarketCard: ({ side_option, market, trade, side_label, onPress }: MarketButtonProps) => React.JSX.Element;
|
|
11
|
+
export default MarketCard;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/MarketComponents/components/MarketButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjG,KAAK,iBAAiB,GAAG;IACrB,MAAM,EAAC,WAAW,CAAC;IACnB,WAAW,EAAC,qBAAqB,CAAC;IAClC,UAAU,CAAC,EAAC,MAAM,CAAC;IACnB,KAAK,EAAC,UAAU,CAAC;IACjB,OAAO,EAAE,CAAC,KAAK,EAAC,UAAU,KAAK,IAAI,CAAA;CACtC,CAAA;AACD,QAAA,MAAM,UAAU,wDAAwD,iBAAiB,sBAoBxF,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AthleteProps, EventOrderStatProps, EventProps, MarketProps, TradeProps } from "../../../../types";
|
|
2
|
+
export { TeamEventMarketHelpers };
|
|
3
|
+
declare const TeamEventMarketHelpers: {
|
|
4
|
+
getPrimaryMarkets: (event: EventProps, markets: MarketProps[]) => MarketProps[];
|
|
5
|
+
getNonPrimaryMarkets: (event: EventProps, markets: MarketProps[]) => MarketProps[];
|
|
6
|
+
getTimeDetail: (event: EventProps) => string | undefined;
|
|
7
|
+
sortNonPrimaryMarkets: (markets: MarketProps[], event_order_stats: EventOrderStatProps[]) => EventOrderStatProps[];
|
|
8
|
+
sortAthleteMarkets: (market: MarketProps, event_order_stats: EventOrderStatProps[], latest_trades: TradeProps[], athletes: AthleteProps[]) => AthleteProps[];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/MarketComponents/components/TeamEventMarket/api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE/G,OAAQ,EAAE,sBAAsB,EAAE,CAAA;AAClC,QAAA,MAAM,sBAAsB;+BACE,UAAU,WAAU,WAAW,EAAE,KAAE,WAAW,EAAE;kCAK9C,UAAU,WAAU,WAAW,EAAE,KAAE,WAAW,EAAE;2BAKtD,UAAU;qCAIA,WAAW,EAAE,qBAAoB,mBAAmB,EAAE;iCAI1D,WAAW,qBAAoB,mBAAmB,EAAE,iBAAgB,UAAU,EAAE,YAAW,YAAY,EAAE,KAAE,YAAY,EAAE;CAWxJ,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BestAvailableOrderProps, CompetitionProps, EventOrderStatProps, EventProps, MarketProps, OrderProps, TradeProps } from '../../../types';
|
|
3
|
+
type TeamEventMarketProps = {
|
|
4
|
+
event: EventProps;
|
|
5
|
+
markets: MarketProps[];
|
|
6
|
+
competition?: CompetitionProps;
|
|
7
|
+
latest_trades: TradeProps[];
|
|
8
|
+
best_available_orders: BestAvailableOrderProps[];
|
|
9
|
+
event_order_stats: EventOrderStatProps[];
|
|
10
|
+
default_price_view: 'last_trade' | 'best_available';
|
|
11
|
+
onView: (data: {
|
|
12
|
+
event_id: string;
|
|
13
|
+
event_type: string;
|
|
14
|
+
market_id: string;
|
|
15
|
+
side_type?: string;
|
|
16
|
+
side_id?: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
onOrder: (order: OrderProps) => void;
|
|
19
|
+
onExpand?: (expanded: boolean) => void;
|
|
20
|
+
onCompetitionSelect: (competition_id: string) => void;
|
|
21
|
+
onViewAdditionalMarkets: (event_id: string, event_type: string) => void;
|
|
22
|
+
};
|
|
23
|
+
declare const TeamEventMarket: ({ event, competition, markets, latest_trades, best_available_orders, event_order_stats, default_price_view, onCompetitionSelect, onExpand, onOrder, onView, onViewAdditionalMarkets }: TeamEventMarketProps) => React.JSX.Element;
|
|
24
|
+
export default TeamEventMarket;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/MarketComponents/components/TeamEventMarket/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAgB,uBAAuB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAyB,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAa3L,KAAK,oBAAoB,GAAG;IACxB,KAAK,EAAC,UAAU,CAAC;IACjB,OAAO,EAAC,WAAW,EAAE,CAAC;IACtB,WAAW,CAAC,EAAC,gBAAgB,CAAC;IAC9B,aAAa,EAAC,UAAU,EAAE,CAAC;IAC3B,qBAAqB,EAAC,uBAAuB,EAAE,CAAC;IAChD,iBAAiB,EAAC,mBAAmB,EAAE,CAAC;IACxC,kBAAkB,EAAE,YAAY,GAAC,gBAAgB,CAAC;IAClD,MAAM,EAAC,CAAC,IAAI,EAAC;QAAE,QAAQ,EAAC,MAAM,CAAC;QAAC,UAAU,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAC;QAAC,SAAS,CAAC,EAAC,MAAM,CAAC;QAAC,OAAO,CAAC,EAAC,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnH,OAAO,EAAC,CAAC,KAAK,EAAC,UAAU,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAC,CAAC,QAAQ,EAAC,OAAO,KAAK,IAAI,CAAC;IACrC,mBAAmB,EAAC,CAAC,cAAc,EAAC,MAAM,KAAK,IAAI,CAAC;IACpD,uBAAuB,EAAE,CAAC,QAAQ,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,KAAK,IAAI,CAAA;CACxE,CAAA;AACD,QAAA,MAAM,eAAe,0LAA0L,oBAAoB,sBAuQlO,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const _default: {
|
|
3
|
+
TeamEventMarket: ({ event, competition, markets, latest_trades, best_available_orders, event_order_stats, default_price_view, onCompetitionSelect, onExpand, onOrder, onView, onViewAdditionalMarkets }: {
|
|
4
|
+
event: import("../types").EventProps;
|
|
5
|
+
markets: import("../types").MarketProps[];
|
|
6
|
+
competition?: import("../types").CompetitionProps | undefined;
|
|
7
|
+
latest_trades: import("../types").TradeProps[];
|
|
8
|
+
best_available_orders: import("../types").BestAvailableOrderProps[];
|
|
9
|
+
event_order_stats: import("../types").EventOrderStatProps[];
|
|
10
|
+
default_price_view: "best_available" | "last_trade";
|
|
11
|
+
onView: (data: {
|
|
12
|
+
event_id: string;
|
|
13
|
+
event_type: string;
|
|
14
|
+
market_id: string;
|
|
15
|
+
side_type?: string | undefined;
|
|
16
|
+
side_id?: string | undefined;
|
|
17
|
+
}) => void;
|
|
18
|
+
onOrder: (order: import("../types").OrderProps) => void;
|
|
19
|
+
onExpand?: ((expanded: boolean) => void) | undefined;
|
|
20
|
+
onCompetitionSelect: (competition_id: string) => void;
|
|
21
|
+
onViewAdditionalMarkets: (event_id: string, event_type: string) => void;
|
|
22
|
+
}) => import("react").JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/MarketComponents/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAEC"}
|
|
@@ -25,5 +25,6 @@ import EngageModule from "./Engage";
|
|
|
25
25
|
import SeasonManager from "./CompetitionSeasonManager";
|
|
26
26
|
import SeasonModule from "./CompetitionSeason";
|
|
27
27
|
import CreateSeasonForm from "./CompetitionSeasonManager/components/CreateSeasonForm";
|
|
28
|
-
|
|
28
|
+
import MarketComponents from './MarketComponents';
|
|
29
|
+
export { Authenticator, Observer, BEEventApi, BELinkApi, ProfileManager, CompetitionManager, Components, SocialComponents, APIOverrides, LinearGradient, usePlayerLocation, BettorSearch, Colors, MyWallet, Checkout, MarketComponents, PollCampaign, PollCampaignApi, PollApi, CompetitionModule, SeasonManager, CreateCompetitionForm, CreateSeasonForm, SeasonModule, AdminCompetitionList, AdServer, AdProvider, BracketRoom, SquaresModule, SocketManager, PromotedOrder, EngageModule };
|
|
29
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,iBAAiB,MAAM,eAAe,CAAC;AAC9C,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,qBAAqB,MAAM,uDAAuD,CAAC;AAC1F,OAAO,oBAAoB,MAAM,sDAAsD,CAAC;AACxF,OAAO,YAAY,MAAM,UAAU,CAAC;AACpC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,gBAAgB,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,iBAAiB,MAAM,eAAe,CAAC;AAC9C,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,qBAAqB,MAAM,uDAAuD,CAAC;AAC1F,OAAO,oBAAoB,MAAM,sDAAsD,CAAC;AACxF,OAAO,YAAY,MAAM,UAAU,CAAC;AACpC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,gBAAgB,MAAM,wDAAwD,CAAC;AACtF,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACb,CAAA"}
|
package/package.json
CHANGED
|
@@ -98,6 +98,42 @@ const AthleteSelector = ({ width, height, event, tournament, match, filtered_ath
|
|
|
98
98
|
</View>
|
|
99
99
|
<ScrollView style={{ flex:1 }}>
|
|
100
100
|
<View style={{ ...view_styles.section_body }}>
|
|
101
|
+
{event?.away && event?.home ?
|
|
102
|
+
<View style={{ ...view_styles.body_row, margin:10, backgroundColor:Colors.shades.white, borderRadius:22, borderWidth:4, borderColor:Colors.shades.shade100}}>
|
|
103
|
+
<Button
|
|
104
|
+
title={event.away.abbr}
|
|
105
|
+
title_color={event_side == 'away' ? Colors.shades.white : Colors.brand.midnight}
|
|
106
|
+
title_weight={event_side == 'away' ? 'bold' : 'regular'}
|
|
107
|
+
padding={15}
|
|
108
|
+
title_size={12}
|
|
109
|
+
style={{flex:1}}
|
|
110
|
+
borderRadiusOverride={{
|
|
111
|
+
borderTopLeftRadius: 22,
|
|
112
|
+
borderBottomLeftRadius:22,
|
|
113
|
+
borderTopRightRadius:0,
|
|
114
|
+
borderBottomRightRadius:0
|
|
115
|
+
}}
|
|
116
|
+
backgroundColor={event_side == 'away' ? Colors.brand.midnight : Colors.shades.white}
|
|
117
|
+
onPress={() => setSelectorData({ ...selector_data, event_side: 'away' })}
|
|
118
|
+
/>
|
|
119
|
+
<Button
|
|
120
|
+
title={event.home.abbr}
|
|
121
|
+
style={{flex:1}}
|
|
122
|
+
title_size={12}
|
|
123
|
+
title_color={event_side == 'home' ? Colors.shades.white : Colors.brand.midnight}
|
|
124
|
+
title_weight={event_side == 'home' ? 'bold' : 'regular'}
|
|
125
|
+
padding={15}
|
|
126
|
+
borderRadiusOverride={{
|
|
127
|
+
borderTopLeftRadius: 0,
|
|
128
|
+
borderBottomLeftRadius:0,
|
|
129
|
+
borderTopRightRadius:22,
|
|
130
|
+
borderBottomRightRadius:22
|
|
131
|
+
}}
|
|
132
|
+
backgroundColor={event_side == 'home' ? Colors.brand.midnight : Colors.shades.white}
|
|
133
|
+
onPress={() => setSelectorData({ ...selector_data, event_side: 'home' })}
|
|
134
|
+
/>
|
|
135
|
+
</View>
|
|
136
|
+
:<></>}
|
|
101
137
|
<View style={{ marginTop:0 }}>
|
|
102
138
|
<SearchBox
|
|
103
139
|
onChange={(text) => setSearchValue(text)}
|
package/src/Components/Icons.tsx
CHANGED
|
@@ -38,6 +38,22 @@ const PodiumIcon = ({ color, size, secondary_color }:IconProps) => {
|
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
const FlameIcon = ({ size, color }:IconProps) => {
|
|
42
|
+
const ratio = 0.857
|
|
43
|
+
const height = size??30
|
|
44
|
+
const width = height * ratio
|
|
45
|
+
return (
|
|
46
|
+
<svg width={`${width}px`} height={`${height}px`} viewBox="0 0 18 21" version="1.1" xmlns="http://www.w3.org/2000/svg" >
|
|
47
|
+
<title>flame-svgrepo-com</title>
|
|
48
|
+
<g id="ss" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
49
|
+
<g id="flame-svgrepo-com" transform="translate(1.000000, 1.000000)" stroke={color??Colors.brand.midnight} stroke-width="2">
|
|
50
|
+
<path d="M15.060385,11.624539 C15.060385,15.6291895 12.5960354,17.3865482 10.6917438,17.9790802 C10.2856782,18.1054933 10.0187329,17.6320325 10.2616757,17.283008 C11.0903734,16.092014 12.048308,14.2750727 12.048308,12.5658131 C12.048308,10.7297639 10.5007593,8.56210386 9.29235166,7.22511819 C9.01608773,6.9194865 8.53424953,7.12176629 8.51918915,7.53347957 C8.4692075,8.89757394 8.25393812,10.7226102 7.32574777,12.1529703 C7.17636757,12.3832059 6.85925234,12.4022197 6.68897586,12.1869503 C6.39896932,11.8202299 6.10896279,11.3671006 5.81895625,11.009134 C5.66270475,10.8163611 5.38036019,10.8137255 5.20017209,10.9842844 C4.49764278,11.6494828 3.51408669,12.6868609 3.51408669,13.9777242 C3.51408669,14.9089266 3.95785976,16.0679174 4.41530013,16.9654222 C4.62303931,17.3729938 4.23765348,17.8510669 3.84173478,17.6218667 C2.11370621,16.6215748 0,14.5489834 0,11.624539 C0,8.66291432 4.05716417,4.56012659 5.60627537,0.68405413 C5.85067718,0.0724142449 6.60407294,-0.214984964 7.12798609,0.184152889 C10.3012092,2.60140116 15.060385,7.27406444 15.060385,11.624539 Z" id="Path"></path>
|
|
51
|
+
</g>
|
|
52
|
+
</g>
|
|
53
|
+
</svg>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
41
57
|
const UnbidSquare = ({ color, secondary_color }:IconProps) => {
|
|
42
58
|
return (
|
|
43
59
|
<svg width="45" height="45" viewBox="0 0 50 51" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1129,10 +1145,42 @@ const SelectorIcon = ({ color, size }:IconProps) => {
|
|
|
1129
1145
|
)
|
|
1130
1146
|
}
|
|
1131
1147
|
|
|
1148
|
+
const LiquidityIcon = ({ color, size }:IconProps) => {
|
|
1149
|
+
const ratio = 0.65
|
|
1150
|
+
let width = size ?? 20
|
|
1151
|
+
let height = width * ratio
|
|
1152
|
+
|
|
1153
|
+
return (
|
|
1154
|
+
<svg width={`${width}px`} height={`${height}px`} viewBox="0 0 18 17" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
1155
|
+
<title>exchange-dollar-svgrepo-com</title>
|
|
1156
|
+
<g id="ss" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
1157
|
+
<g id="exchange-dollar-svgrepo-com" transform="translate(0.000000, 0.000000)" fill={color??Colors.brand.midnight} fill-rule="nonzero">
|
|
1158
|
+
<path d="M15.773049,12.4927553 C14.0612582,15.1274121 10.9789335,16.532799 7.86733523,16.0973679 C4.75573693,15.6619368 2.17759358,13.4644349 1.25477308,10.4610957 C1.19184557,10.2633235 1.15588699,10.0565617 1.11093877,9.84979984 C0.809350943,9.92615094 0.489724403,9.84114389 0.26591218,9.62505873 C0.0957268356,9.45626323 0,9.22649163 0,8.98679396 C0,8.74709629 0.0957268356,8.5173247 0.26591218,8.3485292 L1.16487664,7.44956474 C1.33367214,7.2793794 1.56344373,7.18365256 1.8031414,7.18365256 C2.04283907,7.18365256 2.27261066,7.2793794 2.44140616,7.44956474 L3.34037062,8.3485292 C3.51055596,8.5173247 3.6062828,8.74709629 3.6062828,8.98679396 C3.6062828,9.22649163 3.51055596,9.45626323 3.34037062,9.62505873 C3.22860907,9.72404371 3.09673444,9.79764815 2.9538159,9.8408102 C2.94985586,9.87064484 2.94985586,9.90087199 2.9538159,9.93070664 C3.76632497,12.5835598 6.2203864,14.391239 8.99485705,14.3805807 C11.1210172,14.3788188 13.1025131,13.303536 14.2627888,11.5218737 C14.4275544,11.2330323 14.738309,11.0587382 15.0706897,11.0687433 C15.4030705,11.0787483 15.702779,11.2714181 15.8498731,11.5696469 C15.9969672,11.8678756 15.9674172,12.2229442 15.773049,12.4927553 L15.773049,12.4927553 Z M17.7238019,6.55060029 C17.4962805,6.33458773 17.1726027,6.25281649 16.8697857,6.33484882 C16.8248375,6.12808699 16.7978685,5.91233552 16.734941,5.71456334 C15.8121205,2.71122411 13.2339772,0.513722236 10.1223789,0.0782911427 C7.01078057,-0.357139951 3.92845589,1.04824689 2.21666505,3.68290367 C1.9798217,4.09810056 2.10931386,4.62603855 2.51139649,4.88452024 C2.91347912,5.14300193 3.44752956,5.04162704 3.72692534,4.65378528 C4.88720097,2.87212299 6.8686969,1.79684022 8.99485705,1.79507831 C11.7717,1.80230249 14.2155523,3.628799 15.0089293,6.28990059 C15.0128893,6.31973524 15.0128893,6.34996239 15.0089293,6.37979704 C14.8651823,6.42098669 14.7328922,6.49482304 14.6223745,6.59554851 C14.4521892,6.76434401 14.3564624,6.99411561 14.3564624,7.23381327 C14.3564624,7.47351094 14.4521892,7.70328254 14.6223745,7.87207804 L15.521339,8.77104249 C15.6901345,8.94122784 15.9199061,9.03695467 16.1596038,9.03695467 C16.3993014,9.03695467 16.629073,8.94122784 16.7978685,8.77104249 L17.696833,7.87207804 C17.8848351,7.70568518 17.9946899,7.46825545 17.9998126,7.21724723 C18.0049352,6.966239 17.9048587,6.72452496 17.7238019,6.55060029 Z" id="secondary"></path>
|
|
1159
|
+
<path d="M9.44433928,7.18886505 L8.54537482,7.18886505 C8.29713264,7.18886505 8.09589259,6.987625 8.09589259,6.73938282 C8.09589259,6.49114064 8.29713264,6.28990059 8.54537482,6.28990059 L10.792786,6.28990059 C11.2892703,6.28990059 11.6917504,5.8874205 11.6917504,5.39093614 C11.6917504,4.89445178 11.2892703,4.49197168 10.792786,4.49197168 L9.8938215,4.49197168 C9.8938215,3.99548732 9.49134141,3.59300723 8.99485705,3.59300723 C8.49837269,3.59300723 8.09589259,3.99548732 8.09589259,4.49197168 L8.09589259,4.5369199 C6.96436928,4.76668252 6.19104593,5.81647644 6.30708325,6.96524587 C6.42312057,8.1140153 7.39076037,8.98795435 8.54537482,8.98679396 L9.44433928,8.98679396 C9.69258146,8.98679396 9.8938215,9.18803401 9.8938215,9.43627619 C9.8938215,9.68451837 9.69258146,9.88575842 9.44433928,9.88575842 L7.19692814,9.88575842 C6.70044378,9.88575842 6.29796368,10.2882385 6.29796368,10.7847229 C6.29796368,11.2812072 6.70044378,11.6836873 7.19692814,11.6836873 L8.09589259,11.6836873 C8.09589259,12.1801717 8.49837269,12.5826518 8.99485705,12.5826518 C9.49134141,12.5826518 9.8938215,12.1801717 9.8938215,11.6836873 C11.1350324,11.5595662 12.0406126,10.452746 11.9164915,9.21153508 C11.7923704,7.9703242 10.6855502,7.06474399 9.44433928,7.18886505 Z" id="primary"></path>
|
|
1160
|
+
</g>
|
|
1161
|
+
</g>
|
|
1162
|
+
</svg>
|
|
1163
|
+
)
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
const PickEmIcon = ({ color, size }:IconProps) => {
|
|
1167
|
+
return (
|
|
1168
|
+
<svg width={`${size ?? 18}`} height={`${size ?? 18}`} viewBox="0 0 25 25" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
1169
|
+
<title>select-category-svgrepo-com</title>
|
|
1170
|
+
<g id="ss" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
1171
|
+
<g id="select-category-svgrepo-com" transform="translate(0.666667, 0.666667)" fill={color??Colors.brand.midnight} fill-rule="nonzero">
|
|
1172
|
+
<path d="M10.8,20.4 L10.8,16.8 C10.8,14.8117749 9.1882251,13.2 7.2,13.2 L3.6,13.2 C1.6117749,13.2 0,14.8117749 0,16.8 L0,20.4 C0,22.3882251 1.6117749,24 3.6,24 L7.2,24 C9.1882251,24 10.8,22.3882251 10.8,20.4 Z M1.2,20.4 L1.2,16.8 C1.2,15.4745166 2.2745166,14.4 3.6,14.4 L7.2,14.4 C8.5254834,14.4 9.6,15.4745166 9.6,16.8 L9.6,20.4 C9.6,21.7254834 8.5254834,22.8 7.2,22.8 L3.6,22.8 C2.2745166,22.8 1.2,21.7254834 1.2,20.4 Z M24,16.8 C24,14.8117749 22.3882251,13.2 20.4,13.2 L16.8,13.2 C14.8117749,13.2 13.2,14.8117749 13.2,16.8 L13.2,20.4 C13.2,22.3882251 14.8117749,24 16.8,24 L20.4,24 C22.3882251,24 24,22.3882251 24,20.4 L24,16.8 Z M22.8,20.4 C22.8,21.7254834 21.7254834,22.8 20.4,22.8 L16.8,22.8 C15.4745166,22.8 14.4,21.7254834 14.4,20.4 L14.4,16.8 C14.4,15.4745166 15.4745166,14.4 16.8,14.4 L20.4,14.4 C21.7254834,14.4 22.8,15.4745166 22.8,16.8 L22.8,20.4 Z M24,3.6 C24,1.6117749 22.3882251,0 20.4,0 L16.8,0 C14.8117749,0 13.2,1.6117749 13.2,3.6 L13.2,7.2 C13.2,9.1882251 14.8117749,10.8 16.8,10.8 L20.4,10.8 C22.3882251,10.8 24,9.1882251 24,7.2 L24,3.6 Z M22.8,7.2 C22.8,8.5254834 21.7254834,9.6 20.4,9.6 L16.8,9.6 C15.4745166,9.6 14.4,8.5254834 14.4,7.2 L14.4,3.6 C14.4,2.2745166 15.4745166,1.2 16.8,1.2 L20.4,1.2 C21.7254834,1.2 22.8,2.2745166 22.8,3.6 L22.8,7.2 Z M0,3.6 L0,7.2 C0,9.1882251 1.6117749,10.8 3.6,10.8 L7.2,10.8 C9.1882251,10.8 10.8,9.1882251 10.8,7.2 L10.8,3.6 C10.8,1.6117749 9.1882251,0 7.2,0 L3.6,0 C1.6117749,0 0,1.6117749 0,3.6 Z M1.2,3.6 C1.2,2.2745166 2.2745166,1.2 3.6,1.2 L7.2,1.2 C8.5254834,1.2 9.6,2.2745166 9.6,3.6 L9.6,7.2 C9.6,8.5254834 8.5254834,9.6 7.2,9.6 L3.6,9.6 C2.2745166,9.6 1.2,8.5254834 1.2,7.2 L1.2,3.6 Z M9,17.0856 L4.8684,21.2016 L2.682,19.0152 L3.5676,18.1296 L4.8684,19.4352 L8.1144,16.2 L9,17.0856 Z M21.744,3.8016 L17.6124,7.9176 L15.426,5.7312 L16.3116,4.8456 L17.6124,6.1512 L20.8584,2.916 L21.744,3.8016 Z" id="Shape"></path>
|
|
1173
|
+
</g>
|
|
1174
|
+
</g>
|
|
1175
|
+
</svg>
|
|
1176
|
+
)
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1132
1179
|
|
|
1133
1180
|
|
|
1134
1181
|
export default {
|
|
1135
1182
|
SearchIcon,
|
|
1183
|
+
LiquidityIcon,
|
|
1136
1184
|
EyeOnIcon,
|
|
1137
1185
|
AlertIcon,
|
|
1138
1186
|
PieIcon,
|
|
@@ -1140,6 +1188,7 @@ export default {
|
|
|
1140
1188
|
SquaresIcon,
|
|
1141
1189
|
EditIcon,
|
|
1142
1190
|
PreferencesIcon,
|
|
1191
|
+
PickEmIcon,
|
|
1143
1192
|
CheckCirlceIcon,
|
|
1144
1193
|
ShareIcon,
|
|
1145
1194
|
TrophyIcon,
|
|
@@ -1185,6 +1234,7 @@ export default {
|
|
|
1185
1234
|
DiscoverCardIcon,
|
|
1186
1235
|
AmexCardIcon,
|
|
1187
1236
|
TransactionIcon,
|
|
1237
|
+
FlameIcon,
|
|
1188
1238
|
TransactionSuccessIcon,
|
|
1189
1239
|
TransactionErrorIcon,
|
|
1190
1240
|
VisaCardIcon,
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { APIOverrides } from "../../ApiOverrides"
|
|
3
|
+
import type { AthleteProps, EventOrderStatProps, EventProps, MarketProps, MarketSideOptionProps, MatchProps, OrderProps, TeamProps, TournamentProps } from "../../types"
|
|
4
|
+
|
|
5
|
+
let EVENT_SVC_API = ''
|
|
6
|
+
|
|
7
|
+
export { MarketComponentApi, MarketComponentHelpers }
|
|
8
|
+
|
|
9
|
+
const MarketComponentApi = {
|
|
10
|
+
setEnvironment: () => {
|
|
11
|
+
const endpoints = APIOverrides.getEndpoints();
|
|
12
|
+
EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
|
|
13
|
+
//MK_SVC_API = endpoints['MK_SVC_API'] as string;
|
|
14
|
+
//AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
|
|
15
|
+
},
|
|
16
|
+
getAthletesByTeamId: async(team_id:string):Promise<AthleteProps[]> => {
|
|
17
|
+
try {
|
|
18
|
+
const resp = await axios.get(`${EVENT_SVC_API}/v1/athletes/team/${team_id}`)
|
|
19
|
+
return resp.data.athletes
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.log(e)
|
|
22
|
+
return []
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const MarketComponentHelpers = {
|
|
29
|
+
getLiqudity: (event_order_stats:EventOrderStatProps[]):{ liquidity: number, open_order_count:number } => {
|
|
30
|
+
let liquidity = event_order_stats.reduce((a,b) => a + b.open_order_amount, 0);
|
|
31
|
+
let open_order_count = event_order_stats.reduce((a,b) => a + parseInt(b.open_order_count as string), 0);
|
|
32
|
+
return { liquidity, open_order_count }
|
|
33
|
+
},
|
|
34
|
+
getVar1Label: (market:MarketProps, var_1:number, side?:string) => {
|
|
35
|
+
if(side == 'over'){ return `O ${var_1}` }
|
|
36
|
+
if(side == 'under'){ return `U ${var_1}` }
|
|
37
|
+
if(market.type != 'Spread'){ return `${var_1}` }
|
|
38
|
+
if(var_1 < 0){ return `${var_1}` }
|
|
39
|
+
return `+${var_1}`
|
|
40
|
+
},
|
|
41
|
+
getOddsLabel: (odds:number, decimals?:number) => {
|
|
42
|
+
let new_odds = odds.toFixed()
|
|
43
|
+
if(decimals){ new_odds = odds.toFixed(decimals) }
|
|
44
|
+
if(odds < 0){ return `${new_odds}` }
|
|
45
|
+
return `+${new_odds}`
|
|
46
|
+
},
|
|
47
|
+
getTeamEventSideIds:(event:EventProps, market:MarketProps, side_option:MarketSideOptionProps, athlete?:AthleteProps, team?:TeamProps) => {
|
|
48
|
+
const o_side = market.side_options.find(so => so.side != side_option.side);
|
|
49
|
+
if(!o_side){ return undefined }
|
|
50
|
+
switch(side_option.id_source){
|
|
51
|
+
case 'side':
|
|
52
|
+
return { side_id: side_option.side, reversed_side_id: o_side.side }
|
|
53
|
+
case 'athlete':
|
|
54
|
+
if(!athlete){ return undefined }
|
|
55
|
+
return { side_id: athlete.athlete_id, reversed_side_id: athlete.athlete_id }
|
|
56
|
+
case 'team':
|
|
57
|
+
if(market.level == 'event'){
|
|
58
|
+
let side_id = event[side_option.side as keyof EventProps]?.team_id
|
|
59
|
+
let reversed_side_id = event[o_side.side as keyof EventProps]?.team_id
|
|
60
|
+
if(!side_id || !reversed_side_id){ return undefined }
|
|
61
|
+
return { side_id, reversed_side_id }
|
|
62
|
+
}
|
|
63
|
+
if(market.level == 'team'){
|
|
64
|
+
if(!team){ return undefined }
|
|
65
|
+
return { side_id: team.team_id, reversed_side_id: team.team_id }
|
|
66
|
+
}
|
|
67
|
+
return undefined
|
|
68
|
+
default: return undefined
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
getOrderTitleForTeamEvent : (order:OrderProps, market:MarketProps, event:EventProps, athlete?:AthleteProps, exotic?:any):string | undefined => {
|
|
73
|
+
let market_side = market.side_options.find(o => o.side == order.side)
|
|
74
|
+
if(!market_side){ return undefined }
|
|
75
|
+
var re = /({.*?})/;
|
|
76
|
+
let parsed_text = market_side.parseable_title.split(re)
|
|
77
|
+
let new_title = '';
|
|
78
|
+
parsed_text.map(t => {
|
|
79
|
+
if(t === ''){ return }
|
|
80
|
+
if(t[0] !== '{'){ return new_title += t }
|
|
81
|
+
let variable = t.slice(1)
|
|
82
|
+
variable = variable.slice(0, variable.length -1)
|
|
83
|
+
switch(variable){
|
|
84
|
+
case 'team':
|
|
85
|
+
let team = event[order.side as keyof EventProps]
|
|
86
|
+
return new_title += team.market_name
|
|
87
|
+
case 'var_1': return new_title += MarketComponentHelpers.getVar1Label(market, order.var_1)
|
|
88
|
+
case 'athlete': return new_title += athlete?.abbr_name
|
|
89
|
+
case 'stat': return new_title += market.stat_label ?? market.stat
|
|
90
|
+
case 'exotic': return new_title += exotic?.name
|
|
91
|
+
default: return
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
return new_title
|
|
96
|
+
},
|
|
97
|
+
getOrderTitleForTournament : (order:OrderProps, market:MarketProps, tournament:TournamentProps, athlete?:AthleteProps, team?:TeamProps):string | undefined => {
|
|
98
|
+
if(!tournament){ return undefined }
|
|
99
|
+
let market_side = market.side_options.find(o => o.side == order.side)
|
|
100
|
+
if(!market_side){ return order.side }
|
|
101
|
+
var re = /({.*?})/;
|
|
102
|
+
let parsed_text = market_side.parseable_title.split(re)
|
|
103
|
+
let new_title = '';
|
|
104
|
+
parsed_text.map(t => {
|
|
105
|
+
if(t === ''){ return }
|
|
106
|
+
if(t[0] !== '{'){ return new_title += t }
|
|
107
|
+
let variable = t.slice(1)
|
|
108
|
+
variable = variable.slice(0, variable.length -1)
|
|
109
|
+
switch(variable){
|
|
110
|
+
case 'team': return new_title += `${team?.market_name} ${team?.name}`
|
|
111
|
+
case 'var_1': return new_title += MarketComponentHelpers.getVar1Label(market, order.var_1)
|
|
112
|
+
case 'athlete': return new_title += athlete?.abbr_name
|
|
113
|
+
case 'stat': return new_title += market.stat
|
|
114
|
+
default: return
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
return new_title
|
|
119
|
+
},
|
|
120
|
+
getOrderTitleForMatch : (order:OrderProps, market:MarketProps, match:MatchProps, athlete?:AthleteProps, team?:TeamProps):string | undefined => {
|
|
121
|
+
if(!match){ return undefined }
|
|
122
|
+
let market_side = market.side_options.find(o => o.side == order.side)
|
|
123
|
+
if(!market_side){ return order.side }
|
|
124
|
+
var re = /({.*?})/;
|
|
125
|
+
let parsed_text = market_side.parseable_title.split(re)
|
|
126
|
+
let new_title = '';
|
|
127
|
+
parsed_text.map(t => {
|
|
128
|
+
if(t === ''){ return }
|
|
129
|
+
if(t[0] !== '{'){ return new_title += t }
|
|
130
|
+
let variable = t.slice(1)
|
|
131
|
+
variable = variable.slice(0, variable.length -1)
|
|
132
|
+
switch(variable){
|
|
133
|
+
case 'team': return new_title += `${team?.market_name} ${team?.name}`
|
|
134
|
+
case 'var_1': return new_title += MarketComponentHelpers.getVar1Label(market, order.var_1)
|
|
135
|
+
case 'athlete': return new_title += athlete?.abbr_name
|
|
136
|
+
case 'stat': return new_title += market.stat
|
|
137
|
+
default: return
|
|
138
|
+
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
return new_title
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import type { AthleteProps, BestAvailableOrderProps, EventOrderStatProps, EventProps, MarketProps, MarketSideOptionProps, OrderProps, TradeProps } from "../../../types"
|
|
4
|
+
import { view_styles } from '../../../constants/styles';
|
|
5
|
+
import MarketButton from '../../components/MarketButton';
|
|
6
|
+
import { Icons, LinearDiagnal, Text } from '../../../Components';
|
|
7
|
+
import Colors from '../../../constants/colors';
|
|
8
|
+
import { MarketButtonHelpers } from '../MarketButton/api';
|
|
9
|
+
import { MarketComponentHelpers } from '../../api';
|
|
10
|
+
import { AthleteImage } from '../../../Components/Jerseys';
|
|
11
|
+
|
|
12
|
+
type AthleteMarketProps = {
|
|
13
|
+
event:EventProps,
|
|
14
|
+
event_type:'team'|'tournament'|'match',
|
|
15
|
+
athlete:AthleteProps,
|
|
16
|
+
hide_stat_banner?:boolean,
|
|
17
|
+
width?:number,
|
|
18
|
+
market:MarketProps,
|
|
19
|
+
latest_trades:TradeProps[],
|
|
20
|
+
best_available_orders:BestAvailableOrderProps[],
|
|
21
|
+
event_order_stats:EventOrderStatProps[],
|
|
22
|
+
default_price_view:'last_trade'|'best_available',
|
|
23
|
+
onOrder:(order:OrderProps) => void,
|
|
24
|
+
onView:(data:{event_id:string, event_type:string, market_id:string, side_type:'athlete', side_id:string}) => void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const AthleteMarket = ({ event, hide_stat_banner, width, athlete, market, event_order_stats, default_price_view, latest_trades, best_available_orders, onOrder, onView }:AthleteMarketProps) => {
|
|
28
|
+
const { liquidity, open_order_count } = MarketComponentHelpers.getLiqudity(event_order_stats);
|
|
29
|
+
|
|
30
|
+
const renderSides = (data:{ item:MarketSideOptionProps, index:number, market:MarketProps }) => {
|
|
31
|
+
const side_details = MarketComponentHelpers.getTeamEventSideIds(event, market, data.item, athlete, undefined);
|
|
32
|
+
if(!side_details){ return <></> }
|
|
33
|
+
let trade = MarketButtonHelpers.getVisibleTrade(default_price_view, data.market, data.item, latest_trades, best_available_orders, side_details.side_id, side_details.reversed_side_id);
|
|
34
|
+
if(!trade){
|
|
35
|
+
trade = MarketButtonHelpers.getTradeFromMarket(market, event.event_id, 'team', data.item.side, data.item.id_source, side_details.side_id, side_details.reversed_side_id);
|
|
36
|
+
}
|
|
37
|
+
return (
|
|
38
|
+
<View style={{ margin:2, height:50, width:75 }}>
|
|
39
|
+
<MarketButton
|
|
40
|
+
side_option={data.item}
|
|
41
|
+
market={data.market}
|
|
42
|
+
trade={trade}
|
|
43
|
+
onPress={(order) => {
|
|
44
|
+
const order_title = MarketComponentHelpers.getOrderTitleForTeamEvent(order, market, event, athlete);
|
|
45
|
+
if(!order_title){ return alert('Unable to process order') }
|
|
46
|
+
onOrder({ ...order, title: order_title })
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
</View>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<View style={{ ...view_styles.section, flex:1, borderWidth:1, borderColor:Colors.shades.shade600, width }}>
|
|
55
|
+
{!hide_stat_banner ?
|
|
56
|
+
<LinearDiagnal
|
|
57
|
+
label={market.stat_label ?? market.type}
|
|
58
|
+
label_size={14}
|
|
59
|
+
style={{ borderTopLeftRadius:8, padding:5 }}
|
|
60
|
+
left_color={Colors.incentive.gold}
|
|
61
|
+
right_color={'#ebd197'}
|
|
62
|
+
/>
|
|
63
|
+
:<></>}
|
|
64
|
+
|
|
65
|
+
<View style={{ ...view_styles.section_body, flex:1, padding:0, justifyContent:'center', alignItems:'center' }}>
|
|
66
|
+
<AthleteImage
|
|
67
|
+
athlete={athlete}
|
|
68
|
+
size={50}
|
|
69
|
+
number_size={12}
|
|
70
|
+
/>
|
|
71
|
+
<View style={{ padding:10, paddingBottom:0 }}>
|
|
72
|
+
<Text weight='bold' size={14} color={Colors.brand.midnight} textAlign='center'>{athlete.first_name} {athlete.last_name}</Text>
|
|
73
|
+
<Text style={{ marginTop:3 }} color={Colors.brand.midnight} weight='regular' textAlign='center' size={12}>{athlete.team?`${athlete.team.abbr}`:''} ({athlete.position})</Text>
|
|
74
|
+
</View>
|
|
75
|
+
</View>
|
|
76
|
+
<View nativeID='market_sides' style={{ flexDirection:'row', justifyContent:'center', alignItems:'center', padding:10 }}>
|
|
77
|
+
{market.side_options.sort((a,b) => {
|
|
78
|
+
let a_t = a.side == market.trade_side ? 1 : 0
|
|
79
|
+
let b_t = b.side == market.trade_side ? 1 : 0
|
|
80
|
+
return a_t - b_t
|
|
81
|
+
}).map((so, index) => {
|
|
82
|
+
return renderSides({ item:so, index, market })
|
|
83
|
+
})}
|
|
84
|
+
|
|
85
|
+
</View>
|
|
86
|
+
<View style={{ backgroundColor:Colors.shades.shade100, padding:10, flexDirection:'row', alignItems:'center', borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
|
|
87
|
+
<TouchableOpacity style={{ flex:1, flexDirection:'row' }} onPress={() => {
|
|
88
|
+
onView({
|
|
89
|
+
event_id: event.event_id,
|
|
90
|
+
event_type: 'team',
|
|
91
|
+
market_id: market.market_id,
|
|
92
|
+
side_type: 'athlete',
|
|
93
|
+
side_id: athlete.athlete_id
|
|
94
|
+
});
|
|
95
|
+
}}>
|
|
96
|
+
<View style={{ backgroundColor:Colors.shades.white, height:30, width:30, borderRadius:100, justifyContent:'center', alignItems:'center', ...view_styles.float }}>
|
|
97
|
+
<Icons.LiquidityIcon color={Colors.brand.midnight} size={30}/>
|
|
98
|
+
</View>
|
|
99
|
+
<View style={{ marginLeft:10 }}>
|
|
100
|
+
<Text theme='body_2'>Liquidity</Text>
|
|
101
|
+
<Text size={12} color={Colors.brand.electric} weight='semibold'>${liquidity.toFixed()} {open_order_count} Orders</Text>
|
|
102
|
+
</View>
|
|
103
|
+
</TouchableOpacity>
|
|
104
|
+
</View>
|
|
105
|
+
</View>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export default AthleteMarket
|