be-components 3.2.9 → 3.3.0
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 +1 -16
- package/lib/commonjs/Competition/components/CompetitionPlay.js.map +1 -1
- package/lib/commonjs/Competition/index.js +13 -41
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/Components/ConfirmationModal.js +18 -4
- package/lib/commonjs/Components/ConfirmationModal.js.map +1 -1
- package/lib/module/Competition/components/CompetitionPlay.js +1 -16
- package/lib/module/Competition/components/CompetitionPlay.js.map +1 -1
- package/lib/module/Competition/index.js +14 -42
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/Components/ConfirmationModal.js +19 -5
- package/lib/module/Components/ConfirmationModal.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/components/CompetitionPlay.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/components/CompetitionPlay.d.ts.map +1 -1
- package/lib/typescript/lib/module/Competition/index.d.ts +2 -1
- package/lib/typescript/lib/module/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts +3 -1
- package/lib/typescript/lib/module/Components/ConfirmationModal.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/CompetitionPlay.d.ts.map +1 -1
- package/lib/typescript/src/Competition/index.d.ts +2 -1
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/ConfirmationModal.d.ts +4 -2
- package/lib/typescript/src/Components/ConfirmationModal.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/components/CompetitionPlay.tsx +3 -9
- package/src/Competition/index.tsx +16 -42
- package/src/Components/ConfirmationModal.tsx +17 -4
package/package.json
CHANGED
|
@@ -12,7 +12,6 @@ import { view_styles } from "../../constants/styles";
|
|
|
12
12
|
import {LinearGradient} from "expo-linear-gradient";
|
|
13
13
|
import { Icons, Text } from "../../Components";
|
|
14
14
|
import LinearDiagnal from "../../Components/LinearDiagnal";
|
|
15
|
-
import SpringView from "../../Components/Spring";
|
|
16
15
|
|
|
17
16
|
type CompetitionPlayProps = {
|
|
18
17
|
player_id?:string,
|
|
@@ -294,18 +293,13 @@ const CompetitionPlay = ( { authenticated_competition_player, pick_loading, comp
|
|
|
294
293
|
|
|
295
294
|
</View>
|
|
296
295
|
{authenticated_competition_player ?
|
|
297
|
-
<
|
|
298
|
-
slide="horizontal"
|
|
299
|
-
from={200}
|
|
300
|
-
to={0}
|
|
301
|
-
style={{ flex:1, flexDirection:'row', borderTopLeftRadius:22, borderBottomLeftRadius:22, padding:10, alignItems:'center', backgroundColor:Colors.utility.success, ...view_styles.float }}
|
|
302
|
-
>
|
|
296
|
+
<View>
|
|
303
297
|
{ competition_type?.type == 'wager' ?
|
|
304
298
|
<Text style={{ flex:1 }} size={14} color={Colors.shades.white} weight='semibold' textAlign="right">{authenticated_competition_player.wager_based_balance.toFixed(2)} Remaining</Text>
|
|
305
|
-
|
|
299
|
+
:
|
|
306
300
|
<Text style={{ flex:1 }} size={14} color={Colors.shades.white} weight='semibold' textAlign="right">{parseFloat(competition.max_pick_count as string) - player_picks.length} Picks Remaining</Text>
|
|
307
301
|
}
|
|
308
|
-
</
|
|
302
|
+
</View>
|
|
309
303
|
:<></>}
|
|
310
304
|
</View>
|
|
311
305
|
</View>
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { CompetitionApi, CompetitionHelpers, CompetitionMatchApi, CompetitionPlayerApi, PlayerPicksApi } from './api';
|
|
3
3
|
import { View, ScrollView, Image, TouchableOpacity, ActivityIndicator, Modal } from 'react-native';
|
|
4
4
|
import { view_styles } from '../constants/styles';
|
|
5
|
-
import { Button,
|
|
5
|
+
import { Button, ConfirmationModal, Icons, Text } from '../Components';
|
|
6
6
|
import Colors from '../constants/colors';
|
|
7
7
|
import type { AthleteProps, BEEventProps, CodeRequestProps, CompetitionMatchMarketProps, CompetitionMatchProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, EventProps, LeagueProps, MarketProps, MatchProps, MyPlayerProps, PlayerBalanceProps, PlayerPickProps, PlayerReferralProps, PromoProps, PublicPlayerProps, RewardOptionProps, TeamProps, TournamentProps } from '../types';
|
|
8
8
|
import CompetitionInfoCard from './components/CompetitionInfoCard';
|
|
@@ -12,12 +12,12 @@ import CompetitionPlay from './components/CompetitionPlay';
|
|
|
12
12
|
import EnterCompetitionPrompt from './components/EnterCompetitionPrompt';
|
|
13
13
|
import moment from 'moment-mini';
|
|
14
14
|
import LeaderPicks from './components/LeaderPicks';
|
|
15
|
-
import NavOutPrompt from './components/NavOutPrompt';
|
|
16
15
|
import SeasonCard from './components/SeasonCard';
|
|
17
16
|
|
|
18
17
|
type CompetitionModuleProps = {
|
|
19
18
|
player_id?:string,
|
|
20
19
|
competition_id:string,
|
|
20
|
+
confirm_padding?:number,
|
|
21
21
|
onClose:() => void,
|
|
22
22
|
onEvent?:(event:BEEventProps) => void,
|
|
23
23
|
onManageCompetition:(competition_id:string) => void,
|
|
@@ -26,7 +26,7 @@ type CompetitionModuleProps = {
|
|
|
26
26
|
onViewCompetitionSeason:(cs:CompetitionSeasonProps) => void
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const CompetitionModule = ({ competition_id, player_id, onManageCompetition, onRequestAuthentication, onShareCompetition, onClose, onViewCompetitionSeason }:CompetitionModuleProps) => {
|
|
29
|
+
const CompetitionModule = ({ competition_id, player_id, confirm_padding, onManageCompetition, onRequestAuthentication, onShareCompetition, onClose, onViewCompetitionSeason }:CompetitionModuleProps) => {
|
|
30
30
|
const [ viewing_leader, setViewingLeader ] = useState<PublicPlayerProps|undefined>();
|
|
31
31
|
const [ show_full_leaderboard, setShowFullLeaderboard ] = useState(false);
|
|
32
32
|
const [ module_size, setModuleSize ] = useState({ width:0, height:0 });
|
|
@@ -455,11 +455,7 @@ const CompetitionModule = ({ competition_id, player_id, onManageCompetition, onR
|
|
|
455
455
|
:<></>}
|
|
456
456
|
{show_full_leaderboard ?
|
|
457
457
|
<View style={{ position:'absolute', bottom:0, left:0, right:0, top:0 }}>
|
|
458
|
-
|
|
459
|
-
slide='vertical'
|
|
460
|
-
to={0}
|
|
461
|
-
from={500}
|
|
462
|
-
>
|
|
458
|
+
|
|
463
459
|
<CompetitionLeaderboard
|
|
464
460
|
competition={competition}
|
|
465
461
|
competition_type={competition_type}
|
|
@@ -471,38 +467,22 @@ const CompetitionModule = ({ competition_id, player_id, onManageCompetition, onR
|
|
|
471
467
|
onSeeFull={() => setShowFullLeaderboard(!show_full_leaderboard)}
|
|
472
468
|
viewer_id={player_id}
|
|
473
469
|
/>
|
|
474
|
-
|
|
475
|
-
</View>
|
|
470
|
+
xxw </View>
|
|
476
471
|
:<></>}
|
|
477
|
-
{
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
image_url={nav_out.image_url}
|
|
488
|
-
hide_accept={true}
|
|
489
|
-
code_details={{}}
|
|
490
|
-
max_width={module_size.width * 0.75}
|
|
491
|
-
cancel_title={nav_out.cancel_title}
|
|
492
|
-
onCancel={() => setNavOut({ ...nav_out, visible:false })}
|
|
493
|
-
onAccept={() => setNavOut({ ...nav_out, visible:false })}
|
|
494
|
-
/>
|
|
495
|
-
</Spring>
|
|
472
|
+
<View style={{ position:'absolute' }}>
|
|
473
|
+
<ConfirmationModal
|
|
474
|
+
visible={nav_out.visible}
|
|
475
|
+
title={nav_out.title}
|
|
476
|
+
padding_bottom={confirm_padding}
|
|
477
|
+
confirm_title={'Edit My Picks'}
|
|
478
|
+
description={nav_out.body}
|
|
479
|
+
image={competition.image?.url}
|
|
480
|
+
onConfirm={() => setNavOut({ ...nav_out, visible:false })}
|
|
481
|
+
/>
|
|
496
482
|
</View>
|
|
497
|
-
:<></>}
|
|
498
483
|
{draft_player_pick?.draft_pick ?
|
|
499
484
|
<View
|
|
500
485
|
style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
|
|
501
|
-
<Spring
|
|
502
|
-
slide='vertical'
|
|
503
|
-
to={0}
|
|
504
|
-
from={200}
|
|
505
|
-
>
|
|
506
486
|
<WagerPickForm
|
|
507
487
|
event_start={draft_player_pick.event_start ?? ''}
|
|
508
488
|
event_title={draft_player_pick.event_title ?? ''}
|
|
@@ -513,7 +493,6 @@ const CompetitionModule = ({ competition_id, player_id, onManageCompetition, onR
|
|
|
513
493
|
onCancel={() => setDraftPlayerPick({})}
|
|
514
494
|
onSubmit={(pp) => handleWagerSubmit(pp)}
|
|
515
495
|
/>
|
|
516
|
-
</Spring>
|
|
517
496
|
</View>
|
|
518
497
|
:<></>}
|
|
519
498
|
<Modal
|
|
@@ -540,11 +519,7 @@ const CompetitionModule = ({ competition_id, player_id, onManageCompetition, onR
|
|
|
540
519
|
{viewing_leader ?
|
|
541
520
|
<View
|
|
542
521
|
style={{ position:'absolute', top:0, right:0, left:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'flex-end', alignItems:'center' }}>
|
|
543
|
-
|
|
544
|
-
slide='vertical'
|
|
545
|
-
to={0}
|
|
546
|
-
from={200}
|
|
547
|
-
>
|
|
522
|
+
|
|
548
523
|
<LeaderPicks
|
|
549
524
|
competition={competition}
|
|
550
525
|
leader={viewing_leader}
|
|
@@ -561,7 +536,6 @@ const CompetitionModule = ({ competition_id, player_id, onManageCompetition, onR
|
|
|
561
536
|
width={module_size.width}
|
|
562
537
|
onClose={() => setViewingLeader(undefined)}
|
|
563
538
|
/>
|
|
564
|
-
</Spring>
|
|
565
539
|
</View>
|
|
566
540
|
:<></>}
|
|
567
541
|
{competition.status == 'inactive' ?
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Modal, View } from "react-native"
|
|
2
|
+
import { Image, Modal, View } from "react-native"
|
|
3
3
|
import { view_styles } from '../constants/styles';
|
|
4
4
|
import Text from './Text';
|
|
5
5
|
import Button from './Button';
|
|
@@ -10,11 +10,15 @@ type ConfirmationModalProps = {
|
|
|
10
10
|
title?:string,
|
|
11
11
|
description?:string,
|
|
12
12
|
confirm_title?:string,
|
|
13
|
+
padding_bottom?:number,
|
|
13
14
|
cancel_title?:string,
|
|
14
|
-
|
|
15
|
+
image?:string,
|
|
16
|
+
onCancel?: () => void,
|
|
15
17
|
onConfirm: () => void
|
|
16
18
|
}
|
|
17
|
-
const ConfirmationModal = ({ visible, title, description, confirm_title, cancel_title, onCancel, onConfirm }:ConfirmationModalProps) => {
|
|
19
|
+
const ConfirmationModal = ({ visible, title, padding_bottom, image, description, confirm_title, cancel_title, onCancel, onConfirm }:ConfirmationModalProps) => {
|
|
20
|
+
|
|
21
|
+
|
|
18
22
|
|
|
19
23
|
return (
|
|
20
24
|
<Modal
|
|
@@ -22,15 +26,23 @@ const ConfirmationModal = ({ visible, title, description, confirm_title, cancel_
|
|
|
22
26
|
animationType='slide'
|
|
23
27
|
transparent
|
|
24
28
|
style={{ flex:1 }}>
|
|
25
|
-
<View style={{ flex:1, justifyContent:'flex-end', backgroundColor:Colors.shades.black_faded }}>
|
|
29
|
+
<View style={{ flex:1, justifyContent:'flex-end', backgroundColor:Colors.shades.black_faded, paddingBottom:padding_bottom }}>
|
|
26
30
|
<View style={{ ...view_styles.section }}>
|
|
27
31
|
<View style={{ ...view_styles.section_header, padding:20 }}>
|
|
28
32
|
<Text theme='header'>{title ?? 'Are you sure?'}</Text>
|
|
29
33
|
</View>
|
|
30
34
|
<View style={{ ...view_styles.section_body, minHeight:100 }}>
|
|
35
|
+
{image?
|
|
36
|
+
<Image
|
|
37
|
+
source={{ uri: image }}
|
|
38
|
+
style={{ width:200, height:200 , marginBottom: 10, alignSelf:'center'}}
|
|
39
|
+
resizeMode='cover'
|
|
40
|
+
/>
|
|
41
|
+
:<></>}
|
|
31
42
|
<Text size={14} color={Colors.brand.midnight} textAlign='center' weight='semibold'>{description}</Text>
|
|
32
43
|
</View>
|
|
33
44
|
<View style={{ ...view_styles.section_footer }}>
|
|
45
|
+
{onCancel?
|
|
34
46
|
<Button
|
|
35
47
|
title={cancel_title ?? 'CANCEL'}
|
|
36
48
|
style={{ flex:1 }}
|
|
@@ -39,6 +51,7 @@ const ConfirmationModal = ({ visible, title, description, confirm_title, cancel_
|
|
|
39
51
|
backgroundColor={Colors.utility.error}
|
|
40
52
|
onPress={() => onCancel()}
|
|
41
53
|
/>
|
|
54
|
+
:<></>}
|
|
42
55
|
<Button
|
|
43
56
|
title={confirm_title ?? 'CONFIRM'}
|
|
44
57
|
style={{ flex:2, marginLeft:5 }}
|