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.
- package/lib/commonjs/ApiOverrides/index.js +4 -0
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Components/Icons.js +50 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Components/ImageUploader.js +10 -1
- package/lib/commonjs/Components/ImageUploader.js.map +1 -1
- package/lib/commonjs/Components/LinearDiagnal.js +82 -0
- package/lib/commonjs/Components/LinearDiagnal.js.map +1 -0
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +81 -32
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js +89 -20
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/DOBManager.js +55 -33
- package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/EmailManager.js +69 -34
- package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js +47 -25
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js +70 -35
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +45 -29
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js +59 -17
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +57 -30
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +15 -23
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/api/index.js +1 -1
- package/lib/commonjs/ProfileManager/index.js +5 -2
- package/lib/commonjs/ProfileManager/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +21 -1
- package/lib/commonjs/constants/styles.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +4 -0
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Components/Icons.js +50 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Components/ImageUploader.js +10 -1
- package/lib/module/Components/ImageUploader.js.map +1 -1
- package/lib/module/Components/LinearDiagnal.js +74 -0
- package/lib/module/Components/LinearDiagnal.js.map +1 -0
- package/lib/module/ProfileManager/Components/BasicInfoManager.js +82 -33
- package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicStatus.js +90 -21
- package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/module/ProfileManager/Components/DOBManager.js +56 -34
- package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/EmailManager.js +71 -36
- package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PasswordManager.js +48 -26
- package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PhoneManager.js +72 -37
- package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js +45 -31
- package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWelcome.js +60 -18
- package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWizard.js +57 -30
- package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js +15 -23
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/api/index.js +1 -1
- package/lib/module/ProfileManager/index.js +5 -2
- package/lib/module/ProfileManager/index.js.map +1 -1
- package/lib/module/constants/styles.js +20 -0
- package/lib/module/constants/styles.js.map +1 -1
- package/lib/typescript/src/ApiOverrides/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/Components/ImageUploader.d.ts +1 -1
- package/lib/typescript/src/Components/ImageUploader.d.ts.map +1 -1
- package/lib/typescript/src/Components/LinearDiagnal.d.ts +14 -0
- package/lib/typescript/src/Components/LinearDiagnal.d.ts.map +1 -0
- package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +9 -2
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.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.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +9 -2
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +5 -2
- 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/index.d.ts +5 -2
- package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
- package/lib/typescript/src/constants/styles.d.ts +26 -0
- package/lib/typescript/src/constants/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ApiOverrides/index.ts +4 -0
- package/src/Components/Icons.tsx +21 -0
- package/src/Components/ImageUploader.tsx +4 -3
- package/src/Components/LinearDiagnal.tsx +52 -0
- package/src/ProfileManager/Components/BasicInfoManager.tsx +110 -76
- package/src/ProfileManager/Components/BasicStatus.tsx +55 -24
- package/src/ProfileManager/Components/DOBManager.tsx +46 -28
- package/src/ProfileManager/Components/EmailManager.tsx +48 -33
- package/src/ProfileManager/Components/PasswordManager.tsx +36 -18
- package/src/ProfileManager/Components/PhoneManager.tsx +82 -66
- package/src/ProfileManager/Components/ProfilePicManager.tsx +38 -23
- package/src/ProfileManager/Components/ProfileWelcome.tsx +33 -14
- package/src/ProfileManager/Components/ProfileWizard.tsx +72 -21
- package/src/ProfileManager/Components/VouchCard.tsx +8 -11
- package/src/ProfileManager/api/index.ts +1 -1
- package/src/ProfileManager/index.tsx +8 -4
- 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(
|
|
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
|
-
|
|
86
|
-
<View style={{ padding:
|
|
87
|
-
<Text
|
|
88
|
-
<Text style={{ marginTop:
|
|
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:
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
158
|
+
title='BACK'
|
|
159
|
+
padding={15}
|
|
138
160
|
title_color={Colors.brand.electric}
|
|
139
161
|
borderWidth={1}
|
|
140
|
-
|
|
141
|
-
onPress={() =>
|
|
162
|
+
borderColor={Colors.brand.electric}
|
|
163
|
+
onPress={() => onClose()}
|
|
142
164
|
/>
|
|
143
|
-
{!is_changed && player.verified ?
|
|
144
165
|
<Button
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
160
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
194
|
+
title='BACK'
|
|
195
|
+
padding={15}
|
|
178
196
|
title_color={Colors.brand.electric}
|
|
179
197
|
borderWidth={1}
|
|
180
|
-
|
|
181
|
-
onPress={() =>
|
|
198
|
+
borderColor={Colors.brand.electric}
|
|
199
|
+
onPress={() => onClose()}
|
|
182
200
|
/>
|
|
183
201
|
<Button
|
|
184
|
-
|
|
185
|
-
|
|
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(
|
|
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:
|
|
94
|
-
<Text
|
|
95
|
-
<Text style={{ marginTop:
|
|
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:
|
|
103
|
+
<View style={{ padding:30 }}>
|
|
98
104
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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:
|
|
28
|
-
<Text size={
|
|
29
|
-
<Text style={{ marginTop:
|
|
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={() =>
|
|
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
|
-
|
|
63
|
+
{walkthrough ?
|
|
64
|
+
<View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
|
|
57
65
|
<Button
|
|
58
|
-
title=
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
68
|
-
|
|
82
|
+
style={{ flex:1 }}
|
|
83
|
+
title='BACK'
|
|
69
84
|
padding={15}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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=
|
|
35
|
-
style={{ flex:
|
|
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='
|
|
44
|
-
style={{ flex:
|
|
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}
|