be-components 5.3.4 → 5.3.7
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/ProfileManager/Components/BasicInfoManager.js +196 -175
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js +45 -21
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +208 -198
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/DOBManager.js +86 -70
- package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/EmailManager.js +99 -83
- package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js +135 -108
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js +88 -72
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +65 -52
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js +70 -43
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +250 -141
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/SettingsManager.js +5 -14
- package/lib/commonjs/ProfileManager/Components/SettingsManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +81 -94
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/api/index.js +0 -3
- package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
- package/lib/commonjs/ProfileManager/index.js +36 -50
- package/lib/commonjs/ProfileManager/index.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicInfoManager.js +197 -176
- package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicStatus.js +46 -22
- package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js +209 -199
- package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/module/ProfileManager/Components/DOBManager.js +87 -71
- package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/EmailManager.js +100 -84
- package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PasswordManager.js +135 -108
- package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PhoneManager.js +89 -73
- package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js +66 -53
- package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWelcome.js +71 -44
- package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWizard.js +253 -142
- package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/module/ProfileManager/Components/SettingsManager.js +6 -15
- package/lib/module/ProfileManager/Components/SettingsManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js +82 -95
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/api/index.js +0 -3
- package/lib/module/ProfileManager/api/index.js.map +1 -1
- package/lib/module/ProfileManager/index.js +37 -51
- package/lib/module/ProfileManager/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicStatus.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWizard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/BasicStatus.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/CodeRedeem.d.ts +1 -3
- package/lib/typescript/lib/module/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWizard.d.ts +1 -2
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/index.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -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/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/SettingsManager.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.map +1 -1
- package/lib/typescript/src/ProfileManager/index.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ProfileManager/Components/BasicInfoManager.tsx +68 -48
- package/src/ProfileManager/Components/BasicStatus.tsx +68 -51
- package/src/ProfileManager/Components/CodeRedeem.tsx +117 -100
- package/src/ProfileManager/Components/DOBManager.tsx +96 -80
- package/src/ProfileManager/Components/EmailManager.tsx +65 -47
- package/src/ProfileManager/Components/PasswordManager.tsx +93 -74
- package/src/ProfileManager/Components/PhoneManager.tsx +25 -9
- package/src/ProfileManager/Components/ProfilePicManager.tsx +56 -36
- package/src/ProfileManager/Components/ProfileWelcome.tsx +44 -22
- package/src/ProfileManager/Components/ProfileWizard.tsx +281 -151
- package/src/ProfileManager/Components/SettingsManager.tsx +17 -21
- package/src/ProfileManager/Components/VouchCard.tsx +63 -50
- package/src/ProfileManager/api/index.ts +0 -3
- package/src/ProfileManager/index.tsx +33 -49
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Image, Modal, Alert, FlatList, Platform } from 'react-native';
|
|
3
3
|
import { Icons } from '../../Components';
|
|
4
4
|
import Colors from '../../constants/colors';
|
|
5
5
|
import { ProfileApi, ProfileHelpers } from '../api';
|
|
@@ -36,7 +36,6 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
36
36
|
const [ disclaimer_confirmed, setDisclaimerConfirmed ] = useState(false);
|
|
37
37
|
const [ id_disclaimer_confirmed, setIDDisclaimerConfirmed ] = useState(false);
|
|
38
38
|
const [ info_visible, setInfoVisible ] = useState(false);
|
|
39
|
-
const { height } = useWindowDimensions();
|
|
40
39
|
const { code_request, promo } = code_details;
|
|
41
40
|
useEffect(() => {
|
|
42
41
|
getPlayerFromServer()
|
|
@@ -107,11 +106,10 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
107
106
|
const renderSections = (data:{item:string, index:number}) => {
|
|
108
107
|
switch(data.item){
|
|
109
108
|
case 'header':
|
|
110
|
-
if(height < 830){ return <></> }
|
|
111
109
|
return (
|
|
112
110
|
<View style={{ padding:20 }}>
|
|
113
|
-
<Text size={
|
|
114
|
-
<Text style={{ marginTop:15 }} size={
|
|
111
|
+
<Text size={26} theme='h1'>Help us identify you</Text>
|
|
112
|
+
<Text style={{ marginTop:15 }} size={14} theme='h2'>We need to take extra steps to verify your account. Scan your Driver's License or state issued ID and take a selfie for instant verification</Text>
|
|
115
113
|
</View>
|
|
116
114
|
)
|
|
117
115
|
case 'info':
|
|
@@ -140,8 +138,10 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
140
138
|
if(player.vouched_status != 'unverified'){ return <></> }
|
|
141
139
|
return (
|
|
142
140
|
<View style={{ padding:10 }}>
|
|
143
|
-
<
|
|
144
|
-
|
|
141
|
+
<Button
|
|
142
|
+
style={{ padding:0 }}
|
|
143
|
+
onPress={() => setDisclaimerConfirmed(!disclaimer_confirmed)}
|
|
144
|
+
>
|
|
145
145
|
<View float style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
146
146
|
<View transparent style={{ justifyContent:'center', alignItems:'center', borderWidth:1, borderColor:C.text.h1, borderRadius:4, height:20, width:20 }}>
|
|
147
147
|
{disclaimer_confirmed ?
|
|
@@ -150,9 +150,11 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
150
150
|
</View>
|
|
151
151
|
<Text style={{ marginLeft:10, flex:1 }} theme='h2'>I confirm that my name is <Text size={14} theme='warning'>{player.first_name} {player.last_name}</Text> and that my date of birth is <Text size={14} theme='warning'>{new_date}</Text>. Mismatch will cause failure.</Text>
|
|
152
152
|
</View>
|
|
153
|
-
</
|
|
154
|
-
<
|
|
155
|
-
|
|
153
|
+
</Button>
|
|
154
|
+
<Button
|
|
155
|
+
onPress={() => setIDDisclaimerConfirmed(!id_disclaimer_confirmed)}
|
|
156
|
+
style={{ padding:0 }}
|
|
157
|
+
|
|
156
158
|
>
|
|
157
159
|
<View float style={{ marginTop:10, padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
158
160
|
<View transparent style={{ justifyContent:'center', alignItems:'center', borderWidth:1, borderColor:C.text.h1, borderRadius:4, height:20, width:20 }}>
|
|
@@ -162,7 +164,7 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
162
164
|
</View>
|
|
163
165
|
<Text style={{ marginLeft:10, flex:1 }} theme='h2'>I confirm that I am using a valid <Text size={14} theme='warning'>(Not Expired)</Text> US government issued ID. Expired ID will cause failure.</Text>
|
|
164
166
|
</View>
|
|
165
|
-
</
|
|
167
|
+
</Button>
|
|
166
168
|
</View>
|
|
167
169
|
)
|
|
168
170
|
case 'failed':
|
|
@@ -176,29 +178,39 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
176
178
|
if(!code_request || !promo){ return <></> }
|
|
177
179
|
if(['closed','fulfilled'].includes(code_request.status)){ return <></> }
|
|
178
180
|
return (
|
|
179
|
-
<View
|
|
180
|
-
<View transparent style={{ padding:10, justifyContent:'center', alignItems:'center' }}>
|
|
181
|
-
<Icons.GiftIcon size={40} color={C.text.white} />
|
|
182
|
-
{player.vouched_status == 'verified' ?
|
|
183
|
-
<Text style={{ marginTop:5 }} textAlign='center' size={12} color={C.text.gold}>CLAIM NOW</Text>
|
|
184
|
-
:<></>}
|
|
185
|
-
</View>
|
|
186
|
-
<View transparent style={{flex:1, padding:10 }}>
|
|
187
|
-
<Text theme='h1'>{player.vouched_status == 'verified'?`Congrats! Press Here to claim your gift!`: 'Almost there! Last step to get your gift!'}</Text>
|
|
188
|
-
<Text style={{ paddingTop:5 }} theme='h2'>{ProfileHelpers.getReferralDescription(promo)}</Text>
|
|
189
|
-
</View>
|
|
181
|
+
<View>
|
|
190
182
|
{player.vouched_status == 'verified' ?
|
|
191
|
-
<
|
|
183
|
+
<Button
|
|
184
|
+
float
|
|
192
185
|
disabled={player.vouched_status!='verified' ? true : false}
|
|
193
186
|
onPress={() => onClaimGift()}
|
|
194
|
-
style={{
|
|
195
|
-
|
|
187
|
+
style={{flexDirection:'row', alignItems:'center', justifyContent:'center', alignSelf:'center' }}
|
|
188
|
+
>
|
|
196
189
|
<Text size={14} color={Colors.incentive.gold} weight='bold'>CLAIM ME NOW!</Text>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
</TouchableOpacity>
|
|
190
|
+
<Icons.ChevronIcon direction='down' size={8} color={Colors.incentive.gold} />
|
|
191
|
+
</Button>
|
|
200
192
|
:<></>}
|
|
193
|
+
<Button
|
|
194
|
+
float
|
|
195
|
+
style={{ padding:0, margin:10, flexDirection:'row', backgroundColor:Colors.incentive.gold }}
|
|
196
|
+
disabled={player.vouched_status != 'verified' ? true : false}
|
|
197
|
+
onPress={() => onClaimGift()}
|
|
198
|
+
>
|
|
199
|
+
|
|
200
|
+
<View transparent style={{ padding:10, justifyContent:'center', alignItems:'center' }}>
|
|
201
|
+
<Icons.GiftIcon size={40} color={C.text.white} />
|
|
202
|
+
{player.vouched_status == 'verified' ?
|
|
203
|
+
<Text style={{ marginTop:5 }} textAlign='center' size={12} color={C.text.gold}>CLAIM NOW</Text>
|
|
204
|
+
:<></>}
|
|
205
|
+
</View>
|
|
206
|
+
<View transparent style={{flex:1, padding:10 }}>
|
|
207
|
+
<Text theme='h1'>{player.vouched_status == 'verified'?`Congrats! Press Here to claim your gift!`: 'Almost there! Last step to get your gift!'}</Text>
|
|
208
|
+
<Text style={{ paddingTop:5 }} theme='h2'>{ProfileHelpers.getReferralDescription(promo)}</Text>
|
|
209
|
+
</View>
|
|
210
|
+
|
|
211
|
+
</Button>
|
|
201
212
|
</View>
|
|
213
|
+
|
|
202
214
|
)
|
|
203
215
|
default: return <></>
|
|
204
216
|
}
|
|
@@ -214,6 +226,26 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
214
226
|
renderItem={renderSections}
|
|
215
227
|
/>
|
|
216
228
|
</View>
|
|
229
|
+
{verify_errors.length > 0 ?
|
|
230
|
+
<View style={{ padding:10 }}>
|
|
231
|
+
<View type='footer' style={{ padding:20, borderRadius:8 }}>
|
|
232
|
+
<View transparent style={{ padding:10 }}>
|
|
233
|
+
<Text size={18} theme='h1'>ERRORS:</Text>
|
|
234
|
+
<Text style={{ marginTop:5 }} theme='description'>Please fix the following before continuing to verify</Text>
|
|
235
|
+
</View>
|
|
236
|
+
<View float style={{ padding:10, borderRadius:8 }}>
|
|
237
|
+
{verify_errors.map((e,i) => {
|
|
238
|
+
return (
|
|
239
|
+
<View transparent style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
|
|
240
|
+
<Text size={12} color={Colors.utility.warning} weight='bold'>{i+1} - {e}</Text>
|
|
241
|
+
|
|
242
|
+
</View>
|
|
243
|
+
)
|
|
244
|
+
})}
|
|
245
|
+
</View>
|
|
246
|
+
</View>
|
|
247
|
+
</View>
|
|
248
|
+
:<></>}
|
|
217
249
|
<View nativeID='action_row' style={{ flexDirection:'row', padding:10 }}>
|
|
218
250
|
{walkthrough ?
|
|
219
251
|
<Button
|
|
@@ -234,8 +266,8 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
234
266
|
<Button
|
|
235
267
|
title={'START'}
|
|
236
268
|
loading={vouching || vouch_loading}
|
|
237
|
-
disabled={!scan_ready || vouch_loading}
|
|
238
|
-
style={{ flex:3, opacity:scan_ready && scan_ready&&!vouching?1:0.5 }}
|
|
269
|
+
disabled={!scan_ready || vouch_loading || verify_errors.length > 0}
|
|
270
|
+
style={{ flex:3, opacity:scan_ready && scan_ready&&!vouching&&verify_errors.length == 0?1:0.5 }}
|
|
239
271
|
type='success'
|
|
240
272
|
onPress={() => startVouchingPlayer()}
|
|
241
273
|
/>
|
|
@@ -250,26 +282,7 @@ const VouchCard = ({ player, view_mode, walkthrough, insets, code_details, onVou
|
|
|
250
282
|
</View>
|
|
251
283
|
}
|
|
252
284
|
</View>
|
|
253
|
-
|
|
254
|
-
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center', padding:20 }}>
|
|
255
|
-
<View float style={{ padding:20, borderRadius:8 }}>
|
|
256
|
-
<View transparent style={{ padding:10 }}>
|
|
257
|
-
<Text size={18} theme='h1'>ERRORS:</Text>
|
|
258
|
-
<Text style={{ marginTop:5 }} theme='description'>Please fix the following before continuing to verify</Text>
|
|
259
|
-
</View>
|
|
260
|
-
<View float style={{ padding:10, borderRadius:8 }}>
|
|
261
|
-
{verify_errors.map((e,i) => {
|
|
262
|
-
return (
|
|
263
|
-
<View transparent style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
|
|
264
|
-
<Text size={12} color={Colors.utility.warning} weight='bold'>{i+1} - {e}</Text>
|
|
265
|
-
|
|
266
|
-
</View>
|
|
267
|
-
)
|
|
268
|
-
})}
|
|
269
|
-
</View>
|
|
270
|
-
</View>
|
|
271
|
-
</View>
|
|
272
|
-
:<></>}
|
|
285
|
+
|
|
273
286
|
<Modal
|
|
274
287
|
visible={player?.vouched_status == 'unverified' && vouching ? true : false}
|
|
275
288
|
transparent
|
|
@@ -79,12 +79,10 @@ const ProfileApi = {
|
|
|
79
79
|
},
|
|
80
80
|
getMySettings: async():Promise<{ settings:SettingProps[], player_settings:PlayerSettingProps[] }> => {
|
|
81
81
|
const resp = await axios.get(`${AUTH_SVC_API}/v1/settings/me`)
|
|
82
|
-
console.log(resp.data)
|
|
83
82
|
return resp.data
|
|
84
83
|
},
|
|
85
84
|
updatePlayerSetting: async(player_setting:PlayerSettingProps):Promise<PlayerSettingProps> => {
|
|
86
85
|
const resp = await axios.post(`${AUTH_SVC_API}/v1/settings/player/update`, { player_setting })
|
|
87
|
-
console.log(resp.data)
|
|
88
86
|
return resp.data.player_setting
|
|
89
87
|
},
|
|
90
88
|
redeemCode: async(code_request_id:string):Promise<{ code_request?:CodeRequestProps, promo?:PromoProps, player_referral?:PlayerReferralProps, referrer?:PublicPlayerProps, reward_option?:RewardOptionProps }> => {
|
|
@@ -93,7 +91,6 @@ const ProfileApi = {
|
|
|
93
91
|
},
|
|
94
92
|
tryCodeRequest: async(referral_code:string):Promise<{ result:'success'|'failed', error_message?:string, code_request?:CodeRequestProps, promo?:PromoProps, player_referral?:PlayerReferralProps, referrer?:PublicPlayerProps, reward_option?:RewardOptionProps }> => {
|
|
95
93
|
const resp = await axios.post(`${AUTH_SVC_API}/v1/promos/request/try`, { referral_code })
|
|
96
|
-
console.log(resp.data)
|
|
97
94
|
return resp.data
|
|
98
95
|
},
|
|
99
96
|
setPassword: async(password:string, re_password:string, current_password?:string):Promise<MyPlayerProps> => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Image, ActivityIndicator
|
|
2
|
+
import { Image, ActivityIndicator } from 'react-native';
|
|
3
3
|
import Colors from '../constants/colors';
|
|
4
4
|
import ProfileWizard from './Components/ProfileWizard';
|
|
5
5
|
import { ProfileApi } from './api';
|
|
@@ -12,6 +12,7 @@ type ProfileOverviewProps = {
|
|
|
12
12
|
hide_powered_by?:boolean,
|
|
13
13
|
hide_profile_header?:boolean,
|
|
14
14
|
player?:MyPlayerProps,
|
|
15
|
+
keyboard_height:number,
|
|
15
16
|
hidden_groups?:string[],
|
|
16
17
|
insets?:{ top:number, bottom:number, left:number, right:number }
|
|
17
18
|
hidden_steps?:string[],
|
|
@@ -36,7 +37,7 @@ type ProfileOverviewProps = {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
const ProfileManager = ({ profile_attribute, view_mode, hide_profile_header, insets, player, hide_powered_by, onRedeemCode, onPlayerUpdate, onNextStep, onFocusPosition, onVouchStart, show_welcome, hidden_groups, hidden_steps, hidden_levels, walkthrough, onClose, onLogout }: ProfileOverviewProps ) => {
|
|
40
|
+
const ProfileManager = ({ profile_attribute, keyboard_height, view_mode, hide_profile_header, insets, player, hide_powered_by, onRedeemCode, onPlayerUpdate, onNextStep, onFocusPosition, onVouchStart, show_welcome, hidden_groups, hidden_steps, hidden_levels, walkthrough, onClose, onLogout }: ProfileOverviewProps ) => {
|
|
40
41
|
const [ width, setModuleWidth ] = useState(400);
|
|
41
42
|
const [ loading, setLoading ] = useState(false);
|
|
42
43
|
const [ vouching, setVouching ] = useState(false);
|
|
@@ -79,46 +80,6 @@ const ProfileManager = ({ profile_attribute, view_mode, hide_profile_header, ins
|
|
|
79
80
|
onClose()
|
|
80
81
|
}
|
|
81
82
|
|
|
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
|
-
|
|
122
83
|
if(!draft_player || loading){
|
|
123
84
|
return (
|
|
124
85
|
<View style={{ flex:1 }}>
|
|
@@ -154,15 +115,38 @@ const ProfileManager = ({ profile_attribute, view_mode, hide_profile_header, ins
|
|
|
154
115
|
:<></>}
|
|
155
116
|
</View>
|
|
156
117
|
:<></>}
|
|
157
|
-
<View style={{ flex:1 }}>
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
118
|
+
<View style={{ flex:1, paddingBottom:keyboard_height }}>
|
|
119
|
+
<ProfileWizard
|
|
120
|
+
player={draft_player}
|
|
121
|
+
player_settings={player_settings}
|
|
122
|
+
onVouching={(active) => {
|
|
123
|
+
if(active && onVouchStart){ onVouchStart() }
|
|
124
|
+
setVouching(active)
|
|
125
|
+
}}
|
|
126
|
+
width={width}
|
|
127
|
+
onRedeemCode={onRedeemCode}
|
|
128
|
+
settings={settings}
|
|
129
|
+
insets={insets}
|
|
130
|
+
view_mode={view_mode}
|
|
131
|
+
show_welcome={show_welcome}
|
|
132
|
+
onFocusPosition={onFocusPosition}
|
|
133
|
+
hide_powered_by={hide_powered_by}
|
|
134
|
+
hidden_groups={hidden_groups}
|
|
135
|
+
hidden_steps={hidden_steps}
|
|
136
|
+
hidden_levels={hidden_levels}
|
|
137
|
+
init_walkthrough={walkthrough}
|
|
138
|
+
onNextStep={(step:string) => onNextStep ? onNextStep(step) : console.log()}
|
|
139
|
+
onClose={() => onClose()}
|
|
140
|
+
onLogout={() => handleLogout()}
|
|
141
|
+
profile_attribute={profile_attribute}
|
|
142
|
+
onSelectLevel={(level) => console.log(level)}
|
|
143
|
+
onUpdatePlayerSetting={(new_ps) => setPlayerSettings(player_settings.filter(ps => ps.player_setting_id != new_ps.player_setting_id).concat(new_ps))}
|
|
144
|
+
onPlayerUpdate={(player, attribute) => {
|
|
145
|
+
setDraftPlayer(player)
|
|
146
|
+
if(onPlayerUpdate){ onPlayerUpdate(player, attribute) }
|
|
147
|
+
}}
|
|
163
148
|
/>
|
|
164
149
|
</View>
|
|
165
|
-
|
|
166
150
|
</View>
|
|
167
151
|
</View>
|
|
168
152
|
)
|