be-components 0.3.2 → 0.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 (108) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +4 -0
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/Components/Icons.js +50 -0
  4. package/lib/commonjs/Components/Icons.js.map +1 -1
  5. package/lib/commonjs/Components/ImageUploader.js +10 -1
  6. package/lib/commonjs/Components/ImageUploader.js.map +1 -1
  7. package/lib/commonjs/Components/LinearDiagnal.js +82 -0
  8. package/lib/commonjs/Components/LinearDiagnal.js.map +1 -0
  9. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +81 -32
  10. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  11. package/lib/commonjs/ProfileManager/Components/BasicStatus.js +89 -20
  12. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  13. package/lib/commonjs/ProfileManager/Components/DOBManager.js +55 -33
  14. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  15. package/lib/commonjs/ProfileManager/Components/EmailManager.js +69 -34
  16. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  17. package/lib/commonjs/ProfileManager/Components/PasswordManager.js +47 -25
  18. package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
  19. package/lib/commonjs/ProfileManager/Components/PhoneManager.js +70 -35
  20. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  21. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +45 -29
  22. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  23. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js +59 -17
  24. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  25. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +57 -30
  26. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  27. package/lib/commonjs/ProfileManager/Components/VouchCard.js +15 -23
  28. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  29. package/lib/commonjs/ProfileManager/api/index.js +1 -1
  30. package/lib/commonjs/ProfileManager/index.js +5 -2
  31. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  32. package/lib/commonjs/constants/styles.js +21 -1
  33. package/lib/commonjs/constants/styles.js.map +1 -1
  34. package/lib/module/ApiOverrides/index.js +4 -0
  35. package/lib/module/ApiOverrides/index.js.map +1 -1
  36. package/lib/module/Components/Icons.js +50 -0
  37. package/lib/module/Components/Icons.js.map +1 -1
  38. package/lib/module/Components/ImageUploader.js +10 -1
  39. package/lib/module/Components/ImageUploader.js.map +1 -1
  40. package/lib/module/Components/LinearDiagnal.js +74 -0
  41. package/lib/module/Components/LinearDiagnal.js.map +1 -0
  42. package/lib/module/ProfileManager/Components/BasicInfoManager.js +82 -33
  43. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  44. package/lib/module/ProfileManager/Components/BasicStatus.js +90 -21
  45. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  46. package/lib/module/ProfileManager/Components/DOBManager.js +56 -34
  47. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  48. package/lib/module/ProfileManager/Components/EmailManager.js +71 -36
  49. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  50. package/lib/module/ProfileManager/Components/PasswordManager.js +48 -26
  51. package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
  52. package/lib/module/ProfileManager/Components/PhoneManager.js +72 -37
  53. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  54. package/lib/module/ProfileManager/Components/ProfilePicManager.js +45 -31
  55. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  56. package/lib/module/ProfileManager/Components/ProfileWelcome.js +60 -18
  57. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  58. package/lib/module/ProfileManager/Components/ProfileWizard.js +57 -30
  59. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  60. package/lib/module/ProfileManager/Components/VouchCard.js +15 -23
  61. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  62. package/lib/module/ProfileManager/api/index.js +1 -1
  63. package/lib/module/ProfileManager/index.js +5 -2
  64. package/lib/module/ProfileManager/index.js.map +1 -1
  65. package/lib/module/constants/styles.js +20 -0
  66. package/lib/module/constants/styles.js.map +1 -1
  67. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  68. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  69. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  70. package/lib/typescript/src/Components/ImageUploader.d.ts +1 -1
  71. package/lib/typescript/src/Components/ImageUploader.d.ts.map +1 -1
  72. package/lib/typescript/src/Components/LinearDiagnal.d.ts +14 -0
  73. package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -0
  74. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  75. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +9 -2
  76. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  77. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  78. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  79. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  80. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  81. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  82. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +9 -2
  83. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  84. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +5 -2
  85. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  86. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  87. package/lib/typescript/src/ProfileManager/index.d.ts +5 -2
  88. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  89. package/lib/typescript/src/constants/styles.d.ts +26 -0
  90. package/lib/typescript/src/constants/styles.d.ts.map +1 -1
  91. package/package.json +1 -1
  92. package/src/ApiOverrides/index.ts +4 -0
  93. package/src/Components/Icons.tsx +21 -0
  94. package/src/Components/ImageUploader.tsx +4 -3
  95. package/src/Components/LinearDiagnal.tsx +52 -0
  96. package/src/ProfileManager/Components/BasicInfoManager.tsx +110 -76
  97. package/src/ProfileManager/Components/BasicStatus.tsx +55 -24
  98. package/src/ProfileManager/Components/DOBManager.tsx +46 -28
  99. package/src/ProfileManager/Components/EmailManager.tsx +48 -33
  100. package/src/ProfileManager/Components/PasswordManager.tsx +36 -18
  101. package/src/ProfileManager/Components/PhoneManager.tsx +82 -66
  102. package/src/ProfileManager/Components/ProfilePicManager.tsx +38 -23
  103. package/src/ProfileManager/Components/ProfileWelcome.tsx +33 -14
  104. package/src/ProfileManager/Components/ProfileWizard.tsx +72 -21
  105. package/src/ProfileManager/Components/VouchCard.tsx +8 -11
  106. package/src/ProfileManager/api/index.ts +1 -1
  107. package/src/ProfileManager/index.tsx +8 -4
  108. package/src/constants/styles.ts +9 -0
