be-components 5.3.2 → 5.3.4

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 (69) hide show
  1. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +2 -2
  2. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  3. package/lib/commonjs/ProfileManager/Components/BasicStatus.js +2 -2
  4. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  5. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +3 -3
  6. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  7. package/lib/commonjs/ProfileManager/Components/DOBManager.js +3 -3
  8. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  9. package/lib/commonjs/ProfileManager/Components/EmailManager.js +3 -3
  10. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  11. package/lib/commonjs/ProfileManager/Components/PasswordManager.js +3 -3
  12. package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
  13. package/lib/commonjs/ProfileManager/Components/PhoneManager.js +2 -2
  14. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  15. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +2 -2
  16. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  17. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js +2 -2
  18. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  19. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +5 -5
  20. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  21. package/lib/commonjs/ProfileManager/Components/SettingsManager.js +2 -2
  22. package/lib/commonjs/ProfileManager/Components/SettingsManager.js.map +1 -1
  23. package/lib/commonjs/ProfileManager/Components/VouchCard.js +2 -2
  24. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  25. package/lib/commonjs/ProfileManager/index.js +53 -38
  26. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  27. package/lib/module/ProfileManager/Components/BasicInfoManager.js +2 -2
  28. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  29. package/lib/module/ProfileManager/Components/BasicStatus.js +2 -2
  30. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  31. package/lib/module/ProfileManager/Components/CodeRedeem.js +3 -3
  32. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  33. package/lib/module/ProfileManager/Components/DOBManager.js +3 -3
  34. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  35. package/lib/module/ProfileManager/Components/EmailManager.js +3 -3
  36. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  37. package/lib/module/ProfileManager/Components/PasswordManager.js +3 -3
  38. package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
  39. package/lib/module/ProfileManager/Components/PhoneManager.js +2 -2
  40. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  41. package/lib/module/ProfileManager/Components/ProfilePicManager.js +2 -2
  42. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  43. package/lib/module/ProfileManager/Components/ProfileWelcome.js +2 -2
  44. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  45. package/lib/module/ProfileManager/Components/ProfileWizard.js +5 -5
  46. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  47. package/lib/module/ProfileManager/Components/SettingsManager.js +2 -2
  48. package/lib/module/ProfileManager/Components/SettingsManager.js.map +1 -1
  49. package/lib/module/ProfileManager/Components/VouchCard.js +2 -2
  50. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  51. package/lib/module/ProfileManager/index.js +54 -39
  52. package/lib/module/ProfileManager/index.js.map +1 -1
  53. package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts.map +1 -1
  54. package/lib/typescript/lib/module/ProfileManager/index.d.ts.map +1 -1
  55. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/ProfileManager/Components/BasicInfoManager.tsx +2 -2
  58. package/src/ProfileManager/Components/BasicStatus.tsx +2 -2
  59. package/src/ProfileManager/Components/CodeRedeem.tsx +3 -3
  60. package/src/ProfileManager/Components/DOBManager.tsx +3 -3
  61. package/src/ProfileManager/Components/EmailManager.tsx +3 -3
  62. package/src/ProfileManager/Components/PasswordManager.tsx +3 -3
  63. package/src/ProfileManager/Components/PhoneManager.tsx +2 -2
  64. package/src/ProfileManager/Components/ProfilePicManager.tsx +2 -2
  65. package/src/ProfileManager/Components/ProfileWelcome.tsx +2 -2
  66. package/src/ProfileManager/Components/ProfileWizard.tsx +5 -5
  67. package/src/ProfileManager/Components/SettingsManager.tsx +2 -2
  68. package/src/ProfileManager/Components/VouchCard.tsx +2 -2
  69. package/src/ProfileManager/index.tsx +52 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-components",
