be-components 0.3.3 → 0.3.5
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 +31 -7
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/Authenticator/Components/LoginForm.js +1 -1
- package/lib/commonjs/Authenticator/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 +128 -20
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +80 -57
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.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 +140 -52
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/SettingsManager.js +25 -3
- package/lib/commonjs/ProfileManager/Components/SettingsManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +121 -36
- 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 +3 -1
- 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 +31 -7
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/Authenticator/Components/LoginForm.js +1 -1
- package/lib/module/Authenticator/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 +129 -21
- package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js +80 -57
- package/lib/module/ProfileManager/Components/CodeRedeem.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 +140 -52
- package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/module/ProfileManager/Components/SettingsManager.js +25 -3
- package/lib/module/ProfileManager/Components/SettingsManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js +122 -37
- 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 +3 -1
- 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 +5 -2
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/Authenticator/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/CodeRedeem.d.ts +1 -2
- 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.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 +3 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts +3 -2
- package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts +11 -2
- 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 +31 -11
- package/src/Authenticator/Components/LoginForm.tsx +1 -1
- package/src/Authenticator/index.tsx +0 -1
- 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 +77 -23
- package/src/ProfileManager/Components/CodeRedeem.tsx +42 -35
- 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 +125 -43
- package/src/ProfileManager/Components/SettingsManager.tsx +14 -6
- package/src/ProfileManager/Components/VouchCard.tsx +77 -27
- package/src/ProfileManager/api/index.ts +1 -1
- package/src/ProfileManager/index.tsx +7 -3
- package/src/constants/styles.ts +9 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import type { MyPlayerProps } from '../api/types';
|
|
3
3
|
import moment from 'moment-mini';
|
|
4
|
-
import { View, ActivityIndicator } from 'react-native';
|
|
4
|
+
import { View, ActivityIndicator, TouchableOpacity } from 'react-native';
|
|
5
5
|
import { Button, Icons, Text, TextInput } from '../../Components';
|
|
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 DOBManagerProps = {
|
|
10
11
|
player:MyPlayerProps,
|
|
@@ -62,24 +63,31 @@ const DOBManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }: DO
|
|
|
62
63
|
setDob(val)
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
const update_allowed = isUpdateNeeded() && !error
|
|
67
|
+
|
|
65
68
|
const handleUpdatePlayerDOB = async() => {
|
|
66
69
|
setLoading(true);
|
|
67
70
|
const new_player = await ProfileApi.updatePlayerDOB(dob);
|
|
68
71
|
onPlayerUpdate(new_player)
|
|
69
72
|
setLoading(false);
|
|
70
|
-
if(walkthrough){ onNext() }
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
const
|
|
75
|
+
const handleNext = async() => {
|
|
76
|
+
if(!error && !isUpdateNeeded()){ return onNext() }
|
|
77
|
+
if(!update_allowed){ return }
|
|
78
|
+
await handleUpdatePlayerDOB()
|
|
79
|
+
return onNext()
|
|
80
|
+
}
|
|
81
|
+
|
|
74
82
|
|
|
75
83
|
return (
|
|
76
84
|
<View style={{ flex:1 }}>
|
|
77
85
|
<View style={{ flex:1, justifyContent:'center'}}>
|
|
78
|
-
<View style={{ padding:
|
|
79
|
-
<Text
|
|
80
|
-
<Text style={{ marginTop:
|
|
86
|
+
<View style={{ padding:20 }}>
|
|
87
|
+
<Text size={30} color={Colors.brand.midnight} weight='bold'>Date Of Birth</Text>
|
|
88
|
+
<Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>In order to participate in real-money gaming you must be over 18.</Text>
|
|
81
89
|
</View>
|
|
82
|
-
<View style={{ padding:
|
|
90
|
+
<View style={{ padding:30, flex:1 }}>
|
|
83
91
|
<View style={{ backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
|
|
84
92
|
<View style={{ paddingLeft:15, paddingRight:15 }}>
|
|
85
93
|
<Icons.BirthdayIcon
|
|
@@ -116,38 +124,48 @@ const DOBManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }: DO
|
|
|
116
124
|
:<></>}
|
|
117
125
|
</View>
|
|
118
126
|
</View>
|
|
119
|
-
|
|
127
|
+
{walkthrough ?
|
|
128
|
+
<View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
|
|
120
129
|
<Button
|
|
121
|
-
title=
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
borderWidth={1}
|
|
126
|
-
padding={15}
|
|
127
|
-
onPress={() => walkthrough ? onNext() : onClose()}
|
|
130
|
+
title='EXIT SETUP'
|
|
131
|
+
title_color={Colors.utility.error}
|
|
132
|
+
backgroundColor='transparent'
|
|
133
|
+
onPress={() => onClose()}
|
|
128
134
|
/>
|
|
129
|
-
|
|
135
|
+
<TouchableOpacity
|
|
136
|
+
style={!error && !loading ? button_styles.wizard_valid : button_styles.wizard_invalid}
|
|
137
|
+
disabled={error || loading ? true : false}
|
|
138
|
+
onPress={() => handleNext()}
|
|
139
|
+
>
|
|
140
|
+
<Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
|
|
141
|
+
</TouchableOpacity>
|
|
142
|
+
</View>
|
|
143
|
+
:
|
|
144
|
+
<View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
|
|
130
145
|
<Button
|
|
131
|
-
|
|
132
|
-
|
|
146
|
+
style={{ flex:1, marginRight:5 }}
|
|
147
|
+
title='BACK'
|
|
133
148
|
padding={15}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
title_color={Colors.brand.electric}
|
|
150
|
+
borderWidth={1}
|
|
151
|
+
borderColor={Colors.brand.electric}
|
|
152
|
+
onPress={() => onClose()}
|
|
137
153
|
/>
|
|
138
|
-
:
|
|
139
154
|
<Button
|
|
140
|
-
title={'UPDATE'}
|
|
141
155
|
style={{ flex:3, opacity:update_allowed?1:0.5 }}
|
|
142
|
-
padding={15}
|
|
143
|
-
loading={loading}
|
|
144
156
|
disabled={!update_allowed}
|
|
145
|
-
|
|
157
|
+
loading={loading}
|
|
158
|
+
title='UPDATE'
|
|
159
|
+
padding={15}
|
|
146
160
|
title_color={Colors.shades.white}
|
|
147
|
-
|
|
161
|
+
backgroundColor={Colors.utility.success}
|
|
162
|
+
onPress={async() => {
|
|
163
|
+
await handleUpdatePlayerDOB()
|
|
164
|
+
//onClose()
|
|
165
|
+
}}
|
|
148
166
|
/>
|
|
149
|
-
}
|
|
150
167
|
</View>
|
|
168
|
+
}
|
|
151
169
|
</View>
|
|
152
170
|
)
|
|
153
171
|
}
|
|
@@ -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 }}>
|