@@ -1,10 +1,10 @@
1
1
 
2
2
  import React, { useEffect, useState } from 'react';
3
- import { View, ActivityIndicator } from 'react-native';
3
+ import { View, ActivityIndicator, TouchableOpacity } from 'react-native';
4
4
  import { Button, Icons, Text, TextInput } from '../../Components';
5
5
  import Colors from '../../constants/colors';
6
6
  import type { MyPlayerProps } from '../api/types';
7
- import { view_styles } from '../../constants/styles';
7
+ import { button_styles, view_styles } from '../../constants/styles';
8
8
  import { ProfileApi, ProfileHelpers } from '../api';
9
9
 
10
10
 
@@ -36,6 +36,7 @@ const EmailManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:E
36
36
  const is_changed = draft_player.email?.toLowerCase() != player.email?.toLowerCase() ? true : false
37
37
  const token_valid = verify_token.token != '' ? true : false
38
38
  const update_allowed = valid && is_changed ? true : false
39
+
39
40
  const handleUpdatePlayer = async() => {
40
41
  try {
41
42
  setLoading(true);
@@ -55,6 +56,12 @@ const EmailManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:E
55
56
  }
56
57
  }
57
58
 
59
+ const handleNext = async() => {
60
+ if(valid && !update_allowed){ return onNext() }
61
+ if(!update_allowed){ return }
62
+ await handleUpdatePlayer()
63
+ }
64
+
58
65
  const handleVerifyEmail = async() => {
59
66
  try {
60
67
  setVerifyToken({ ...verify_token, loading:true });
@@ -66,7 +73,7 @@ const EmailManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:E
66
73
  visible:false,
67
74
  token: ''
68
75
  })
69
- if(onNext){ onNext() }
76
+ if(walkthrough){ onNext() } else { onClose() }
70
77
  }, 1000);
71
78
  onPlayerUpdate(player)
