be-components 7.3.8 → 7.3.9
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/FlashMarket/FlashHolder.js +3 -1
- package/lib/commonjs/FlashMarket/FlashHolder.js.map +1 -1
- package/lib/commonjs/FlashMarket/index.js +30 -5
- package/lib/commonjs/FlashMarket/index.js.map +1 -1
- package/lib/commonjs/PartnerPortal/components/EmbedManager.js +42 -0
- package/lib/commonjs/PartnerPortal/components/EmbedManager.js.map +1 -1
- package/lib/module/FlashMarket/FlashHolder.js +3 -1
- package/lib/module/FlashMarket/FlashHolder.js.map +1 -1
- package/lib/module/FlashMarket/index.js +30 -5
- package/lib/module/FlashMarket/index.js.map +1 -1
- package/lib/module/PartnerPortal/components/EmbedManager.js +43 -1
- package/lib/module/PartnerPortal/components/EmbedManager.js.map +1 -1
- package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts +2 -1
- package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/PartnerPortal/components/EmbedManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts +2 -1
- package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts.map +1 -1
- package/lib/typescript/lib/module/FlashMarket/index.d.ts +2 -1
- package/lib/typescript/lib/module/FlashMarket/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/PartnerPortal/components/EmbedManager.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/FlashHolder.d.ts +2 -1
- package/lib/typescript/src/FlashMarket/FlashHolder.d.ts.map +1 -1
- package/lib/typescript/src/FlashMarket/index.d.ts +2 -1
- package/lib/typescript/src/FlashMarket/index.d.ts.map +1 -1
- package/lib/typescript/src/PartnerPortal/components/EmbedManager.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/FlashMarket/FlashHolder.tsx +6 -2
- package/src/FlashMarket/index.tsx +16 -3
- package/src/PartnerPortal/components/EmbedManager.tsx +20 -1
|
@@ -9,6 +9,7 @@ type FlashHolderProps = {
|
|
|
9
9
|
restricted_flash_ids?: string[];
|
|
10
10
|
compact?: boolean;
|
|
11
11
|
player?: MyPlayerProps;
|
|
12
|
+
wrap_options?: boolean;
|
|
12
13
|
company_id?: string;
|
|
13
14
|
init_expanded?: boolean;
|
|
14
15
|
contest_type?: string;
|
|
@@ -36,6 +37,6 @@ type FlashHolderProps = {
|
|
|
36
37
|
}) => void;
|
|
37
38
|
onRequestAuthenticate: () => void;
|
|
38
39
|
};
|
|
39
|
-
declare const FlashHolder: ({ float, poll_campaign_id, restricted_flash_ids, company_id, compact, style, default_poll_id, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation, onManageFlash }: FlashHolderProps) => React.JSX.Element;
|
|
40
|
+
declare const FlashHolder: ({ float, poll_campaign_id, restricted_flash_ids, wrap_options, company_id, compact, style, default_poll_id, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation, onManageFlash }: FlashHolderProps) => React.JSX.Element;
|
|
40
41
|
export default FlashHolder;
|
|
41
42
|
//# sourceMappingURL=FlashHolder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlashHolder.d.ts","sourceRoot":"","sources":["../../../../src/FlashMarket/FlashHolder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAuB,aAAa,EAAE,aAAa,EAAsC,SAAS,EA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;IACxB,OAAO,CAAC,EAAC,MAAM,CAAC;IAChB,eAAe,CAAC,EAAC,MAAM,CAAC;IACxB,OAAO,CAAC,EAAC,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAC,SAAS,KAAK,IAAI,CAAC;IACzC,mBAAmB,CAAC,EAAC,CAAC,OAAO,EAAC,MAAM,KAAK,IAAI,CAAC;IAC9C,iBAAiB,EAAC,MAAM,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAC;QAAE,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACzF,qBAAqB,EAAE,MAAM,IAAI,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,WAAW,GAAI,wYAAyY,gBAAgB,sBAuU7a,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -10,6 +10,7 @@ type FlashMarketProps = {
|
|
|
10
10
|
flash_market_fees: FlashMarketFeeProps[];
|
|
11
11
|
hide_image?: boolean;
|
|
12
12
|
location?: LocationProps;
|
|
13
|
+
wrap_options?: boolean;
|
|
13
14
|
card_style?: any;
|
|
14
15
|
onManageFlash?: (poll: PollProps) => void;
|
|
15
16
|
init_expanded?: boolean;
|
|
@@ -29,6 +30,6 @@ type FlashMarketProps = {
|
|
|
29
30
|
}) => void;
|
|
30
31
|
onRequestAuthenticate: () => void;
|
|
31
32
|
};
|
|
32
|
-
declare const FlashMarket: ({ loading, poll, hide_footer, hide_timer, poll_options, poll_summaries, poll_campaign, flash_market_fees, hide_image, init_expanded, card_style, header_style, footer_style, onReload, location, player, player_id, onManageFlash, onRequestAuthenticate, onFocusPosition, onRequestLocation }: FlashMarketProps) => React.JSX.Element;
|
|
33
|
+
declare const FlashMarket: ({ loading, poll, hide_footer, hide_timer, wrap_options, poll_options, poll_summaries, poll_campaign, flash_market_fees, hide_image, init_expanded, card_style, header_style, footer_style, onReload, location, player, player_id, onManageFlash, onRequestAuthenticate, onFocusPosition, onRequestLocation }: FlashMarketProps) => React.JSX.Element;
|
|
33
34
|
export default FlashMarket;
|
|
34
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/FlashMarket/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,EAAqB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAItK,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/FlashMarket/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,EAAqB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAItK,OAAO,EAA6C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzF,KAAK,gBAAgB,GAAG;IACpB,OAAO,EAAC,OAAO,CAAC;IAChB,IAAI,CAAC,EAAC,SAAS,CAAC;IAChB,aAAa,CAAC,EAAC,iBAAiB,CAAC;IACjC,YAAY,EAAC,eAAe,EAAE,CAAC;IAC/B,cAAc,EAAC,gBAAgB,EAAE,CAAC;IAClC,iBAAiB,EAAC,mBAAmB,EAAE,CAAC;IACxC,UAAU,CAAC,EAAC,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAC,aAAa,CAAC;IACxB,YAAY,CAAC,EAAC,OAAO,CAAC;IACtB,UAAU,CAAC,EAAC,GAAG,CAAC;IAChB,aAAa,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,YAAY,CAAC,EAAC,SAAS,CAAC;IACxB,UAAU,EAAC,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,QAAA,MAAM,YAAY,GAAI,mGAAkG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"EmbedManager.d.ts","sourceRoot":"","sources":["../../../../../src/PartnerPortal/components/EmbedManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAmE,kBAAkB,EAAE,aAAa,EAAmC,MAAM,aAAa,CAAC;AAEvK,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAW5F,KAAK,iBAAiB,GAAG;IACrB,gBAAgB,EAAC,MAAM,CAAC;IACxB,EAAE,EAAC,aAAa,CAAC;IACjB,KAAK,CAAC,EAAC,OAAO,CAAC;IACf,eAAe,CAAC,EAAC,CAAC,GAAG,EAAC,kBAAkB,KAAK,IAAI,CAAC;IAClD,YAAY,CAAC,EAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAC,SAAS,CAAC;IACxB,UAAU,EAAC,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,QAAA,MAAM,YAAY,GAAI,mGAAkG,iBAAiB,sBAggBxI,CAAA;AAED,eAAe,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ type FlashHolderProps = {
|
|
|
17
17
|
restricted_flash_ids?:string[],
|
|
18
18
|
compact?:boolean,
|
|
19
19
|
player?:MyPlayerProps,
|
|
20
|
+
wrap_options?:boolean,
|
|
20
21
|
company_id?:string,
|
|
21
22
|
init_expanded?:boolean,
|
|
22
23
|
contest_type?:string,
|
|
@@ -40,7 +41,7 @@ type FlashHolderProps = {
|
|
|
40
41
|
onRequestAuthenticate: () => void
|
|
41
42
|
}
|
|
42
43
|
const sections = [ 'selector','explainer','flash_market','options','footer' ]
|
|
43
|
-
const FlashHolder = ({ float, poll_campaign_id, restricted_flash_ids, company_id, compact, style, default_poll_id, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation, onManageFlash } : FlashHolderProps) => {
|
|
44
|
+
const FlashHolder = ({ float, poll_campaign_id, restricted_flash_ids, wrap_options, company_id, compact, style, default_poll_id, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation, onManageFlash } : FlashHolderProps) => {
|
|
44
45
|
const Colors = useColors();
|
|
45
46
|
const [ needs_reload, setNeedsReload ] = useState(false);
|
|
46
47
|
const [ socket_campaigns, setSocketCampaigns ] = useState<PollCampaignProps[]>([]);
|
|
@@ -51,6 +52,7 @@ const FlashHolder = ({ float, poll_campaign_id, restricted_flash_ids, company_id
|
|
|
51
52
|
options: [],
|
|
52
53
|
summaries: []
|
|
53
54
|
});
|
|
55
|
+
|
|
54
56
|
const [ socket_polls, setSocketPolls ] = useState<PollProps[]>([]);
|
|
55
57
|
const [ market_data, setMarketData ] = useState<{
|
|
56
58
|
loading:boolean,
|
|
@@ -81,9 +83,10 @@ const FlashHolder = ({ float, poll_campaign_id, restricted_flash_ids, company_id
|
|
|
81
83
|
const flash_market = flash_markets.find(fm => fm.poll_id == active_flash_market);
|
|
82
84
|
let sorted_flashes = flash_markets.sort((a,b) => moment(a.end_datetime).unix() - moment(b.end_datetime).unix() || parseInt(a.poll_id) - parseInt(b.poll_id))
|
|
83
85
|
if(restricted_flash_ids && restricted_flash_ids.length > 0){ sorted_flashes = sorted_flashes.filter(f => restricted_flash_ids.includes(f.poll_id)) }
|
|
86
|
+
|
|
84
87
|
useEffect(() => {
|
|
85
88
|
loadData();
|
|
86
|
-
},[league_id, contest_type, contest_id, side_type, side_id, poll_id]);
|
|
89
|
+
},[league_id, contest_type, contest_id, side_type, side_id, poll_id, default_poll_id]);
|
|
87
90
|
|
|
88
91
|
useEffect(() => {
|
|
89
92
|
if(!loaded){ return }
|
|
@@ -294,6 +297,7 @@ const FlashHolder = ({ float, poll_campaign_id, restricted_flash_ids, company_id
|
|
|
294
297
|
<FlashMarket
|
|
295
298
|
player_id={player_id}
|
|
296
299
|
player={player}
|
|
300
|
+
wrap_options={wrap_options}
|
|
297
301
|
location={location}
|
|
298
302
|
poll={flash_market}
|
|
299
303
|
poll_options={poll_options}
|
|
@@ -8,6 +8,7 @@ import { ActivityIndicator, Alert, FlatList, Image, type ViewStyle } from 'react
|
|
|
8
8
|
import FlashMarketHelp from './components/FlashMarketHelp';
|
|
9
9
|
import moment from 'moment-mini';
|
|
10
10
|
import MarketTimer from './components/MarketTimer';
|
|
11
|
+
import { MarketComponentHelpers } from '../MarketComponents/api';
|
|
11
12
|
|
|
12
13
|
type FlashMarketProps = {
|
|
13
14
|
loading:boolean,
|
|
@@ -18,6 +19,7 @@ type FlashMarketProps = {
|
|
|
18
19
|
flash_market_fees:FlashMarketFeeProps[],
|
|
19
20
|
hide_image?:boolean,
|
|
20
21
|
location?:LocationProps,
|
|
22
|
+
wrap_options?:boolean,
|
|
21
23
|
card_style?:any,
|
|
22
24
|
onManageFlash?:(poll:PollProps) => void,
|
|
23
25
|
init_expanded?:boolean,
|
|
@@ -32,7 +34,7 @@ type FlashMarketProps = {
|
|
|
32
34
|
onFocusPosition?: (position:{ x:number, y:number, width:number, height:number }) => void,
|
|
33
35
|
onRequestAuthenticate: () => void
|
|
34
36
|
}
|
|
35
|
-
const FlashMarket = ({ loading, poll, hide_footer, hide_timer, poll_options, poll_summaries, poll_campaign, flash_market_fees, hide_image, init_expanded, card_style, header_style, footer_style, onReload, location, player, player_id, onManageFlash, onRequestAuthenticate, onFocusPosition, onRequestLocation }:FlashMarketProps) => {
|
|
37
|
+
const FlashMarket = ({ loading, poll, hide_footer, hide_timer, wrap_options, poll_options, poll_summaries, poll_campaign, flash_market_fees, hide_image, init_expanded, card_style, header_style, footer_style, onReload, location, player, player_id, onManageFlash, onRequestAuthenticate, onFocusPosition, onRequestLocation }:FlashMarketProps) => {
|
|
36
38
|
const Colors = useColors();
|
|
37
39
|
const [ admin_action, setAdminActions ] = useState<{
|
|
38
40
|
selected_option_id?:string,
|
|
@@ -206,7 +208,7 @@ const FlashMarket = ({ loading, poll, hide_footer, hide_timer, poll_options, pol
|
|
|
206
208
|
const selected = selected_option?.poll_option_id == data.item.poll_option_id ? true : false
|
|
207
209
|
const admin_checked = selected_option_id == data.item.poll_option_id ? true : false
|
|
208
210
|
return (
|
|
209
|
-
<View transparent style={{ borderRadius:8, flexDirection:'row', alignItems:'center', borderWidth:my_option?1:0, borderColor:Colors.text.action, padding:10 }}>
|
|
211
|
+
<View key={data.item.poll_option_id.toString()} transparent style={{ margin:wrap_options?2:undefined, borderRadius:8, minWidth:wrap_options?300:undefined, flexDirection:'row', alignItems:'center', borderWidth:my_option?1:0, borderColor:Colors.text.action, padding:10, flexGrow:wrap_options?1:0 }}>
|
|
210
212
|
{!selected && poll?.status != 'closed' && is_admin ?
|
|
211
213
|
<Checkbox
|
|
212
214
|
style={{ marginRight:5 }}
|
|
@@ -238,7 +240,10 @@ const FlashMarket = ({ loading, poll, hide_footer, hide_timer, poll_options, pol
|
|
|
238
240
|
</View>
|
|
239
241
|
{!selected ?
|
|
240
242
|
<View transparent style={{ marginRight:10, marginLeft:10, alignItems:'flex-end' }}>
|
|
241
|
-
<
|
|
243
|
+
<View transparent style={{ alignItems:'flex-end' }}>
|
|
244
|
+
<Text theme='h2'>{((data.item.parimutuel_odds ?? 0)*100).toFixed(2)}%</Text>
|
|
245
|
+
<Text theme='description' style={{ marginTop:3 }}>{MarketComponentHelpers.getOddsLabel(MarketComponentHelpers.calcAmericanOddsFromProbability(data.item.parimutuel_odds ?? 0))}</Text>
|
|
246
|
+
</View>
|
|
242
247
|
{my_option?.result_ind ?
|
|
243
248
|
<Text style={{ marginTop:3 }} theme='h2' color={getColor(response_stats.earnings)}>{cl}{response_stats.earnings.toFixed(2)} Earned</Text>
|
|
244
249
|
: my_option ?
|
|
@@ -338,12 +343,20 @@ const FlashMarket = ({ loading, poll, hide_footer, hide_timer, poll_options, pol
|
|
|
338
343
|
onTimesUp={() => onReload()}
|
|
339
344
|
/>
|
|
340
345
|
:<></>}
|
|
346
|
+
{wrap_options ?
|
|
347
|
+
<View style={{ flexDirection:'row', flexWrap:'wrap' }}>
|
|
348
|
+
{visible_options.map((o,i) => {
|
|
349
|
+
return renderOptions({ item:o,index:i })
|
|
350
|
+
})}
|
|
351
|
+
</View>
|
|
352
|
+
:
|
|
341
353
|
<FlatList
|
|
342
354
|
data={visible_options}
|
|
343
355
|
key={`poll_${poll.poll_id}_options`}
|
|
344
356
|
renderItem={renderOptions}
|
|
345
357
|
keyExtractor={(item) => item.poll_option_id.toString()}
|
|
346
358
|
/>
|
|
359
|
+
}
|
|
347
360
|
{is_inactive && !is_admin ?
|
|
348
361
|
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
|
|
349
362
|
<View float style={{ flexDirection:'row', alignItems:'center', padding:20 }}>
|
|
@@ -6,7 +6,7 @@ import { ActivityIndicator, FlatList, ImageBackground, type ViewStyle } from 're
|
|
|
6
6
|
import { useColors } from '../../constants/useColors';
|
|
7
7
|
import ReferralSelector from './ReferralSelector';
|
|
8
8
|
import LeagueSelector from './LeagueSelector';
|
|
9
|
-
import { Toggle } from '../../Components';
|
|
9
|
+
import { Switch, Toggle } from '../../Components';
|
|
10
10
|
import * as Clipboard from 'expo-clipboard';
|
|
11
11
|
import CompetitionSelector from './CompetitionSelector';
|
|
12
12
|
import SquaresSelector from './SquaresSelector';
|
|
@@ -163,6 +163,25 @@ const EmbedManager = ({ float, me, company_id, company_embed_id, onFocusPosition
|
|
|
163
163
|
/>
|
|
164
164
|
</View>
|
|
165
165
|
)
|
|
166
|
+
case 'switch':
|
|
167
|
+
//Switch is going to be either a 1 or a 0. 0 is off
|
|
168
|
+
const boolean_value = value && value == '1' ? true : false
|
|
169
|
+
return (
|
|
170
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderColor:Colors.borders.light, padding:10 }}>
|
|
171
|
+
<View transparent style={{ flex:1, marginRight:10 }}>
|
|
172
|
+
<Text theme='h1'>{data.item.label}</Text>
|
|
173
|
+
<Text theme='description' style={{ marginTop:3 }}>{data.item.description}</Text>
|
|
174
|
+
</View>
|
|
175
|
+
<Switch
|
|
176
|
+
value={boolean_value}
|
|
177
|
+
switch_type='on_off'
|
|
178
|
+
onChange={(val) => {
|
|
179
|
+
let str_val = val ? '1' : '0'
|
|
180
|
+
setEmbedData({ ...embed_data, draft_company_embed: { ...draft_company_embed, properties: { ...draft_company_embed.properties, [data.item.property]: str_val } } })
|
|
181
|
+
}}
|
|
182
|
+
/>
|
|
183
|
+
</View>
|
|
184
|
+
)
|
|
166
185
|
case 'refer_selector':
|
|
167
186
|
const selected_referral = player_referrals.find(pr => pr.referral_code == value);
|
|
168
187
|
return (
|