be-components 0.1.7 → 0.1.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/ApiOverrides/index.js +15 -3
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Authenticator/Components/StrategyForm.js +5 -2
- package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/commonjs/Authenticator/api/index.js +1 -0
- package/lib/commonjs/Authenticator/api/index.js.map +1 -1
- package/lib/commonjs/Authenticator/index.js +0 -1
- package/lib/commonjs/Authenticator/index.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +27 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +2 -0
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +2 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/DOBManager.js +4 -1
- package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/EmailManager.js +19 -8
- package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js +11 -3
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +224 -56
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +6 -5
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/api/index.js +10 -2
- package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
- package/lib/commonjs/ProfileManager/index.js +26 -8
- package/lib/commonjs/ProfileManager/index.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +15 -3
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Authenticator/Components/StrategyForm.js +5 -2
- package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
- package/lib/module/Authenticator/api/index.js +1 -0
- package/lib/module/Authenticator/api/index.js.map +1 -1
- package/lib/module/Authenticator/index.js +0 -1
- package/lib/module/Authenticator/index.js.map +1 -1
- package/lib/module/Components/Icons.js +27 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicInfoManager.js +2 -0
- package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js +2 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/module/ProfileManager/Components/DOBManager.js +4 -1
- package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/EmailManager.js +19 -8
- package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PhoneManager.js +11 -3
- package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWizard.js +226 -59
- package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js +6 -5
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/api/index.js +10 -2
- package/lib/module/ProfileManager/api/index.js.map +1 -1
- package/lib/module/ProfileManager/index.js +26 -8
- package/lib/module/ProfileManager/index.js.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts +2 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/api/index.d.ts +1 -0
- package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +6 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/api/index.d.ts +5 -1
- package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/index.d.ts +6 -2
- package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ApiOverrides/index.ts +16 -4
- package/src/Authenticator/Components/StrategyForm.tsx +5 -2
- package/src/Authenticator/api/index.ts +2 -1
- package/src/Authenticator/api/types.d.ts +1 -0
- package/src/Authenticator/index.tsx +0 -1
- package/src/Components/Icons.tsx +15 -0
- package/src/ProfileManager/Components/BasicInfoManager.tsx +1 -1
- package/src/ProfileManager/Components/CodeRedeem.tsx +3 -2
- package/src/ProfileManager/Components/DOBManager.tsx +2 -1
- package/src/ProfileManager/Components/EmailManager.tsx +12 -4
- package/src/ProfileManager/Components/PhoneManager.tsx +7 -1
- package/src/ProfileManager/Components/ProfilePicManager.tsx +1 -1
- package/src/ProfileManager/Components/ProfileWizard.tsx +124 -54
- package/src/ProfileManager/Components/VouchCard.tsx +6 -5
- package/src/ProfileManager/api/index.ts +6 -2
- package/src/ProfileManager/api/types.d.ts +1 -1
- package/src/ProfileManager/index.tsx +29 -8
|
@@ -5,17 +5,21 @@ import { Text } from '../Components';
|
|
|
5
5
|
import ProfileWizard from './Components/ProfileWizard';
|
|
6
6
|
import { ProfileApi } from './api';
|
|
7
7
|
import type { MyPlayerProps, PlayerBalanceProps } from './api/types';
|
|
8
|
-
import { APIOverrides } from '../ApiOverrides';
|
|
9
8
|
|
|
10
9
|
type ProfileOverviewProps = {
|
|
11
10
|
width:number,
|
|
12
|
-
|
|
11
|
+
show_welcome?:boolean,
|
|
12
|
+
//access_token:string,
|
|
13
|
+
hidden_groups?:string[],
|
|
14
|
+
hidden_steps?:string[],
|
|
15
|
+
hidden_levels?:string[],
|
|
13
16
|
onClose:() => void,
|
|
17
|
+
onLogout:() => void,
|
|
14
18
|
profile_attribute?:'basic'|'phone'|'email'|'dob'|'password'|'vouch',
|
|
15
19
|
walkthrough?:boolean
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
const ProfileManager = ({ profile_attribute,
|
|
22
|
+
const ProfileManager = ({ profile_attribute, show_welcome, hidden_groups, hidden_steps, hidden_levels, walkthrough, width, onClose, onLogout }: ProfileOverviewProps ) => {
|
|
19
23
|
const [ loading, setLoading ] = useState(false);
|
|
20
24
|
const [ draft_player, setDraftPlayer ] = useState<MyPlayerProps>();
|
|
21
25
|
const [ player_balance, setPlayerBalance ] = useState<PlayerBalanceProps>();
|
|
@@ -27,14 +31,26 @@ const ProfileManager = ({ profile_attribute, walkthrough, access_token, width, o
|
|
|
27
31
|
const getPlayerFromServer = async() => {
|
|
28
32
|
setLoading(true);
|
|
29
33
|
ProfileApi.setEnvironment();
|
|
30
|
-
APIOverrides.setBearerToken(access_token)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
//APIOverrides.setBearerToken(access_token)
|
|
35
|
+
try {
|
|
36
|
+
const player = await ProfileApi.getMyDetails();
|
|
37
|
+
const pb = await ProfileApi.getMyBalance();
|
|
38
|
+
setPlayerBalance(pb);
|
|
39
|
+
setDraftPlayer(player);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.log(e)
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
setLoading(false);
|
|
36
45
|
}
|
|
37
46
|
|
|
47
|
+
const handleLogout = () => {
|
|
48
|
+
setDraftPlayer(undefined);
|
|
49
|
+
setPlayerBalance(undefined);
|
|
50
|
+
onLogout()
|
|
51
|
+
onClose()
|
|
52
|
+
}
|
|
53
|
+
|
|
38
54
|
if(!draft_player || loading){
|
|
39
55
|
return (
|
|
40
56
|
<View style={{ flex:1, width }}>
|
|
@@ -68,9 +84,14 @@ const ProfileManager = ({ profile_attribute, walkthrough, access_token, width, o
|
|
|
68
84
|
<View style={{ marginTop:10, flex:1 }}>
|
|
69
85
|
<ProfileWizard
|
|
70
86
|
player={draft_player}
|
|
87
|
+
show_welcome={show_welcome}
|
|
71
88
|
width={width}
|
|
89
|
+
hidden_groups={hidden_groups}
|
|
90
|
+
hidden_steps={hidden_steps}
|
|
91
|
+
hidden_levels={hidden_levels}
|
|
72
92
|
init_walkthrough={walkthrough}
|
|
73
93
|
onClose={() => onClose()}
|
|
94
|
+
onLogout={() => handleLogout()}
|
|
74
95
|
profile_attribute={profile_attribute}
|
|
75
96
|
onSelectLevel={(level) => console.log(level)}
|
|
76
97
|
onPlayerUpdate={(player) => setDraftPlayer(player)}
|