72
79
  } catch (e) {
@@ -82,12 +89,12 @@ const EmailManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:E
82
89
 
83
90
  return (
84
91
  <View style={{ flex:1 }}>
85
- <View style={{ flex:1 }}>
86
- <View style={{ padding:10 }}>
87
- <Text weight='bold' size={16} textAlign='left' color={Colors.brand.midnight}>My Email Address</Text>
88
- <Text style={{ marginTop:5 }} color={Colors.brand.midnight} size={14} textAlign='left'>A valid email is required to verify your account</Text>
92
+ <View style={{ flex:1 }}>
93
+ <View style={{ padding:20 }}>
94
+ <Text size={30} color={Colors.brand.midnight} weight='bold'>Confirm Your Email</Text>
95
+ <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Confirming your email will help secure your account and is required for real-money activities</Text>
89
96
  </View>
90
- <View style={{ padding:10 }}>
97
+ <View style={{ padding:30 }}>
91
98
  <View style={{ backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
92
99
  <View style={{ paddingLeft:15, paddingRight:15 }}>
93
100
  <Icons.EmailIcon
@@ -121,46 +128,54 @@ const EmailManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:E
121
128
  </View>
122
129
  </View>
123
130
  {error ?
124
- <Text size={14} color={Colors.utility.warning}>{error}</Text>
131
+ <Text style={{ marginTop:10 }} size={14} color={Colors.utility.warning} weight='semibold' textAlign='center'>{error}</Text>
125
132
  :<></>}
126
133
  {update_error ?
127
- <Text size={14} color={Colors.utility.warning}>{update_error}</Text>
134
+ <Text style={{ marginTop:10 }} size={14} color={Colors.utility.warning} weight='semibold' textAlign='center'>{update_error}</Text>
128
135
  :<></>}
129
136
  </View>
130
- </View>
131
-
132
-
133
- <View nativeID='action_row' style={{ flexDirection:'row', padding:10 }}>
137
+ </View>
138
+ {walkthrough ?
139
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
140
+ <Button
141
+ title='EXIT SETUP'
142
+ title_color={Colors.utility.error}
143
+ backgroundColor='transparent'
144
+ onPress={() => onClose()}
145
+ />
146
+ <TouchableOpacity
147
+ style={valid && !loading ? button_styles.wizard_valid : button_styles.wizard_invalid}
148
+ disabled={!valid || loading}
149
+ onPress={() => handleNext()}
150
+ >
151
+ <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
152
+ </TouchableOpacity>
153
+ </View>
154
+ :
155
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
134
156
  <Button
135
- title={walkthrough ? 'SKIP' : 'CLOSE'}
136
157
  style={{ flex:1, marginRight:5 }}
137
- borderColor={Colors.brand.electric}
158
+ title='BACK'
159
+ padding={15}
138
160
  title_color={Colors.brand.electric}
139
161
  borderWidth={1}
140
- padding={15}
141
- onPress={() => walkthrough ? onNext() : onClose()}
162
+ borderColor={Colors.brand.electric}
163
+ onPress={() => onClose()}
142
164
  />
143
- {!is_changed && player.verified ?
144
165
  <Button
145
- title='CONFIRM MY PHONE'
146
- style={{ flex:3 }}
166
+ style={{ flex:3, opacity:valid && !loading && update_allowed ? 1:0.5 }}
167
+ disabled={!valid || loading || !update_allowed}
168
+ loading={loading}
169
+ title='UPDATE'
147
170
  padding={15}
148
- backgroundColor={Colors.utility.success}
149
171
  title_color={Colors.shades.white}
150
- onPress={() => onNext()}
151
- />
152
- :
153
- <Button
154
- title='NEXT'
155
- style={{ flex:3, opacity:update_allowed ? 1 : 0.5 }}
156
- padding={15}
157
- disabled={!update_allowed}
158
172
  backgroundColor={Colors.utility.success}
159
- title_color={Colors.shades.white}
160
- onPress={() => handleUpdatePlayer()}
173
+ onPress={async() => {
174
+ await handleUpdatePlayer()
175
+ }}
161
176
  />
162
- }
163
177
  </View>
178
+ }
164
179
  {verify_token.visible ?
165
180
  <View style={{ position:'absolute', top:0, left:0, right:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
166
181
  <View style={{ padding:20, backgroundColor:Colors.shades.white, borderRadius:8, ...view_styles.float }}>
@@ -1,9 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, FlatList } from 'react-native';
2
+ import { View, FlatList, TouchableOpacity } from 'react-native';
3
3
  import { Button, Icons, Text, TextInput } from '../../Components';
4
4
  import type { MyPlayerProps, PasswordStateProps } from '../api/types';
5
5
  import Colors from '../../constants/colors';
6
6
  import { ProfileApi, ProfileHelpers } from '../api';
7
+ import { button_styles } from '../../constants/styles';
7
8
 
8
9
  type PasswordManagerProps = {
9
10
  player:MyPlayerProps,
@@ -23,7 +24,7 @@ const PasswordManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose
23
24
  re_password: ''
24
25
  })
25
26
 
26
- const { loading, change_visible, password, re_password, current_password } = draft_password;
27
+ const { change_visible, password, re_password, current_password } = draft_password;
27
28
 
28
29
  useEffect(() => {
29
30
  setDraftPlayer(player)
@@ -85,18 +86,18 @@ const PasswordManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose
85
86
  onPlayerUpdate(player);
86
87
  setTimeout(() => {
87
88
  setDraftPassword({ current_password:'', change_visible: false, loading:false, password: '', re_password: '' })
88
- if(walkthrough){ onNext() }
89
+ if(walkthrough){ onNext() } else { onClose() }
89
90
  }, 500);
90
91
  }
91
92
 
92
93
  return (
93
94
  <View style={{ flex:1 }}>
95
+ <View style={{ padding:20 }}>
96
+ <Text size={30} color={Colors.brand.midnight} weight='bold'>Secure Your Account</Text>
97
+ <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Help up secure your account with a password. Once set, you can login using your username and password</Text>
98
+ </View>
94
99
  {draft_player.no_password || change_visible ?
95
- <View style={{ flex:1 }}>
96
- <View style={{ padding:10 }}>
97
- <Text weight='bold' size={16} textAlign='left' color={Colors.brand.midnight}>{draft_player.no_password ? 'SET MY PASSWORD': 'CHANGE MY PASSWORD'}</Text>
98
- <Text style={{ marginTop:5 }} color={Colors.brand.midnight} size={14} textAlign='left'>Help up secure your account with a password. Once set, you can login using your username and password</Text>
99
- </View>
100
+ <View style={{ flex:1, padding:20 }}>
100
101
  {!draft_player.no_password ?
101
102
  <View style={{ margin:10, backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
102
103
  <View style={{ paddingLeft:15, paddingRight:15 }}>
@@ -170,27 +171,44 @@ const PasswordManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose
170
171
  </View>
171
172
  </View>
172
173
  }
173
- <View nativeID='action_row' style={{ flexDirection:'row', padding:10 }}>
174
+ {walkthrough ?
175
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
176
+ <Button
177
+ title='EXIT SETUP'
178
+ title_color={Colors.utility.error}
179
+ backgroundColor='transparent'
180
+ onPress={() => onClose()}
181
+ />
182
+ <TouchableOpacity
183
+ disabled={!is_valid}
184
+ style={is_valid?button_styles.wizard_valid:button_styles.wizard_invalid}
185
+ onPress={() => handleSetPassword()}
186
+ >
187
+ <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
188
+ </TouchableOpacity>
189
+ </View>
190
+ :
191
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
174
192
  <Button
175
- title={walkthrough ? 'SKIP' : 'CLOSE'}
176
193
  style={{ flex:1, marginRight:5 }}
177
- borderColor={Colors.brand.electric}
194
+ title='BACK'
195
+ padding={15}
178
196
  title_color={Colors.brand.electric}
179
197
  borderWidth={1}
180
- padding={15}
181
- onPress={() => walkthrough ? onNext() : onClose()}
198
+ borderColor={Colors.brand.electric}
199
+ onPress={() => onClose()}
182
200
  />
183
201
  <Button
184
- title={'NEXT'}
185
- style={{ flex:3, opacity:is_valid ? 1 : 0.5 }}
202
+ style={{ flex:3, opacity:is_valid && password?1:0.5 }}
203
+ disabled={!is_valid || !password}
204
+ title='UPDATE'
186
205
  padding={15}
187
- loading={loading}
188
- disabled={!is_valid}
189
- backgroundColor={Colors.utility.success}
190
206
  title_color={Colors.shades.white}
207
+ backgroundColor={Colors.utility.success}
191
208
  onPress={() => handleSetPassword()}
192
209
  />
193
210
  </View>
211
+ }
194
212
  </View>
195
213
  )
196
214
  }
@@ -1,10 +1,10 @@
1
1
 
2
2
  import React, { useEffect, useState } from 'react';
3
- import { View, ActivityIndicator } from 'react-native';
3
+ import { View, ActivityIndicator, TouchableOpacity } from 'react-native';
4
4
  import { Button, Icons, Text, TextInput } from '../../Components';
5
5
  import Colors from '../../constants/colors';
6
6
  import type { MyPlayerProps } from '../api/types';
7
- import { view_styles } from '../../constants/styles';
7
+ import { button_styles, view_styles } from '../../constants/styles';
8
8
  import { ProfileApi, ProfileHelpers } from '../api';
9
9
 
10
10
 
@@ -61,6 +61,12 @@ const PhoneManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:P
61
61
  }
62
62
  }
63
63
 
64
+ const handleNext = async() => {
65
+ if(valid && !update_allowed){ return onNext() }
66
+ if(!update_allowed){ return }
67
+ await handleUpdatePlayer()
68
+ }
69
+
64
70
  const handleVerifyPhone = async() => {
65
71
  try {
66
72
  setVerifyToken({ ...verify_token, loading:true });
@@ -72,7 +78,7 @@ const PhoneManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:P
72
78
  visible:false,
73
79
  token: ''
74
80
  })
75
- if(onNext){ onNext() }
81
+ if(walkthrough){ onNext() } else { onClose() }
76
82
  }, 1000);
77
83
  onPlayerUpdate(player)
78
84
  } catch (e) {
@@ -90,80 +96,90 @@ const PhoneManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:P
90
96
  return (
91
97
  <View style={{ flex:1 }}>
92
98
  <View style={{ flex:1 }}>
93
- <View style={{ padding:10 }}>
94
- <Text weight='bold' size={16} textAlign='left' color={Colors.brand.midnight}>My Phone Number</Text>
95
- <Text style={{ marginTop:5 }} color={Colors.brand.midnight} size={14} textAlign='left'>A valid phone number is required to verify your account</Text>
99
+ <View style={{ padding:20 }}>
100
+ <Text size={30} color={Colors.brand.midnight} weight='bold'>Confirm Your Phone Number</Text>
101
+ <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Confirming your phone number will help secure your account and is required for real-money activities</Text>
96
102
  </View>
97
- <View style={{ padding:10 }}>
103
+ <View style={{ padding:30 }}>
98
104
 
99
- <View style={{ backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
100
- <View style={{ paddingLeft:15, paddingRight:15 }}>
101
- <Icons.PhoneIcon
102
- color={Colors.brand.midnight}
103
- size={18}
105
+ <View style={{ backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
106
+ <View style={{ paddingLeft:15, paddingRight:15 }}>
107
+ <Icons.PhoneIcon
108
+ color={Colors.brand.midnight}
109
+ size={18}
110
+ />
111
+ </View>
112
+ <TextInput
113
+ value={ProfileHelpers.formatPhone(draft_player.phone)}
114
+ keyboardType='phone-pad'
115
+ style={{ flex:1, borderRadius:0 }}
116
+ onChangeText={(text) => handlePhoneChange(text)}
104
117
  />
105
- </View>
106
- <TextInput
107
- value={ProfileHelpers.formatPhone(draft_player.phone)}
108
- keyboardType='phone-pad'
109
- style={{ flex:1, borderRadius:0 }}
110
- onChangeText={(text) => handlePhoneChange(text)}
111
- />
112
- <View style={{ paddingLeft:15, paddingRight:15 }}>
113
- {loading ?
114
- <ActivityIndicator size='small' color={Colors.brand.midnight}/>
115
- :
116
- <View>
117
- { valid ?
118
- <Icons.CheckIcon size={16} color={Colors.utility.success} />
119
- : verify_token.visible ?
120
- <Icons.AlertIcon size={16} color={Colors.utility.warning} />
118
+ <View style={{ paddingLeft:15, paddingRight:15 }}>
119
+ {loading ?
120
+ <ActivityIndicator size='small' color={Colors.brand.midnight}/>
121
121
  :
122
- <Icons.CloseIcon size={14} color={Colors.utility.error} />
122
+ <View>
123
+ { valid ?
124
+ <Icons.CheckIcon size={16} color={Colors.utility.success} />
125
+ : verify_token.visible ?
126
+ <Icons.AlertIcon size={16} color={Colors.utility.warning} />
127
+ :
128
+ <Icons.CloseIcon size={14} color={Colors.utility.error} />
129
+ }
130
+ </View>
123
131
  }
124
132
  </View>
125
- }
126
133
  </View>
134
+ {error ?
135
+ <Text style={{ marginTop:10 }} size={14} color={Colors.utility.warning} weight='semibold' textAlign='center'>{error}</Text>
136
+ :<></>}
137
+ {update_error ?
138
+ <Text style={{ marginTop:10 }} size={14} color={Colors.utility.warning} weight='semibold' textAlign='center'>{update_error}</Text>
139
+ :<></>}
127
140
  </View>
128
- </View>
129
- {error ?
130
- <Text size={14} color={Colors.utility.warning}>{error}</Text>
131
- :<></>}
132
- {update_error ?
133
- <Text size={14} color={Colors.utility.warning}>{update_error}</Text>
134
- :<></>}
135
141
  </View>
136
- <View nativeID='action_row' style={{ flexDirection:'row', padding:10 }}>
137
- <Button
138
- title={walkthrough ? 'SKIP' : 'CLOSE'}
139
- style={{ flex:1, marginRight:5 }}
140
- borderColor={Colors.brand.electric}
141
- title_color={Colors.brand.electric}
142
- borderWidth={1}
143
- padding={15}
144
- onPress={() => walkthrough ? onNext() : onClose()}
145
- />
146
- {!is_changed && player.phone_verified ?
147
- <Button
148
- title='SET MY DATE OF BIRTH'
149
- style={{ flex:3 }}
150
- padding={15}
151
- backgroundColor={Colors.utility.success}
152
- title_color={Colors.shades.white}
153
- onPress={() => onNext()}
154
- />
142
+ {walkthrough ?
143
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
144
+ <Button
145
+ title='EXIT SETUP'
146
+ title_color={Colors.utility.error}
147
+ backgroundColor='transparent'
148
+ onPress={() => onClose()}
149
+ />
150
+ <TouchableOpacity
151
+ style={valid && !loading ? button_styles.wizard_valid : button_styles.wizard_invalid}
152
+ disabled={!valid || loading}
153
+ onPress={() => handleNext()}
154
+ >
155
+ <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
156
+ </TouchableOpacity>
157
+ </View>
155
158
  :
156
- <Button
157
- title='UPDATE'
158
- style={{ flex:3, opacity:update_allowed ? 1 : 0.5 }}
159
- padding={15}
160
- disabled={!update_allowed}
161
- backgroundColor={Colors.utility.success}
162
- title_color={Colors.shades.white}
163
- onPress={() => handleUpdatePlayer()}
164
- />
159
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
160
+ <Button
161
+ style={{ flex:1, marginRight:5 }}
162
+ title='BACK'
163
+ padding={15}
164
+ title_color={Colors.brand.electric}
165
+ borderWidth={1}
166
+ borderColor={Colors.brand.electric}
167
+ onPress={() => onClose()}
168
+ />
169
+ <Button
170
+ style={{ flex:3, opacity:valid && !loading && update_allowed ? 1:0.5 }}
171
+ disabled={!valid || loading || !update_allowed}
172
+ loading={loading}
173
+ title='UPDATE'
174
+ padding={15}
175
+ title_color={Colors.shades.white}
176
+ backgroundColor={Colors.utility.success}
177
+ onPress={async() => {
178
+ await handleUpdatePlayer()
179
+ }}
180
+ />
181
+ </View>
165
182
  }
166
- </View>
167
183
  {verify_token.visible ?
168
184
  <View style={{ position:'absolute', top:0, left:0, right:0, bottom:0, backgroundColor:Colors.shades.black_faded, justifyContent:'center', alignItems:'center' }}>
169
185
  <View style={{ padding:20, backgroundColor:Colors.shades.white, borderRadius:8, ...view_styles.float }}>
@@ -1,32 +1,37 @@
1
- import React from 'react';
2
- import { Image, View, ScrollView } from "react-native"
1
+ import React, { useState } from 'react';
2
+ import { Image, View, ScrollView, TouchableOpacity } from "react-native"
3
3
  import type { MyPlayerProps } from "../api/types"
4
- import { Button, Text } from '../../Components';
4
+ import { Button, Icons, Text } from '../../Components';
5
5
  import ImageUploader from '../../Components/ImageUploader';
6
6
  import Colors from '../../constants/colors';
7
7
  import { ProfileApi } from '../api';
8
+ import { button_styles } from '../../constants/styles';
8
9
 
9
10
  type ProfilePicManagerProps = {
10
- player:MyPlayerProps,
11
+ player:MyPlayerProps,
11
12
  walkthrough?:boolean,
12
13
  onClose:() => void,
13
14
  onNext:() => void,
14
15
  onPlayerUpdate:(player:MyPlayerProps) => void
15
16
  }
16
17
 
18
+
17
19
  const ProfilePicManager = ({ player, onPlayerUpdate, walkthrough, onNext, onClose }:ProfilePicManagerProps) => {
20
+ const [ loading, setLoading ] = useState(false);
18
21
 
19
22
  const handleUpdatePic = async(profile_pic:string) => {
20
23
  const new_player = await ProfileApi.updatePlayerPic(profile_pic)
24
+ setLoading(false);
21
25
  onPlayerUpdate(new_player)
22
26
  }
23
27
 
28
+
24
29
  return (
25
30
  <View style={{ flex:1 }}>
26
31
  <ScrollView style={{ flex:1 }}>
27
- <View style={{ padding:10 }}>
28
- <Text size={16} weight='bold' color={Colors.brand.midnight}>MY PROFILE PICTURE</Text>
29
- <Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight}>Your profile picture is how users will see you in leaderboards and activity feeds.</Text>
32
+ <View style={{ padding:20 }}>
33
+ <Text size={30} color={Colors.brand.midnight} weight='bold'>Update Your Picture</Text>
34
+ <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Your profile picture is how users will see you in leaderboards and activity feeds.</Text>
30
35
  </View>
31
36
  <View style={{ justifyContent:'center', alignItems:'center' }}>
32
37
  <Image
@@ -37,12 +42,14 @@ const ProfilePicManager = ({ player, onPlayerUpdate, walkthrough, onNext, onClos
37
42
  <View style={{ position:'absolute', left:0, bottom:0, right: 0, padding:10 }}>
38
43
  <ImageUploader
39
44
  public_id={`${player.player_id}_${Math.random()}`}
40
- onStartUpload={() => console.log('STARTED!!!!')}
45
+ onStartUpload={() => setLoading(true)}
46
+ onCancelUpload={() => setLoading(false)}
41
47
  onFinishUpload={(obj) => handleUpdatePic(obj.secure_url)}
42
48
  >
43
49
  <Button
44
50
  title={player.profile_pic ? 'CHANGE' : 'ADD PICTURE'}
45
51
  disabled
52
+ loading={loading}
46
53
  title_color={Colors.brand.electric}
47
54
  borderWidth={1}
48
55
  borderColor={Colors.brand.electric}
@@ -53,27 +60,35 @@ const ProfilePicManager = ({ player, onPlayerUpdate, walkthrough, onNext, onClos
53
60
  </View>
54
61
  </View>
55
62
  </ScrollView>
56
- <View nativeID='action_row' style={{ flexDirection:'row', padding:10 }}>
63
+ {walkthrough ?
64
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
57
65
  <Button
58
- title={walkthrough ? 'SKIP' : 'CLOSE'}
59
- style={{ flex:1, marginRight:5 }}
60
- borderColor={Colors.brand.electric}
61
- title_color={Colors.brand.electric}
62
- borderWidth={1}
63
- padding={15}
64
- onPress={() => walkthrough ? onNext() : onClose()}
66
+ title='EXIT SETUP'
67
+ title_color={Colors.utility.error}
68
+ backgroundColor='transparent'
69
+ onPress={() => onClose()}
65
70
  />
71
+ <TouchableOpacity
72
+ style={loading?button_styles.wizard_invalid:button_styles.wizard_valid}
73
+ onPress={() => onNext()}
74
+ disabled={loading}
75
+ >
76
+ <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
77
+ </TouchableOpacity>
78
+ </View>
79
+ :
80
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
66
81
  <Button
67
- title={walkthrough?'SET MY PASSWORD':'DONE'}
68
- style={{ flex:3 }}
82
+ style={{ flex:1 }}
83
+ title='BACK'
69
84
  padding={15}
70
- //loading={loading}
71
- //disabled={!is_valid}
72
- backgroundColor={Colors.utility.success}
73
- title_color={Colors.shades.white}
74
- onPress={() => onNext()}
85
+ title_color={Colors.brand.electric}
86
+ borderWidth={1}
87
+ borderColor={Colors.brand.electric}
88
+ onPress={() => onClose()}
75
89
  />
76
90
  </View>
91
+ }
77
92
  </View>
78
93
  )
79
94
  }
@@ -1,38 +1,57 @@
1
1
  import React from 'react';
2
2
  import { View, Image, ScrollView } from 'react-native';
3
- import type { MyPlayerProps } from '../api/types';
3
+ import type { CodeRequestProps, MyPlayerProps, PlayerReferralProps, PromoProps } from '../api/types';
4
4
  import Colors from '../../constants/colors';
5
- import { Button, Text } from '../../Components';
5
+ import { Button, Icons, Text } from '../../Components';
6
+ import { ProfileHelpers } from '../api';
7
+ import type { PublicPlayerProps } from '../../types';
8
+ import { view_styles } from '../../constants/styles';
6
9
 
7
10
 
8
11
  type ProfileWelcomeProps = {
9
12
  player:MyPlayerProps,
10
13
  width:number,
11
14
  onStartSetup: () => void,
15
+ code_details: {
16
+ code_request?:CodeRequestProps,
17
+ referrer?:PublicPlayerProps,
18
+ promo?:PromoProps,
19
+ player_referral?:PlayerReferralProps
20
+ }
12
21
  onClose:() => void
13
22
  }
14
23
 
15
- const ProfileWelcome = ({ player, width, onStartSetup, onClose }:ProfileWelcomeProps) => {
24
+ const ProfileWelcome = ({ player, code_details, width, onStartSetup, onClose }:ProfileWelcomeProps) => {
16
25
 
26
+ const { code_request, promo, referrer } = code_details;
17
27
  return (
18
28
  <View style={{ flex:1 }}>
19
29
  <ScrollView style={{ flex:1 }}>
30
+ <View style={{ padding:20 }}>
31
+ <Text size={30} color={Colors.brand.midnight} weight='bold'>Welcome @{player.username}!</Text>
32
+ <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>We are so glad that you found us! Use the setup wizard to complete your account setup.</Text>
33
+ </View>
20
34
  <Image
21
35
  source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1714506366/Welcome_James_pfzn7z.webp' }}
22
- style={{ width, height:width }}
36
+ style={{ width, height:width, opacity:0.6 }}
23
37
  resizeMode='cover'
24
38
  />
25
- <View style={{ marginTop:-50, flex:1, backgroundColor:Colors.shades.black_faded_heavy }}>
26
- <View style={{ padding:10 }}>
27
- <Text size={24} color={Colors.shades.white} weight='bold'>Welcome @{player.username}</Text>
28
- <Text style={{ marginTop:10 }} size={14} color={Colors.shades.white} weight='bold'>We have randomly generated this username for you. Finish setting up your profile to change it!</Text>
29
- </View>
30
- </View>
31
39
  </ScrollView>
40
+ {code_request && promo ?
41
+ <View style={{ margin:15, marginTop:-50, flexDirection:'row', backgroundColor:Colors.shades.white, borderRadius:8, ...view_styles.float }}>
42
+ <View style={{ padding:10, justifyContent:'center' }}>
43
+ <Icons.GiftIcon size={40} color={Colors.incentive.gold} />
44
+ </View>
45
+ <View style={{flex:1, backgroundColor:Colors.incentive.gold_faded, padding:10 }}>
46
+ <Text style={{ paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.shades.shade600 }} size={16} color={Colors.brand.midnight} weight='bold'>@{referrer?.username} has a gift for you</Text>
47
+ <Text style={{ paddingTop:5 }} size={12} color={Colors.brand.midnight} weight='semibold'>{ProfileHelpers.getReferralDescription(promo)}</Text>
48
+ </View>
49
+ </View>
50
+ :<></>}
32
51
  <View style={{ flexDirection:'row', padding:10 }}>
33
52
  <Button
34
- title='CLOSE'
35
- style={{ flex:1, marginRight:5 }}
53
+ title={`DO IT LATER`}
54
+ style={{ flex:3, marginRight:5 }}
36
55
  borderColor={Colors.brand.electric}
37
56
  title_color={Colors.brand.electric}
38
57
  borderWidth={1}
@@ -40,8 +59,8 @@ const ProfileWelcome = ({ player, width, onStartSetup, onClose }:ProfileWelcomeP
40
59
  onPress={() => onClose()}
41
60
  />
42
61
  <Button
43
- title='UPDATE MY INFO'
44
- style={{ flex:3 }}
62
+ title='SET UP MY ACCOUNT'
63
+ style={{ flex:5 }}
45
64
  backgroundColor={Colors.utility.success}
46
65
  title_color={Colors.shades.white}
47
66
  padding={15}