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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet } from "react-native"
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import LinearGradient from "react-native-linear-gradient";
|
|
5
|
+
import Text from "./Text";
|
|
6
|
+
import Colors from '../constants/colors';
|
|
7
|
+
|
|
8
|
+
type LinearDiagnalProps = {
|
|
9
|
+
label?: string,
|
|
10
|
+
label_size?:number,
|
|
11
|
+
label_color?:string,
|
|
12
|
+
left_color:string,
|
|
13
|
+
right_color:string
|
|
14
|
+
no_buffer?:boolean,
|
|
15
|
+
style?:any,
|
|
16
|
+
children?:any
|
|
17
|
+
}
|
|
18
|
+
const LinearDiagnal = ({ left_color, right_color, no_buffer, label, label_size, label_color, style, children }:LinearDiagnalProps) => {
|
|
19
|
+
const [ height, setHeight ] = useState(0);
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ flexDirection:'row' }} onLayout={(ev) => {
|
|
22
|
+
const { height } = ev.nativeEvent.layout
|
|
23
|
+
setHeight(height)
|
|
24
|
+
}}>
|
|
25
|
+
<LinearGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={[left_color, right_color]} style={{ flex:4, padding:10, ...style }}>
|
|
26
|
+
{label ?
|
|
27
|
+
<Text size={label_size ?? 14} color={label_color ?? Colors.shades.white} weight='bold'>{label}</Text>
|
|
28
|
+
:<></>}
|
|
29
|
+
{children}
|
|
30
|
+
</LinearGradient>
|
|
31
|
+
<View style={{ ...local_styles.triangleCorner, flex:1/2, marginLeft:-1, borderTopWidth:height, borderTopColor:right_color }} />
|
|
32
|
+
{!no_buffer ?
|
|
33
|
+
<View style={{ flex:1 }}/>
|
|
34
|
+
:<></>}
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const local_styles = StyleSheet.create({
|
|
40
|
+
triangleCorner: {
|
|
41
|
+
width: 0,
|
|
42
|
+
height: 0,
|
|
43
|
+
backgroundColor: "transparent",
|
|
44
|
+
borderStyle: "solid",
|
|
45
|
+
borderRightWidth: 20,
|
|
46
|
+
borderTopWidth: 20,
|
|
47
|
+
borderRightColor: "transparent",
|
|
48
|
+
//borderTopColor: "red",
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
export default LinearDiagnal
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, ActivityIndicator } from 'react-native';
|
|
2
|
+
import { View, ActivityIndicator, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { Button, Icons, Text, TextInput } from '../../Components';
|
|
4
4
|
import type { MyPlayerProps } from '../api/types';
|
|
5
5
|
import Colors from '../../constants/colors';
|
|
6
6
|
import { ProfileApi } from '../api';
|
|
7
|
+
import { button_styles } from '../../constants/styles';
|
|
7
8
|
|
|
8
9
|
type BasicInfoManagerProps = {
|
|
9
10
|
player:MyPlayerProps,
|
|
@@ -15,6 +16,7 @@ type BasicInfoManagerProps = {
|
|
|
15
16
|
|
|
16
17
|
const BasicInfoManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose }:BasicInfoManagerProps) => {
|
|
17
18
|
const [ draft_player, setDraftPlayer ] = useState<MyPlayerProps>(player)
|
|
19
|
+
const [ loading, setLoading ] = useState(false);
|
|
18
20
|
const [ username_valid, setUsernameValid ] = useState<{
|
|
19
21
|
loading:boolean,
|
|
20
22
|
valid:boolean
|
|
@@ -30,53 +32,64 @@ const BasicInfoManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose
|
|
|
30
32
|
|
|
31
33
|
const is_changed = JSON.stringify(player) != JSON.stringify(draft_player) ? true : false
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//Check if name needs updating
|
|
35
|
+
const updatePlayer = async() => {
|
|
36
|
+
if(loading){ return }
|
|
37
|
+
setLoading(true)
|
|
37
38
|
let new_player:MyPlayerProps = { ...draft_player };
|
|
38
39
|
if(`${draft_player.first_name.toLowerCase()}${draft_player.last_name.toLowerCase()}` != `${player.first_name.toLowerCase()}${player.last_name.toLowerCase()}`){
|
|
39
40
|
new_player = await ProfileApi.updatePlayerName(draft_player.first_name, draft_player.last_name)
|
|
40
41
|
}
|
|
41
|
-
if(
|
|
42
|
+
if(player.username.toLowerCase() != draft_player.username.toLowerCase()){
|
|
43
|
+
if(!username_valid.valid){ return }
|
|
42
44
|
new_player = await ProfileApi.updatePlayerUsername(draft_player.username)
|
|
43
45
|
}
|
|
44
46
|
onPlayerUpdate(new_player)
|
|
45
|
-
|
|
47
|
+
setLoading(false);
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const handleNext = async() => {
|
|
52
|
+
if(!is_changed){ return onNext() }
|
|
53
|
+
await updatePlayer()
|
|
54
|
+
return onNext()
|
|
46
55
|
}
|
|
47
56
|
|
|
57
|
+
const allow_next = username_valid.valid && !username_valid.loading && draft_player.first_name && draft_player.last_name ? true : false
|
|
48
58
|
|
|
49
59
|
return (
|
|
50
60
|
<View style={{ flex:1 }}>
|
|
51
61
|
<View style={{ flex:1 }}>
|
|
52
|
-
<View style={{ padding:
|
|
53
|
-
<Text
|
|
62
|
+
<View style={{ padding:20 }}>
|
|
63
|
+
<Text size={30} color={Colors.brand.midnight} weight='bold'>Let's start with the basics</Text>
|
|
64
|
+
<Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>You can change this later, but will be required to verify your account.</Text>
|
|
65
|
+
</View>
|
|
66
|
+
<View style={{ padding:30 }}>
|
|
67
|
+
<Text weight='bold' size={18} color={Colors.brand.midnight}>USERNAME</Text>
|
|
54
68
|
<Text style={{ marginTop:5 }} color={Colors.brand.midnight} size={14} textAlign='left'>To start, we randomly generate a username for you! Change it if you'd like here.</Text>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/>
|
|
69
|
+
<View style={{ marginTop:20, backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
|
|
70
|
+
<View style={{ paddingLeft:15, paddingRight:15 }}>
|
|
71
|
+
<Text size={20} color={Colors.brand.midnight} weight='bold'>@</Text>
|
|
72
|
+
</View>
|
|
73
|
+
<TextInput
|
|
74
|
+
value={draft_player.username}
|
|
75
|
+
style={{ flex:1, borderRadius:0 }}
|
|
76
|
+
onBlur={async() => {
|
|
77
|
+
if(draft_player.username.toLowerCase() == player.username.toLowerCase()){ return }//USERNAME HAS NOT CHANGED
|
|
78
|
+
setUsernameValid({ ...username_valid, loading:true })
|
|
79
|
+
const is_valid = await ProfileApi.isAttributeValid('username', draft_player.username)
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
setUsernameValid({ loading: false, valid: is_valid });
|
|
82
|
+
}, 500);
|
|
83
|
+
}}
|
|
84
|
+
onChangeText={(text) => {
|
|
85
|
+
setDraftPlayer({ ...draft_player, username: text })
|
|
86
|
+
if(text.toLowerCase() != player.username.toLowerCase()){
|
|
87
|
+
setUsernameValid({ loading:false, valid:false })
|
|
88
|
+
} else {
|
|
89
|
+
setUsernameValid({ loading: false, valid:true });
|
|
90
|
+
}
|
|
91
|
+
}}
|
|
92
|
+
/>
|
|
80
93
|
<View style={{ paddingLeft:15, paddingRight:15 }}>
|
|
81
94
|
{username_valid.loading ?
|
|
82
95
|
<ActivityIndicator size='small' color={Colors.brand.midnight}/>
|
|
@@ -89,67 +102,88 @@ const BasicInfoManager = ({ player, walkthrough, onPlayerUpdate, onNext, onClose
|
|
|
89
102
|
}
|
|
90
103
|
</View>
|
|
91
104
|
}
|
|
105
|
+
</View>
|
|
92
106
|
</View>
|
|
93
107
|
</View>
|
|
94
|
-
|
|
95
108
|
|
|
96
|
-
<View style={{ padding:
|
|
97
|
-
<Text weight='bold' size={
|
|
109
|
+
<View style={{ padding:30 }}>
|
|
110
|
+
<Text weight='bold' size={18} textAlign='left' color={Colors.brand.midnight}>NAME</Text>
|
|
98
111
|
<Text style={{ marginTop:5 }} color={Colors.brand.midnight} size={14} textAlign='left'>Add / Update your name below. This is required to verify your account</Text>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
<View style={{ marginTop:20, backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
|
|
113
|
+
<View style={{ paddingLeft:15, paddingRight:15 }}>
|
|
114
|
+
<Icons.UserIcon
|
|
115
|
+
color={Colors.brand.midnight}
|
|
116
|
+
size={18}
|
|
117
|
+
/>
|
|
118
|
+
</View>
|
|
119
|
+
<TextInput
|
|
120
|
+
value={draft_player.first_name}
|
|
121
|
+
placeholder='First Name'
|
|
122
|
+
placeholderTextColor={Colors.brand.slate}
|
|
123
|
+
editable={player.vouched_status != 'verified' ? true : false}
|
|
124
|
+
style={{ flex:1, borderTopLeftRadius:0, borderBottomLeftRadius:0 }}
|
|
125
|
+
onChangeText={(text) => setDraftPlayer({ ...draft_player, first_name: text })}
|
|
105
126
|
/>
|
|
106
127
|
</View>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
128
|
+
<View style={{ marginTop:10, backgroundColor:Colors.shades.white, borderRadius:22, flexDirection:'row', alignItems:'center' }}>
|
|
129
|
+
<View style={{ paddingLeft:15, paddingRight:15 }}>
|
|
130
|
+
<Icons.UserIcon
|
|
131
|
+
color={Colors.brand.midnight}
|
|
132
|
+
size={18}
|
|
133
|
+
/>
|
|
134
|
+
</View>
|
|
135
|
+
<TextInput
|
|
136
|
+
value={draft_player.last_name}
|
|
137
|
+
placeholder='Last Name'
|
|
138
|
+
placeholderTextColor={Colors.brand.slate}
|
|
139
|
+
editable={player.vouched_status != 'verified' ? true : false}
|
|
140
|
+
style={{ flex:1, borderTopLeftRadius:0, borderBottomLeftRadius:0 }}
|
|
141
|
+
onChangeText={(text) => setDraftPlayer({ ...draft_player, last_name: text })}
|
|
121
142
|
/>
|
|
122
143
|
</View>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
144
|
+
</View>
|
|
145
|
+
</View>
|
|
146
|
+
{walkthrough ?
|
|
147
|
+
<View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
|
|
148
|
+
<Button
|
|
149
|
+
title='EXIT SETUP'
|
|
150
|
+
title_color={Colors.utility.error}
|
|
151
|
+
backgroundColor='transparent'
|
|
152
|
+
onPress={() => onClose()}
|
|
153
|
+
/>
|
|
154
|
+
<TouchableOpacity
|
|
155
|
+
disabled={!allow_next}
|
|
156
|
+
style={allow_next ? button_styles.wizard_valid : button_styles.wizard_invalid}
|
|
157
|
+
onPress={() => handleNext()}
|
|
158
|
+
>
|
|
159
|
+
<Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
|
|
160
|
+
</TouchableOpacity>
|
|
132
161
|
</View>
|
|
133
|
-
|
|
162
|
+
:
|
|
163
|
+
<View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
|
|
134
164
|
<Button
|
|
135
|
-
title={walkthrough ? 'SKIP' : 'CLOSE'}
|
|
136
165
|
style={{ flex:1, marginRight:5 }}
|
|
137
|
-
|
|
166
|
+
title='BACK'
|
|
167
|
+
padding={15}
|
|
138
168
|
title_color={Colors.brand.electric}
|
|
139
169
|
borderWidth={1}
|
|
140
|
-
|
|
141
|
-
onPress={() =>
|
|
170
|
+
borderColor={Colors.brand.electric}
|
|
171
|
+
onPress={() => onClose()}
|
|
142
172
|
/>
|
|
143
173
|
<Button
|
|
144
|
-
|
|
145
|
-
|
|
174
|
+
style={{ flex:3, opacity:allow_next && is_changed?1:0.5 }}
|
|
175
|
+
disabled={!is_changed || !allow_next}
|
|
176
|
+
title='UPDATE'
|
|
146
177
|
padding={15}
|
|
147
|
-
//disabled={!update_allowed}
|
|
148
|
-
backgroundColor={Colors.utility.success}
|
|
149
178
|
title_color={Colors.shades.white}
|
|
150
|
-
|
|
179
|
+
backgroundColor={Colors.utility.success}
|
|
180
|
+
onPress={async() => {
|
|
181
|
+
await updatePlayer()
|
|
182
|
+
onClose()
|
|
183
|
+
}}
|
|
151
184
|
/>
|
|
152
185
|
</View>
|
|
186
|
+
}
|
|
153
187
|
</View>
|
|
154
188
|
)
|
|
155
189
|
}
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Image, ScrollView } from 'react-native';
|
|
3
|
-
import { Button, Text } from '../../Components';
|
|
3
|
+
import { Button, Icons, Text } from '../../Components';
|
|
4
4
|
import Colors from '../../constants/colors';
|
|
5
|
-
import type { MyPlayerProps } from '../api/types';
|
|
5
|
+
import type { CodeRequestProps, MyPlayerProps, PlayerReferralProps, PromoProps } from '../api/types';
|
|
6
|
+
import type { PublicPlayerProps } from '../../types';
|
|
7
|
+
import { view_styles } from '../../constants/styles';
|
|
8
|
+
import { ProfileHelpers } from '../api';
|
|
6
9
|
|
|
7
10
|
type BasicStatusProps = {
|
|
8
11
|
player:MyPlayerProps,
|
|
12
|
+
code_details: {
|
|
13
|
+
code_request?:CodeRequestProps,
|
|
14
|
+
referrer?:PublicPlayerProps,
|
|
15
|
+
promo?:PromoProps,
|
|
16
|
+
player_referral?:PlayerReferralProps
|
|
17
|
+
}
|
|
9
18
|
onClose:() => void,
|
|
10
19
|
onVerify:() => void
|
|
11
20
|
}
|
|
12
21
|
|
|
13
|
-
const BasicStatus = ({ onVerify, player, onClose }:BasicStatusProps) => {
|
|
22
|
+
const BasicStatus = ({ onVerify, code_details, player, onClose }:BasicStatusProps) => {
|
|
14
23
|
|
|
24
|
+
const { code_request, promo, referrer } = code_details;
|
|
15
25
|
|
|
16
26
|
const getStatus = (p:MyPlayerProps) => {
|
|
17
27
|
let errors:string[] = []
|
|
@@ -25,10 +35,7 @@ const BasicStatus = ({ onVerify, player, onClose }:BasicStatusProps) => {
|
|
|
25
35
|
return (
|
|
26
36
|
<View style={{ flex:1 }}>
|
|
27
37
|
<ScrollView style={{ flex:1 }}>
|
|
28
|
-
|
|
29
|
-
<Text weight='bold' size={16} color={Colors.brand.midnight}>FREE TO PLAY - ENGAGED!</Text>
|
|
30
|
-
<Text style={{ marginTop:5 }} color={Colors.brand.midnight} size={14} textAlign='left'>Your profile is ready to go for play money betting and all our FREE TO PLAY games.</Text>
|
|
31
|
-
</View>
|
|
38
|
+
|
|
32
39
|
<View style={{ justifyContent:'center', alignItems:'center' }}>
|
|
33
40
|
<Image
|
|
34
41
|
source={{ uri:'https://res.cloudinary.com/hoabts6mc/image/upload/v1714410165/Welcome_banner_bqu6cc.webp' }}
|
|
@@ -36,28 +43,52 @@ const BasicStatus = ({ onVerify, player, onClose }:BasicStatusProps) => {
|
|
|
36
43
|
resizeMode='cover'
|
|
37
44
|
/>
|
|
38
45
|
</View>
|
|
39
|
-
<View style={{ padding:10, backgroundColor:Colors.shades.black_faded_super_heavy, marginTop:-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
<View style={{ padding:10, backgroundColor:Colors.shades.black_faded_super_heavy, marginTop:-100 }}>
|
|
47
|
+
<View style={{ padding:10, flexDirection:'row' }}>
|
|
48
|
+
<Icons.CheckCirlceIcon color={Colors.utility.success} size={32}/>
|
|
49
|
+
<View style={{ flex:1, marginLeft:20 }}>
|
|
50
|
+
<Text weight='bold' size={16} color={Colors.shades.white}>FREE TO PLAY - ENGAGED!</Text>
|
|
51
|
+
<Text style={{ marginTop:5 }} color={Colors.shades.white} size={14} textAlign='left'>Your profile is ready to go for play money betting and all our FREE TO PLAY games.</Text>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
<View style={{ padding:10, flexDirection:'row' }}>
|
|
55
|
+
<Icons.AlertIcon color={Colors.utility.warning} size={32}/>
|
|
56
|
+
<View style={{ flex:1, marginLeft:20 }}>
|
|
57
|
+
|
|
58
|
+
<Text weight='bold' size={16} color={Colors.shades.white}>WANT TO USE REAL MONEY?</Text>
|
|
59
|
+
{errors.length == 0 ?
|
|
60
|
+
<Text style={{ marginTop:5 }} color={Colors.shades.white} size={14} textAlign='left'>Continue on your journey and complete the verification steps in just a couple minutes.</Text>
|
|
61
|
+
:
|
|
62
|
+
<View style={{ marginTop:5 }}>
|
|
63
|
+
<Text size={14} color={Colors.utility.warning} weight='bold'>FIX THE FOLLOWING BEFORE CONTINUING</Text>
|
|
64
|
+
<View style={{ padding:10 }}>
|
|
65
|
+
{errors.map((e,i) => {
|
|
66
|
+
return (
|
|
67
|
+
<Text style={{ padding:2 }} size={14} color={Colors.utility.warning} weight='bold'>{i+1} - {e}</Text>
|
|
68
|
+
)
|
|
69
|
+
})}
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
}
|
|
52
73
|
</View>
|
|
53
74
|
</View>
|
|
54
|
-
}
|
|
55
75
|
</View>
|
|
56
76
|
</ScrollView>
|
|
77
|
+
{code_request && promo ?
|
|
78
|
+
<View style={{ margin:15, marginTop:-50, flexDirection:'row', backgroundColor:Colors.shades.white, borderRadius:8, ...view_styles.float }}>
|
|
79
|
+
<View style={{ padding:10, justifyContent:'center' }}>
|
|
80
|
+
<Icons.GiftIcon size={40} color={Colors.incentive.gold} />
|
|
81
|
+
</View>
|
|
82
|
+
<View style={{flex:1, backgroundColor:Colors.incentive.gold_faded, padding:10 }}>
|
|
83
|
+
<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>
|
|
84
|
+
<Text style={{ paddingTop:5 }} size={12} color={Colors.brand.midnight} weight='semibold'>{ProfileHelpers.getReferralDescription(promo)}</Text>
|
|
85
|
+
</View>
|
|
86
|
+
</View>
|
|
87
|
+
:<></>}
|
|
57
88
|
<View nativeID='action_row' style={{ flexDirection:'row', padding:10 }}>
|
|
58
89
|
<Button
|
|
59
|
-
title='
|
|
60
|
-
style={{ flex:
|
|
90
|
+
title='DO IT LATER'
|
|
91
|
+
style={{ flex:3, marginRight:5 }}
|
|
61
92
|
padding={15}
|
|
62
93
|
borderWidth={1}
|
|
63
94
|
borderColor={Colors.brand.electric}
|
|
@@ -66,7 +97,7 @@ const BasicStatus = ({ onVerify, player, onClose }:BasicStatusProps) => {
|
|
|
66
97
|
/>
|
|
67
98
|
<Button
|
|
68
99
|
title='VERIFY ACCOUNT'
|
|
69
|
-
style={{ flex:
|
|
100
|
+
style={{ flex:5, opacity: errors.length > 0 ? 0.5 : 1 }}
|
|
70
101
|
padding={15}
|
|
71
102
|
disabled={errors.length > 0}
|
|
72
103
|
backgroundColor={Colors.utility.success}
|
|
@@ -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
|
}
|