be-components 6.2.1 → 6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Competition/components/CompetitionPlay.js +8 -1
- package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -1
- package/lib/commonjs/Competition/components/MarketsCard.js +1 -0
- package/lib/commonjs/Competition/components/MarketsCard.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +49 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/MarketComponents/api/index.js +189 -0
- package/lib/commonjs/MarketComponents/api/index.js.map +1 -1
- package/lib/commonjs/MarketComponents/components/CreateMarketForm.js +736 -0
- package/lib/commonjs/MarketComponents/components/CreateMarketForm.js.map +1 -0
- package/lib/commonjs/MarketComponents/components/WeightProgress.js +53 -0
- package/lib/commonjs/MarketComponents/components/WeightProgress.js.map +1 -0
- package/lib/commonjs/MarketComponents/index.js +2 -0
- package/lib/commonjs/MarketComponents/index.js.map +1 -1
- package/lib/commonjs/MarketMaker/api/index.js +3 -0
- package/lib/commonjs/MarketMaker/api/index.js.map +1 -1
- package/lib/commonjs/Poll/components/PollCard.js +3 -0
- package/lib/commonjs/Poll/components/PollCard.js.map +1 -1
- package/lib/module/Competition/components/CompetitionPlay.js +8 -1
- package/lib/module/Competition/components/CompetitionPlay.js.map +1 -1
- package/lib/module/Competition/components/MarketsCard.js +1 -0
- package/lib/module/Competition/components/MarketsCard.js.map +1 -1
- package/lib/module/Components/Icons.js +49 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/MarketComponents/api/index.js +189 -0
- package/lib/module/MarketComponents/api/index.js.map +1 -1
- package/lib/module/MarketComponents/components/CreateMarketForm.js +727 -0
- package/lib/module/MarketComponents/components/CreateMarketForm.js.map +1 -0
- package/lib/module/MarketComponents/components/WeightProgress.js +45 -0
- package/lib/module/MarketComponents/components/WeightProgress.js.map +1 -0
- package/lib/module/MarketComponents/index.js +2 -0
- package/lib/module/MarketComponents/index.js.map +1 -1
- package/lib/module/MarketMaker/api/index.js +3 -0
- package/lib/module/MarketMaker/api/index.js.map +1 -1
- package/lib/module/Poll/components/PollCard.js +3 -0
- package/lib/module/Poll/components/PollCard.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/CompetitionPlay.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/MarketsCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +10 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts +6 -0
- package/lib/typescript/lib/commonjs/MarketComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/MarketComponents/components/CreateMarketForm.d.ts +20 -0
- package/lib/typescript/lib/commonjs/MarketComponents/components/CreateMarketForm.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MarketComponents/components/WeightProgress.d.ts +8 -0
- package/lib/typescript/lib/commonjs/MarketComponents/components/WeightProgress.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/MarketComponents/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/MarketMaker/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Poll/components/PollCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/CompetitionPlay.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/MarketsCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Icons.d.ts +10 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/api/index.d.ts +6 -0
- package/lib/typescript/lib/module/MarketComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketComponents/components/CreateMarketForm.d.ts +20 -0
- package/lib/typescript/lib/module/MarketComponents/components/CreateMarketForm.d.ts.map +1 -0
- package/lib/typescript/lib/module/MarketComponents/components/WeightProgress.d.ts +8 -0
- package/lib/typescript/lib/module/MarketComponents/components/WeightProgress.d.ts.map +1 -0
- package/lib/typescript/lib/module/MarketComponents/index.d.ts +2 -0
- package/lib/typescript/lib/module/MarketComponents/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/MarketMaker/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Poll/components/PollCard.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/MarketsCard.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +2 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/api/index.d.ts +6 -0
- package/lib/typescript/src/MarketComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketComponents/components/CreateMarketForm.d.ts +27 -0
- package/lib/typescript/src/MarketComponents/components/CreateMarketForm.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/components/WeightProgress.d.ts +12 -0
- package/lib/typescript/src/MarketComponents/components/WeightProgress.d.ts.map +1 -0
- package/lib/typescript/src/MarketComponents/index.d.ts +21 -0
- package/lib/typescript/src/MarketComponents/index.d.ts.map +1 -1
- package/lib/typescript/src/MarketMaker/api/index.d.ts +1 -1
- package/lib/typescript/src/MarketMaker/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Poll/components/PollCard.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/components/CompetitionPlay.tsx +6 -6
- package/src/Competition/components/MarketsCard.tsx +1 -0
- package/src/Components/Icons.tsx +26 -0
- package/src/MarketComponents/api/index.ts +166 -3
- package/src/MarketComponents/components/CreateMarketForm.tsx +444 -0
- package/src/MarketComponents/components/WeightProgress.tsx +32 -0
- package/src/MarketComponents/index.tsx +2 -0
- package/src/MarketMaker/api/index.ts +2 -1
- package/src/Poll/components/PollCard.tsx +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View } from '../../Components/Themed';
|
|
3
|
+
import { useColors } from '../../constants/useColors';
|
|
4
|
+
import type { ViewStyle } from 'react-native';
|
|
5
|
+
|
|
6
|
+
type WeightProgressProps = {
|
|
7
|
+
min_value:number,
|
|
8
|
+
max_value:number,
|
|
9
|
+
style?:ViewStyle,
|
|
10
|
+
value: number,
|
|
11
|
+
bar_height?:number
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const WeightProgress = ({ value, bar_height, style }:WeightProgressProps) => {
|
|
15
|
+
const Colors = useColors();
|
|
16
|
+
const [ width, setWidth ] = useState(0);
|
|
17
|
+
let progress_width = value * width / 2
|
|
18
|
+
let start_point = width/2
|
|
19
|
+
if(progress_width < 0){
|
|
20
|
+
start_point += progress_width
|
|
21
|
+
}
|
|
22
|
+
return (
|
|
23
|
+
<View style={{ borderRadius:2, height: bar_height ? bar_height + 2: 6, backgroundColor:Colors.borders.light, padding:1, justifyContent:'center', ...style }} onLayout={(ev) => {
|
|
24
|
+
const { width } = ev.nativeEvent.layout;
|
|
25
|
+
setWidth(width)
|
|
26
|
+
}}>
|
|
27
|
+
<View style={{ position:'absolute', top:1, bottom:1, left:start_point, width:Math.abs(progress_width), backgroundColor:Colors.text.h1, height:bar_height??4, borderRadius:4 }}/>
|
|
28
|
+
</View>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default WeightProgress
|
|
@@ -14,6 +14,7 @@ import MyOrderList from './components/MyOrderList';
|
|
|
14
14
|
import ExternalPriceComparison from './components/ExternalPriceComparison';
|
|
15
15
|
import OrderGradeBar from './components/OrderGradeBar';
|
|
16
16
|
import MarketManager from './components/MarketManager';
|
|
17
|
+
import CreateMarketForm from './components/CreateMarketForm';
|
|
17
18
|
|
|
18
19
|
export default {
|
|
19
20
|
TeamEventMarket,
|
|
@@ -22,6 +23,7 @@ export default {
|
|
|
22
23
|
BestAvailableOrderCard,
|
|
23
24
|
EventMarket,
|
|
24
25
|
OrderBookCard,
|
|
26
|
+
CreateMarketForm,
|
|
25
27
|
MarketManager,
|
|
26
28
|
OrderBookChart,
|
|
27
29
|
AthleteTournamentMarket,
|
|
@@ -936,7 +936,8 @@ const MarketMaketHelpers = {
|
|
|
936
936
|
}
|
|
937
937
|
return cash
|
|
938
938
|
},
|
|
939
|
-
getNoVigPrice: (prices:ExternalPriceProps[], market
|
|
939
|
+
getNoVigPrice: (prices:ExternalPriceProps[], market?:MarketProps) => {
|
|
940
|
+
if(!market){ return undefined }
|
|
940
941
|
if(!prices || prices.length != 2){ return undefined }
|
|
941
942
|
let external_name = prices[0]?.external_name
|
|
942
943
|
if(!external_name){ return undefined }
|
|
@@ -199,6 +199,7 @@ const PollCard = ({ poll_id, height, width, view_mode, poll_response, action_loa
|
|
|
199
199
|
)
|
|
200
200
|
case 'correct_select':
|
|
201
201
|
if(!poll || poll.poll_type != 'select' || !correct_option){ return <></> }
|
|
202
|
+
if(poll.status != 'closed' && correct_option && !poll_response){ return <></> }
|
|
202
203
|
return (
|
|
203
204
|
<View nativeID='selected_option' style={{ marginBottom:10, padding:10 }}>
|
|
204
205
|
<Text style={{ marginBottom:5 }} size={14} theme='description' weight='semibold'>CORRECT ANSWER</Text>
|