3
- "version": "5.3.2",
3
+ "version": "5.3.4",
4
4
  "description": "Components for BettorEdge Apps",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -61,8 +61,8 @@ const BasicInfoManager = ({ player, walkthrough, onFocusPosition, onPlayerUpdate
61
61
  const allow_next = username_valid.valid && !username_valid.loading && draft_player.first_name && draft_player.last_name ? true : false
62
62
 
63
63
  return (
64
- <View style={{ flexGrow:1 }}>
65
- <ScrollView style={{ flexGrow:1 }}>
64
+ <View style={{ flex:1 }}>
65
+ <ScrollView style={{ flex:1 }}>
66
66
  {walkthrough ?
67
67
  <View style={{ padding:20 }}>
68
68
  <Text size={30} theme='h1'>Let's start with the basics</Text>
@@ -31,8 +31,8 @@ const BasicStatus = ({ onVerify, code_details, player, onClose }:BasicStatusProp
31
31
  const errors = getStatus(player)
32
32
 
33
33
  return (
34
- <View style={{ flexGrow:1 }}>
35
- <ScrollView style={{ flexGrow:1 }}>
34
+ <View style={{ flex:1 }}>
35
+ <ScrollView style={{ flex:1 }}>
36
36
 
37
37
  <View style={{ justifyContent:'center', alignItems:'center' }}>
38
38
  <Image
@@ -85,10 +85,10 @@ const CodeRedeem = ({ walkthrough, onVerify, onClose, onRedeemCode, onFocusPosit
85
85
  const try_allowed = draft_code ? true : false
86
86
  const change_allowed = !loading && ProfileHelpers.isChangeCodeAllowed(code_request) ? true : false
87
87
  return (
88
- <TouchableWithoutFeedback style={{ flexGrow:1 }} onPress={() => Keyboard.dismiss()}>
88
+ <TouchableWithoutFeedback style={{ flex:1 }} onPress={() => Keyboard.dismiss()}>
89
89
 
90
- <View style={{ flexGrow:1 }}>
91
- <View style={{ flexGrow:1, padding:20 }}>
90
+ <View style={{ flex:1 }}>
91
+ <View style={{ flex:1, padding:20 }}>
92
92
  <View style={{ padding:20 }}>
93
93
  <Text size={30} theme='h1'>How Did You Find Us?</Text>
94
94
  <Text style={{ marginTop:15 }} size={16} theme='h2'>All new players are eligible for a one-time sign up bonus. Below is the code / referrer used during sign up.</Text>
@@ -83,13 +83,13 @@ const DOBManager = ({ player, walkthrough, onFocusPosition, onPlayerUpdate, onNe
83
83
 
84
84
 
85
85
  return (
86
- <View style={{ flexGrow:1 }}>
87
- <View style={{ flexGrow:1, justifyContent:'center'}}>
86
+ <View style={{ flex:1 }}>
87
+ <View style={{ flex:1, justifyContent:'center'}}>
88
88
  <View style={{ padding:20 }}>
89
89
  <Text size={30} theme='h1'>Date Of Birth</Text>
90
90
  <Text style={{ marginTop:15 }} size={16} theme='h2'>In order to participate in real-money gaming you must be over 18.</Text>
91
91
  </View>
92
- <View style={{ padding:30, flexGrow:1 }}>
92
+ <View style={{ padding:30, flex:1 }}>
93
93
  <View type='input' style={{flexDirection:'row', alignItems:'center' }}>
94
94
  <View transparent style={{ paddingLeft:15, paddingRight:15 }}>
95
95
  <Icons.BirthdayIcon
@@ -92,8 +92,8 @@ const EmailManager = ({ player, walkthrough, onFocusPosition, onPlayerUpdate, on
92
92
 
93
93
 
94
94
  return (
95
- <View style={{ flexGrow:1 }}>
96
- <View style={{ flexGrow:1 }}>
95
+ <View style={{ flex:1 }}>
96
+ <View style={{ flex:1 }}>
97
97
  <View style={{ padding:20 }}>
98
98
  <Text size={30} theme='h1'>Confirm Your Email</Text>
99
99
  <Text style={{ marginTop:15 }} size={16} theme='h2'>Confirming your email will help secure your account and is required for real-money activities</Text>
@@ -111,7 +111,7 @@ const EmailManager = ({ player, walkthrough, onFocusPosition, onPlayerUpdate, on
111
111
  value={draft_player.email}
112
112
  keyboardType='email-address'
113
113
  onFocusPosition={onFocusPosition}
114
- style={{ flexGrow:1 }}
114
+ style={{ flex:1 }}
115
115
  onChangeText={(text) => {
116
116
  if(update_error){ setUpdateError(undefined) }
117
117
  setDraftPlayer({ ...draft_player, email: text })
@@ -96,7 +96,7 @@ const PasswordManager = ({ player, walkthrough, onPlayerUpdate, onFocusPosition,
96
96
  }
97
97
 
98
98
  return (
99
- <View style={{ flexGrow:1}}>
99
+ <View style={{ flex:1}}>
100
100
  {walkthrough ?
101
101
  <View style={{ padding:20 }}>
102
102
  <Text size={30} theme='h1'>Secure Your Account</Text>
@@ -104,7 +104,7 @@ const PasswordManager = ({ player, walkthrough, onPlayerUpdate, onFocusPosition,
104
104
  </View>
105
105
  :<></>}
106
106
  {draft_player.no_password || change_visible ?
107
- <View style={{ flexGrow:1, padding:20 }}>
107
+ <View style={{ flex:1, padding:20 }}>
108
108
  {!draft_player.no_password ?
109
109
  <View type='input' style={{ margin:10, flexDirection:'row', alignItems:'center' }}>
110
110
  <View transparent style={{ paddingLeft:15, paddingRight:15 }}>
@@ -161,7 +161,7 @@ const PasswordManager = ({ player, walkthrough, onPlayerUpdate, onFocusPosition,
161
161
 
162
162
  </View>
163
163
  :
164
- <View style={{ flexGrow:1, justifyContent:'center', alignItems:'center', padding:10 }}>
164
+ <View style={{ flex:1, justifyContent:'center', alignItems:'center', padding:10 }}>
165
165
  <View float style={{ borderRadius:8, backgroundColor:C.views.background, justifyContent:'center', alignItems:'center', padding:30 }}>
166
166
 
167
167
  <Text style={{ marginBottom:30 }} size={24} theme='h1'>Password Set</Text>
@@ -98,8 +98,8 @@ const PhoneManager = ({ player, walkthrough, onPlayerUpdate, onFocusPosition, on
98
98
 
99
99
 
100
100
  return (
101
- <View style={{ flexGrow:1 }}>
102
- <View style={{ flexGrow:1 }}>
101
+ <View style={{ flex:1 }}>
102
+ <View style={{ flex:1 }}>
103
103
  <View style={{ padding:20 }}>
104
104
  <Text size={30} theme='h1'>Confirm Your Phone Number</Text>
105
105
  <Text style={{ marginTop:15 }} size={16} theme='h2'>Confirming your phone number will help secure your account and is required for real-money activities</Text>
@@ -28,8 +28,8 @@ const ProfilePicManager = ({ player, onPlayerUpdate, walkthrough, onNext, onClos
28
28
 
29
29
 
30
30
  return (
31
- <View style={{ flexGrow:1 }}>
32
- <ScrollView style={{ flexGrow:1 }}>
31
+ <View style={{ flex:1 }}>
32
+ <ScrollView style={{ flex:1 }}>
33
33
  {walkthrough ?
34
34
  <View style={{ padding:20 }}>
35
35
  <Text size={30} theme='h1'>Update Your Picture</Text>
@@ -23,8 +23,8 @@ const ProfileWelcome = ({ player, code_details, onStartSetup, onClose }:ProfileW
23
23
  const C = useColors();
24
24
  const { code_request, promo, referrer } = code_details;
25
25
  return (
26
- <View style={{ flexGrow:1 }}>
27
- <ScrollView style={{ flexGrow:1 }}>
26
+ <View style={{ flex:1 }}>
27
+ <ScrollView style={{ flex:1 }}>
28
28
  <View style={{ padding:20 }}>
29
29
  <Text size={30} theme='h2'>Welcome @{player.username}!</Text>
30
30
  <Text style={{ marginTop:15 }} size={16} theme='h2'>We are so glad that you found us! Use the setup wizard to complete your account setup.</Text>
@@ -302,10 +302,10 @@ const ProfileWizard = ({ player, view_mode, hide_powered_by, settings, player_s
302
302
 
303
303
 
304
304
  return (
305
- <View style={{ flexGrow:1 }}>
305
+ <View style={{ flex:1 }}>
306
306
  {!active_level && !show_code_request ?
307
- <View transparent style={{ flexGrow:1 }}>
308
- <View style={{ flexGrow:1 }}>
307
+ <View transparent style={{ flex:1 }}>
308
+ <View style={{ flex:1 }}>
309
309
  <FlatList
310
310
  data={groups}
311
311
  renderItem={renderGroups}
@@ -362,7 +362,7 @@ const ProfileWizard = ({ player, view_mode, hide_powered_by, settings, player_s
362
362
  :<></>}
363
363
  </View>
364
364
  :
365
- <View style={{ flexGrow:1 }}>
365
+ <View style={{ flex:1 }}>
366
366
  {!walkthrough && active_level ?
367
367
  <TouchableOpacity style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopWidth:2, borderColor:C.borders.light}} onPress={() => {
368
368
  setActiveLevel(undefined)
@@ -396,7 +396,7 @@ const ProfileWizard = ({ player, view_mode, hide_powered_by, settings, player_s
396
396
  </View>
397
397
  :<></>}
398
398
  </View>
399
- <View style={{ flexGrow:1 }}>
399
+ <View style={{ flex:1 }}>
400
400
  {!active_step && show_code_request ?
401
401
  <CodeRedeem
402
402
  walkthrough={false}
@@ -128,8 +128,8 @@ const SettingsManager = ({ player, title, description, icon, settings, player_se
128
128
  }
129
129
 
130
130
  return (
131
- <View style={{ flexGrow:1 }}>
132
- <ScrollView style={{ flexGrow:1 }}>
131
+ <View style={{ flex:1 }}>
132
+ <ScrollView style={{ flex:1 }}>
133
133
  <View nativeID='preference_settings' style={{ padding:10 }}>
134
134
  <View nativeID='header' style={{ flexDirection:'row', alignItems:'center' }}>
135
135
  <View float style={{ padding:10, borderRadius:8 }}>
@@ -205,8 +205,8 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
205
205
  }
206
206
 
207
207
  return (
208
- <View style={{ flexGrow:1 }}>
209
- <View style={{ flexGrow:1 }}>
208
+ <View style={{ flex:1 }}>
209
+ <View style={{ flex:1 }}>
210
210
  <FlatList
211
211
  data={sections}
212
212
  key={'vouch_sections'}
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Image, ActivityIndicator } from 'react-native';
2
+ import { Image, ActivityIndicator, FlatList } from 'react-native';
3
3
  import Colors from '../constants/colors';
4
4
  import ProfileWizard from './Components/ProfileWizard';
5
5
  import { ProfileApi } from './api';
@@ -9,7 +9,6 @@ import { Text, View } from '../Components/Themed';
9
9
 
10
10
  type ProfileOverviewProps = {
11
11
  show_welcome?:boolean,
12
- //access_token:string,
13
12
  hide_powered_by?:boolean,
14
13
  hide_profile_header?:boolean,
15
14
  player?:MyPlayerProps,
@@ -70,11 +69,9 @@ const ProfileManager = ({ profile_attribute, view_mode, hide_profile_header, ins
70
69
  } catch (e) {
71
70
  console.log(e)
72
71
  }
73
-
74
72
  setLoading(false);
75
73
  }
76
74
 
77
-
78
75
  const handleLogout = () => {
79
76
  setDraftPlayer(undefined);
80
77
  setPlayerBalance(undefined);
@@ -82,20 +79,60 @@ const ProfileManager = ({ profile_attribute, view_mode, hide_profile_header, ins
82
79
  onClose()
83
80
  }
84
81
 
82
+ const renderProfile = (data:{ item:string, index:number }) => {
83
+ switch(data.item){
84
+ case 'profile':
85
+ if(!draft_player){ return <></> }
86
+ return (
87
+ <ProfileWizard
88
+ player={draft_player}
89
+ player_settings={player_settings}
90
+ onVouching={(active) => {
91
+ if(active && onVouchStart){ onVouchStart() }
92
+ setVouching(active)
93
+ }}
94
+ width={width}
95
+ onRedeemCode={onRedeemCode}
96
+ settings={settings}
97
+ insets={insets}
98
+ view_mode={view_mode}
99
+ show_welcome={show_welcome}
100
+ onFocusPosition={onFocusPosition}
101
+ hide_powered_by={hide_powered_by}
102
+ hidden_groups={hidden_groups}
103
+ hidden_steps={hidden_steps}
104
+ hidden_levels={hidden_levels}
105
+ init_walkthrough={walkthrough}
106
+ onNextStep={(step:string) => onNextStep ? onNextStep(step) : console.log()}
107
+ onClose={() => onClose()}
108
+ onLogout={() => handleLogout()}
109
+ profile_attribute={profile_attribute}
110
+ onSelectLevel={(level) => console.log(level)}
111
+ onUpdatePlayerSetting={(new_ps) => setPlayerSettings(player_settings.filter(ps => ps.player_setting_id != new_ps.player_setting_id).concat(new_ps))}
112
+ onPlayerUpdate={(player, attribute) => {
113
+ setDraftPlayer(player)
114
+ if(onPlayerUpdate){ onPlayerUpdate(player, attribute) }
115
+ }}
116
+ />
117
+ )
118
+ default: return <></>
119
+ }
120
+ }
121
+
85
122
  if(!draft_player || loading){
86
123
  return (
87
- <View style={{ flexGrow:1 }}>
124
+ <View style={{ flex:1 }}>
88
125
  <ActivityIndicator size={'large'} color={Colors.brand.midnight} />
89
126
  </View>
90
127
  )
91
128
  }
92
129
 
93
130
  return (
94
- <View style={{ flexGrow:1 }} onLayout={(ev) => {
131
+ <View style={{ flex:1 }} onLayout={(ev) => {
95
132
  const { width } = ev.nativeEvent.layout
96
133
  setModuleWidth(width)
97
134
  }}>
98
- <View style={{ flexGrow:1 }}>
135
+ <View style={{ flex:1 }}>
99
136
  {!hide_profile_header && !walkthrough && !vouching ?
100
137
  <View style={{ flexDirection:'row', alignItems:'center' }}>
101
138
  <View nativeID='profile_picture' style={{ padding:10 }}>
@@ -117,38 +154,15 @@ const ProfileManager = ({ profile_attribute, view_mode, hide_profile_header, ins
117
154
  :<></>}
118
155
  </View>
119
156
  :<></>}
120
- <View style={{ marginTop:10, flexGrow:1 }}>
121
- <ProfileWizard
122
- player={draft_player}
123
- player_settings={player_settings}
124
- onVouching={(active) => {
125
- if(active && onVouchStart){ onVouchStart() }
126
- setVouching(active)
127
- }}
128
- width={width}
129
- onRedeemCode={onRedeemCode}
130
- settings={settings}
131
- insets={insets}
132
- view_mode={view_mode}
133
- show_welcome={show_welcome}
134
- onFocusPosition={onFocusPosition}
135
- hide_powered_by={hide_powered_by}
136
- hidden_groups={hidden_groups}
137
- hidden_steps={hidden_steps}
138
- hidden_levels={hidden_levels}
139
- init_walkthrough={walkthrough}
140
- onNextStep={(step:string) => onNextStep ? onNextStep(step) : console.log()}
141
- onClose={() => onClose()}
142
- onLogout={() => handleLogout()}
143
- profile_attribute={profile_attribute}
144
- onSelectLevel={(level) => console.log(level)}
145
- onUpdatePlayerSetting={(new_ps) => setPlayerSettings(player_settings.filter(ps => ps.player_setting_id != new_ps.player_setting_id).concat(new_ps))}
146
- onPlayerUpdate={(player, attribute) => {
147
- setDraftPlayer(player)
148
- if(onPlayerUpdate){ onPlayerUpdate(player, attribute) }
149
- }}
150
- />
157
+ <View style={{ flex:1 }}>
158
+ <FlatList
159
+ data={['profile']}
160
+ key={'profile_list'}
161
+ keyExtractor={item => item}
162
+ renderItem={renderProfile}
163
+ />
151
164
  </View>
165
+
152
166
  </View>
153
167
  </View>
154
168
  )