be-components 7.0.0 → 7.0.2
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/Group/index.js +15 -1
- package/lib/commonjs/Group/index.js.map +1 -1
- package/lib/commonjs/SquaresManager/api/index.js +22 -1
- package/lib/commonjs/SquaresManager/api/index.js.map +1 -1
- package/lib/commonjs/SquaresManager/index.js +26 -3
- package/lib/commonjs/SquaresManager/index.js.map +1 -1
- package/lib/module/Group/index.js +15 -1
- package/lib/module/Group/index.js.map +1 -1
- package/lib/module/SquaresManager/api/index.js +22 -1
- package/lib/module/SquaresManager/api/index.js.map +1 -1
- package/lib/module/SquaresManager/index.js +26 -3
- package/lib/module/SquaresManager/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/Group/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SquaresManager/api/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/SquaresManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SquaresManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Group/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SquaresManager/api/index.d.ts +1 -1
- package/lib/typescript/lib/module/SquaresManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SquaresManager/index.d.ts.map +1 -1
- package/lib/typescript/src/Group/index.d.ts.map +1 -1
- package/lib/typescript/src/SquaresManager/api/index.d.ts +1 -1
- package/lib/typescript/src/SquaresManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/SquaresManager/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Group/index.tsx +6 -2
- package/src/SquaresManager/api/index.ts +12 -1
- package/src/SquaresManager/index.tsx +18 -4
|
@@ -39,6 +39,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
39
39
|
active_event?:EventProps,
|
|
40
40
|
active_league?:LeagueProps,
|
|
41
41
|
min_square_price:string,
|
|
42
|
+
guaranteed_payout:string,
|
|
42
43
|
leagues:LeagueProps[],
|
|
43
44
|
league_schedule:boolean,
|
|
44
45
|
draft_competition?:SquaresCompetitionProps,
|
|
@@ -49,9 +50,10 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
49
50
|
leagues_visible:false,
|
|
50
51
|
leagues:[],
|
|
51
52
|
min_square_price: '0',
|
|
53
|
+
guaranteed_payout: '0',
|
|
52
54
|
league_schedule: false
|
|
53
55
|
});
|
|
54
|
-
const { loading, squares_competition, min_square_price, active_tab, leagues, league_schedule, draft_competition, leagues_visible, active_event, active_league } = sq_state
|
|
56
|
+
const { loading, squares_competition, min_square_price, guaranteed_payout, active_tab, leagues, league_schedule, draft_competition, leagues_visible, active_event, active_league } = sq_state
|
|
55
57
|
const active_group = groups.find(g => g.group_id == draft_competition?.group_id)
|
|
56
58
|
const active_company = companies.find(c => c.company_id == draft_competition?.company_id);
|
|
57
59
|
|
|
@@ -61,7 +63,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
61
63
|
if(player){ getMyData() }
|
|
62
64
|
},[sq_comp_id, player]);
|
|
63
65
|
|
|
64
|
-
const errors = SquaresManagerHelpers.isValid(draft_competition);
|
|
66
|
+
const errors = SquaresManagerHelpers.isValid(draft_competition, min_square_price, guaranteed_payout);
|
|
65
67
|
|
|
66
68
|
const getMyData = async() => {
|
|
67
69
|
const my_groups = await SquaresManagerApi.getMyGroups(0);
|
|
@@ -116,7 +118,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
116
118
|
if(errors.length > 0){ return alert(errors.map(e => e)) }
|
|
117
119
|
if(loading){ return }//No mashy
|
|
118
120
|
setState({ ...sq_state, loading:true });
|
|
119
|
-
const new_comp = await SquaresManagerApi.updateSquaresCompetition({ ...sq_comp, minimum_square_price: parseFloat(min_square_price)});
|
|
121
|
+
const new_comp = await SquaresManagerApi.updateSquaresCompetition({ ...sq_comp, guaranteed_payout: parseFloat(guaranteed_payout), minimum_square_price: parseFloat(min_square_price)});
|
|
120
122
|
if(!new_comp){ return alert('Unable to update squares competition') }
|
|
121
123
|
setState({
|
|
122
124
|
...sq_state,
|
|
@@ -249,6 +251,18 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
249
251
|
onChangeText={(text) => setState({ ...sq_state, min_square_price: text })}
|
|
250
252
|
/>
|
|
251
253
|
</View>
|
|
254
|
+
{player?.role == 'admin' ?
|
|
255
|
+
<View style={{ padding:10 }}>
|
|
256
|
+
<Text theme='h1' style={{ marginBottom:10 }}>Guaranteed Payout</Text>
|
|
257
|
+
<TextInput
|
|
258
|
+
placeholder='1'
|
|
259
|
+
onFocusPosition={onFocusPosition}
|
|
260
|
+
value={guaranteed_payout}
|
|
261
|
+
style={{ textAlign:'center' }}
|
|
262
|
+
onChangeText={(text) => setState({ ...sq_state, guaranteed_payout: text })}
|
|
263
|
+
/>
|
|
264
|
+
</View>
|
|
265
|
+
:<></>}
|
|
252
266
|
<View type='row' nativeID="invite_only" style={{ flexWrap:'wrap', padding:20, borderBottomWidth:1, borderColor:Colors.borders.light }}>
|
|
253
267
|
<View style={{ flex:1, marginRight:15 }}>
|
|
254
268
|
<Text theme='h1'>Make Private</Text>
|
|
@@ -358,7 +372,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
358
372
|
default: return <></>
|
|
359
373
|
}
|
|
360
374
|
}
|
|
361
|
-
const is_changed = JSON.stringify(squares_competition) != JSON.stringify(draft_competition) ? true : parseFloat(min_square_price) != draft_competition?.minimum_square_price ? true : false
|
|
375
|
+
const is_changed = JSON.stringify(squares_competition) != JSON.stringify(draft_competition) ? true : parseFloat(min_square_price) != draft_competition?.minimum_square_price ? true : parseFloat(guaranteed_payout) != draft_competition?.guaranteed_payout ? true : false
|
|
362
376
|
return (
|
|
363
377
|
<View float={float} style={{ flex:1 }}>
|
|
364
378
|
<View transparent style={{ flex:1 }}>
|