be-components 5.3.4 → 5.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +180 -164
- package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js +45 -21
- package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +208 -198
- package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/DOBManager.js +75 -61
- package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/EmailManager.js +86 -72
- package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js +119 -98
- package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js +74 -60
- package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +49 -41
- package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js +70 -43
- package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +250 -141
- package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/SettingsManager.js +5 -14
- package/lib/commonjs/ProfileManager/Components/SettingsManager.js.map +1 -1
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +81 -94
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/ProfileManager/api/index.js +0 -3
- package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
- package/lib/commonjs/ProfileManager/index.js +36 -50
- package/lib/commonjs/ProfileManager/index.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicInfoManager.js +181 -165
- package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/BasicStatus.js +46 -22
- package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
- package/lib/module/ProfileManager/Components/CodeRedeem.js +209 -199
- package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
- package/lib/module/ProfileManager/Components/DOBManager.js +76 -62
- package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/EmailManager.js +87 -73
- package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PasswordManager.js +119 -98
- package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/PhoneManager.js +75 -61
- package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfilePicManager.js +50 -42
- package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWelcome.js +71 -44
- package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
- package/lib/module/ProfileManager/Components/ProfileWizard.js +253 -142
- package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
- package/lib/module/ProfileManager/Components/SettingsManager.js +6 -15
- package/lib/module/ProfileManager/Components/SettingsManager.js.map +1 -1
- package/lib/module/ProfileManager/Components/VouchCard.js +82 -95
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/ProfileManager/api/index.js +0 -3
- package/lib/module/ProfileManager/api/index.js.map +1 -1
- package/lib/module/ProfileManager/index.js +37 -51
- package/lib/module/ProfileManager/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicStatus.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWizard.d.ts +1 -2
- package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/BasicStatus.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/CodeRedeem.d.ts +1 -3
- package/lib/typescript/lib/module/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWizard.d.ts +1 -2
- package/lib/typescript/lib/module/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ProfileManager/index.d.ts +2 -1
- package/lib/typescript/lib/module/ProfileManager/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +1 -1
- package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/ProfileManager/index.d.ts +2 -1
- package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ProfileManager/Components/BasicInfoManager.tsx +66 -48
- package/src/ProfileManager/Components/BasicStatus.tsx +68 -51
- package/src/ProfileManager/Components/CodeRedeem.tsx +117 -100
- package/src/ProfileManager/Components/DOBManager.tsx +92 -79
- package/src/ProfileManager/Components/EmailManager.tsx +62 -47
- package/src/ProfileManager/Components/PasswordManager.tsx +87 -70
- package/src/ProfileManager/Components/PhoneManager.tsx +24 -11
- package/src/ProfileManager/Components/ProfilePicManager.tsx +54 -36
- package/src/ProfileManager/Components/ProfileWelcome.tsx +44 -22
- package/src/ProfileManager/Components/ProfileWizard.tsx +281 -151
- package/src/ProfileManager/Components/SettingsManager.tsx +17 -21
- package/src/ProfileManager/Components/VouchCard.tsx +63 -50
- package/src/ProfileManager/api/index.ts +0 -3
- package/src/ProfileManager/index.tsx +33 -49
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FlatList, Image, TouchableOpacity } from "react-native"
|
|
3
3
|
import { Icons } from '../../Components';
|
|
4
4
|
import ImageUploader from '../../Components/ImageUploader';
|
|
5
5
|
import Colors from '../../constants/colors';
|
|
@@ -10,14 +10,15 @@ import { Button, Text, View } from '../../Components/Themed';
|
|
|
10
10
|
|
|
11
11
|
type ProfilePicManagerProps = {
|
|
12
12
|
player:MyPlayerProps,
|
|
13
|
+
width:number,
|
|
13
14
|
walkthrough?:boolean,
|
|
14
15
|
onClose:() => void,
|
|
15
16
|
onNext:() => void,
|
|
16
17
|
onPlayerUpdate:(player:MyPlayerProps) => void
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
const ProfilePicManager = ({ player, onPlayerUpdate, walkthrough, onNext, onClose }:ProfilePicManagerProps) => {
|
|
20
|
+
const sections = ['pic'];
|
|
21
|
+
const ProfilePicManager = ({ player, width, onPlayerUpdate, walkthrough, onNext, onClose }:ProfilePicManagerProps) => {
|
|
21
22
|
const [ loading, setLoading ] = useState(false);
|
|
22
23
|
|
|
23
24
|
const handleUpdatePic = async(profile_pic:string) => {
|
|
@@ -26,43 +27,60 @@ const ProfilePicManager = ({ player, onPlayerUpdate, walkthrough, onNext, onClos
|
|
|
26
27
|
onPlayerUpdate(new_player)
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
const MAX_WIDTH = 500
|
|
31
|
+
const size = width > MAX_WIDTH ? MAX_WIDTH : width
|
|
32
|
+
|
|
33
|
+
const renderSections = (data:{ item:string, index:number }) => {
|
|
34
|
+
switch(data.item){
|
|
35
|
+
case 'pic':
|
|
36
|
+
return (
|
|
37
|
+
<View>
|
|
38
|
+
<View style={{ margin:5 }}>
|
|
39
|
+
<ImageUploader
|
|
40
|
+
public_id={`${player.player_id}_${Math.random()}`}
|
|
41
|
+
onStartUpload={() => setLoading(true)}
|
|
42
|
+
onCancelUpload={() => setLoading(false)}
|
|
43
|
+
onFinishUpload={(obj) => {
|
|
44
|
+
console.log(obj)
|
|
45
|
+
handleUpdatePic(obj.secure_url)
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<Button
|
|
49
|
+
title={player.profile_pic ? 'CHANGE PICTURE' : 'ADD PICTURE'}
|
|
50
|
+
disabled
|
|
51
|
+
loading={loading}
|
|
52
|
+
type='action'
|
|
53
|
+
onPress={() => console.log('NA')}
|
|
54
|
+
/>
|
|
55
|
+
</ImageUploader>
|
|
56
|
+
</View>
|
|
57
|
+
<Image
|
|
58
|
+
source={{ uri: player.profile_pic ? player.profile_pic :'https://res.cloudinary.com/hoabts6mc/image/upload/v1714408535/sports_avatar_wdzsxc.webp' }}
|
|
59
|
+
style={{ height:size, width:size, borderRadius:4 }}
|
|
60
|
+
resizeMode='cover'
|
|
61
|
+
/>
|
|
62
|
+
</View>
|
|
63
|
+
)
|
|
64
|
+
default: return <></>
|
|
65
|
+
}
|
|
66
|
+
}
|
|
29
67
|
|
|
30
68
|
return (
|
|
31
69
|
<View style={{ flex:1 }}>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
{walkthrough ?
|
|
71
|
+
<View style={{ padding:20 }}>
|
|
72
|
+
<Text size={26} theme='h1'>Update Your Picture</Text>
|
|
73
|
+
<Text style={{ marginTop:15 }} size={14} theme='h2'>Your profile picture is how users will see you in leaderboards and activity feeds.</Text>
|
|
74
|
+
</View>
|
|
75
|
+
:<></>}
|
|
76
|
+
<View style={{ flex:1 }}>
|
|
77
|
+
<FlatList
|
|
78
|
+
data={sections}
|
|
79
|
+
key={'pic_sections'}
|
|
80
|
+
keyExtractor={item => item}
|
|
81
|
+
renderItem={renderSections}
|
|
44
82
|
/>
|
|
45
|
-
|
|
46
|
-
<ImageUploader
|
|
47
|
-
public_id={`${player.player_id}_${Math.random()}`}
|
|
48
|
-
onStartUpload={() => setLoading(true)}
|
|
49
|
-
onCancelUpload={() => setLoading(false)}
|
|
50
|
-
onFinishUpload={(obj) => {
|
|
51
|
-
console.log(obj)
|
|
52
|
-
handleUpdatePic(obj.secure_url)
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
<Button
|
|
56
|
-
title={player.profile_pic ? 'CHANGE' : 'ADD PICTURE'}
|
|
57
|
-
disabled
|
|
58
|
-
loading={loading}
|
|
59
|
-
type='close'
|
|
60
|
-
onPress={() => console.log('NA')}
|
|
61
|
-
/>
|
|
62
|
-
</ImageUploader>
|
|
63
|
-
</View>
|
|
64
|
-
</View>
|
|
65
|
-
</ScrollView>
|
|
83
|
+
</View>
|
|
66
84
|
{walkthrough ?
|
|
67
85
|
<View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
|
|
68
86
|
<Button
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FlatList, Image } from 'react-native';
|
|
3
3
|
import { Icons } from '../../Components';
|
|
4
4
|
import { ProfileHelpers } from '../api';
|
|
5
5
|
import type { CodeRequestProps, MyPlayerProps, PlayerReferralProps, PromoProps, PublicPlayerProps } from '../../types';
|
|
@@ -9,6 +9,7 @@ import { useColors } from '../../constants/useColors';
|
|
|
9
9
|
|
|
10
10
|
type ProfileWelcomeProps = {
|
|
11
11
|
player:MyPlayerProps,
|
|
12
|
+
width:number,
|
|
12
13
|
onStartSetup: () => void,
|
|
13
14
|
code_details: {
|
|
14
15
|
code_request?:CodeRequestProps,
|
|
@@ -19,33 +20,54 @@ type ProfileWelcomeProps = {
|
|
|
19
20
|
onClose:() => void
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
+
const sections = ['welcome', 'code']
|
|
24
|
+
const ProfileWelcome = ({ width, player, code_details, onStartSetup, onClose }:ProfileWelcomeProps) => {
|
|
23
25
|
const C = useColors();
|
|
24
26
|
const { code_request, promo, referrer } = code_details;
|
|
27
|
+
const MAX_WIDTH = 500
|
|
28
|
+
const size = width > MAX_WIDTH ? MAX_WIDTH : width
|
|
29
|
+
const renderSections = (data:{ item:string, index:number }) => {
|
|
30
|
+
switch(data.item){
|
|
31
|
+
case 'welcome':
|
|
32
|
+
return (
|
|
33
|
+
<Image
|
|
34
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1714506366/Welcome_James_pfzn7z.webp' }}
|
|
35
|
+
style={{ width:size, height:size, alignSelf:'center' }}
|
|
36
|
+
resizeMode='cover'
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
case 'code':
|
|
40
|
+
if(!code_request) { return <></> }
|
|
41
|
+
if(!promo){ return <></> }
|
|
42
|
+
if(['closed','fulfilled'].includes(code_request.status)){ return <></> }
|
|
43
|
+
return (
|
|
44
|
+
<View float style={{ margin:15, flexDirection:'row' }}>
|
|
45
|
+
<View transparent style={{ padding:10, justifyContent:'center' }}>
|
|
46
|
+
<Icons.GiftIcon size={40} color={C.text.gold} />
|
|
47
|
+
</View>
|
|
48
|
+
<View transparent style={{flex:1, padding:10 }}>
|
|
49
|
+
<Text theme='h1'>@{referrer?.username} has a gift for you</Text>
|
|
50
|
+
<Text style={{ paddingTop:5 }} theme='h2'>{ProfileHelpers.getReferralDescription(promo)}</Text>
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
)
|
|
54
|
+
default:return <></>
|
|
55
|
+
}
|
|
56
|
+
}
|
|
25
57
|
return (
|
|
26
58
|
<View style={{ flex:1 }}>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
59
|
+
<View style={{ padding:20 }}>
|
|
60
|
+
<Text size={26} theme='h2'>Welcome @{player.username}!</Text>
|
|
61
|
+
<Text style={{ marginTop:15 }} size={14} theme='h2'>We are so glad that you found us! Use the setup wizard to complete your account setup.</Text>
|
|
62
|
+
</View>
|
|
63
|
+
<View style={{ flex:1 }}>
|
|
64
|
+
<FlatList
|
|
65
|
+
data={sections}
|
|
66
|
+
key={'welcome_sections'}
|
|
67
|
+
keyExtractor={item => item}
|
|
68
|
+
renderItem={renderSections}
|
|
36
69
|
/>
|
|
37
|
-
</ScrollView>
|
|
38
|
-
{code_request && !['closed','fulfilled'].includes(code_request.status) && promo ?
|
|
39
|
-
<View float style={{ margin:15, marginTop:-50, flexDirection:'row' }}>
|
|
40
|
-
<View transparent style={{ padding:10, justifyContent:'center' }}>
|
|
41
|
-
<Icons.GiftIcon size={40} color={C.text.gold} />
|
|
42
|
-
</View>
|
|
43
|
-
<View transparent style={{flex:1, padding:10 }}>
|
|
44
|
-
<Text theme='h1'>@{referrer?.username} has a gift for you</Text>
|
|
45
|
-
<Text style={{ paddingTop:5 }} theme='h2'>{ProfileHelpers.getReferralDescription(promo)}</Text>
|
|
46
|
-
</View>
|
|
47
70
|
</View>
|
|
48
|
-
:<></>}
|
|
49
71
|
<View style={{ flexDirection:'row', padding:10 }}>
|
|
50
72
|
<Button
|
|
51
73
|
title={`DO IT LATER`}
|