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.
Files changed (98) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +15 -3
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Authenticator/Components/StrategyForm.js +5 -2
  4. package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
  5. package/lib/commonjs/Authenticator/api/index.js +1 -0
  6. package/lib/commonjs/Authenticator/api/index.js.map +1 -1
  7. package/lib/commonjs/Authenticator/index.js +0 -1
  8. package/lib/commonjs/Authenticator/index.js.map +1 -1
  9. package/lib/commonjs/Components/Icons.js +27 -0
  10. package/lib/commonjs/Components/Icons.js.map +1 -1
  11. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +2 -0
  12. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  13. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +2 -1
  14. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  15. package/lib/commonjs/ProfileManager/Components/DOBManager.js +4 -1
  16. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  17. package/lib/commonjs/ProfileManager/Components/EmailManager.js +19 -8
  18. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  19. package/lib/commonjs/ProfileManager/Components/PhoneManager.js +11 -3
  20. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  21. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +1 -1
  22. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  23. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +224 -56
  24. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  25. package/lib/commonjs/ProfileManager/Components/VouchCard.js +6 -5
  26. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  27. package/lib/commonjs/ProfileManager/api/index.js +10 -2
  28. package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
  29. package/lib/commonjs/ProfileManager/index.js +26 -8
  30. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  31. package/lib/module/ApiOverrides/index.js +15 -3
  32. package/lib/module/ApiOverrides/index.js.map +1 -1
  33. package/lib/module/Authenticator/Components/StrategyForm.js +5 -2
  34. package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
  35. package/lib/module/Authenticator/api/index.js +1 -0
  36. package/lib/module/Authenticator/api/index.js.map +1 -1
  37. package/lib/module/Authenticator/index.js +0 -1
  38. package/lib/module/Authenticator/index.js.map +1 -1
  39. package/lib/module/Components/Icons.js +27 -0
  40. package/lib/module/Components/Icons.js.map +1 -1
  41. package/lib/module/ProfileManager/Components/BasicInfoManager.js +2 -0
  42. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  43. package/lib/module/ProfileManager/Components/CodeRedeem.js +2 -1
  44. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  45. package/lib/module/ProfileManager/Components/DOBManager.js +4 -1
  46. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  47. package/lib/module/ProfileManager/Components/EmailManager.js +19 -8
  48. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  49. package/lib/module/ProfileManager/Components/PhoneManager.js +11 -3
  50. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  51. package/lib/module/ProfileManager/Components/ProfilePicManager.js +1 -1
  52. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  53. package/lib/module/ProfileManager/Components/ProfileWizard.js +226 -59
  54. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  55. package/lib/module/ProfileManager/Components/VouchCard.js +6 -5
  56. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  57. package/lib/module/ProfileManager/api/index.js +10 -2
  58. package/lib/module/ProfileManager/api/index.js.map +1 -1
  59. package/lib/module/ProfileManager/index.js +26 -8
  60. package/lib/module/ProfileManager/index.js.map +1 -1
  61. package/lib/typescript/src/ApiOverrides/index.d.ts +2 -1
  62. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  63. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  64. package/lib/typescript/src/Authenticator/api/index.d.ts +1 -0
  65. package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
  66. package/lib/typescript/src/Authenticator/index.d.ts.map +1 -1
  67. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  68. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  69. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts +2 -1
  70. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  71. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  72. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  73. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  74. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +6 -1
  75. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  76. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  77. package/lib/typescript/src/ProfileManager/api/index.d.ts +5 -1
  78. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  79. package/lib/typescript/src/ProfileManager/index.d.ts +6 -2
  80. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  81. package/package.json +1 -1
  82. package/src/ApiOverrides/index.ts +16 -4
  83. package/src/Authenticator/Components/StrategyForm.tsx +5 -2
  84. package/src/Authenticator/api/index.ts +2 -1
  85. package/src/Authenticator/api/types.d.ts +1 -0
  86. package/src/Authenticator/index.tsx +0 -1
  87. package/src/Components/Icons.tsx +15 -0
  88. package/src/ProfileManager/Components/BasicInfoManager.tsx +1 -1
  89. package/src/ProfileManager/Components/CodeRedeem.tsx +3 -2
  90. package/src/ProfileManager/Components/DOBManager.tsx +2 -1
  91. package/src/ProfileManager/Components/EmailManager.tsx +12 -4
  92. package/src/ProfileManager/Components/PhoneManager.tsx +7 -1
  93. package/src/ProfileManager/Components/ProfilePicManager.tsx +1 -1
  94. package/src/ProfileManager/Components/ProfileWizard.tsx +124 -54
  95. package/src/ProfileManager/Components/VouchCard.tsx +6 -5
  96. package/src/ProfileManager/api/index.ts +6 -2
  97. package/src/ProfileManager/api/types.d.ts +1 -1
  98. 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
- access_token:string,
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, walkthrough, access_token, width, onClose }: ProfileOverviewProps ) => {
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
- const player = await ProfileApi.getMyDetails();
32
- const pb = await ProfileApi.getMyBalance();
33
- setPlayerBalance(pb);
34
- setDraftPlayer(player);
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)}