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.
Files changed (129) hide show
  1. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js +180 -164
  2. package/lib/commonjs/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  3. package/lib/commonjs/ProfileManager/Components/BasicStatus.js +45 -21
  4. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  5. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js +208 -198
  6. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  7. package/lib/commonjs/ProfileManager/Components/DOBManager.js +75 -61
  8. package/lib/commonjs/ProfileManager/Components/DOBManager.js.map +1 -1
  9. package/lib/commonjs/ProfileManager/Components/EmailManager.js +86 -72
  10. package/lib/commonjs/ProfileManager/Components/EmailManager.js.map +1 -1
  11. package/lib/commonjs/ProfileManager/Components/PasswordManager.js +119 -98
  12. package/lib/commonjs/ProfileManager/Components/PasswordManager.js.map +1 -1
  13. package/lib/commonjs/ProfileManager/Components/PhoneManager.js +74 -60
  14. package/lib/commonjs/ProfileManager/Components/PhoneManager.js.map +1 -1
  15. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js +49 -41
  16. package/lib/commonjs/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  17. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js +70 -43
  18. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  19. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js +250 -141
  20. package/lib/commonjs/ProfileManager/Components/ProfileWizard.js.map +1 -1
  21. package/lib/commonjs/ProfileManager/Components/SettingsManager.js +5 -14
  22. package/lib/commonjs/ProfileManager/Components/SettingsManager.js.map +1 -1
  23. package/lib/commonjs/ProfileManager/Components/VouchCard.js +81 -94
  24. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  25. package/lib/commonjs/ProfileManager/api/index.js +0 -3
  26. package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
  27. package/lib/commonjs/ProfileManager/index.js +36 -50
  28. package/lib/commonjs/ProfileManager/index.js.map +1 -1
  29. package/lib/module/ProfileManager/Components/BasicInfoManager.js +181 -165
  30. package/lib/module/ProfileManager/Components/BasicInfoManager.js.map +1 -1
  31. package/lib/module/ProfileManager/Components/BasicStatus.js +46 -22
  32. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  33. package/lib/module/ProfileManager/Components/CodeRedeem.js +209 -199
  34. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  35. package/lib/module/ProfileManager/Components/DOBManager.js +76 -62
  36. package/lib/module/ProfileManager/Components/DOBManager.js.map +1 -1
  37. package/lib/module/ProfileManager/Components/EmailManager.js +87 -73
  38. package/lib/module/ProfileManager/Components/EmailManager.js.map +1 -1
  39. package/lib/module/ProfileManager/Components/PasswordManager.js +119 -98
  40. package/lib/module/ProfileManager/Components/PasswordManager.js.map +1 -1
  41. package/lib/module/ProfileManager/Components/PhoneManager.js +75 -61
  42. package/lib/module/ProfileManager/Components/PhoneManager.js.map +1 -1
  43. package/lib/module/ProfileManager/Components/ProfilePicManager.js +50 -42
  44. package/lib/module/ProfileManager/Components/ProfilePicManager.js.map +1 -1
  45. package/lib/module/ProfileManager/Components/ProfileWelcome.js +71 -44
  46. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  47. package/lib/module/ProfileManager/Components/ProfileWizard.js +253 -142
  48. package/lib/module/ProfileManager/Components/ProfileWizard.js.map +1 -1
  49. package/lib/module/ProfileManager/Components/SettingsManager.js +6 -15
  50. package/lib/module/ProfileManager/Components/SettingsManager.js.map +1 -1
  51. package/lib/module/ProfileManager/Components/VouchCard.js +82 -95
  52. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  53. package/lib/module/ProfileManager/api/index.js +0 -3
  54. package/lib/module/ProfileManager/api/index.js.map +1 -1
  55. package/lib/module/ProfileManager/index.js +37 -51
  56. package/lib/module/ProfileManager/index.js.map +1 -1
  57. package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicStatus.d.ts +2 -1
  59. package/lib/typescript/lib/commonjs/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  61. package/lib/typescript/lib/commonjs/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  63. package/lib/typescript/lib/commonjs/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  64. package/lib/typescript/lib/commonjs/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  65. package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
  66. package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  67. package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
  68. package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  69. package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWizard.d.ts +1 -2
  70. package/lib/typescript/lib/commonjs/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  71. package/lib/typescript/lib/commonjs/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
  72. package/lib/typescript/lib/commonjs/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  73. package/lib/typescript/lib/commonjs/ProfileManager/api/index.d.ts.map +1 -1
  74. package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts +2 -1
  75. package/lib/typescript/lib/commonjs/ProfileManager/index.d.ts.map +1 -1
  76. package/lib/typescript/lib/module/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  77. package/lib/typescript/lib/module/ProfileManager/Components/BasicStatus.d.ts +2 -1
  78. package/lib/typescript/lib/module/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  79. package/lib/typescript/lib/module/ProfileManager/Components/CodeRedeem.d.ts +1 -3
  80. package/lib/typescript/lib/module/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  81. package/lib/typescript/lib/module/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  82. package/lib/typescript/lib/module/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  83. package/lib/typescript/lib/module/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  84. package/lib/typescript/lib/module/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  85. package/lib/typescript/lib/module/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
  86. package/lib/typescript/lib/module/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  87. package/lib/typescript/lib/module/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
  88. package/lib/typescript/lib/module/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  89. package/lib/typescript/lib/module/ProfileManager/Components/ProfileWizard.d.ts +1 -2
  90. package/lib/typescript/lib/module/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  91. package/lib/typescript/lib/module/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
  92. package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  93. package/lib/typescript/lib/module/ProfileManager/api/index.d.ts.map +1 -1
  94. package/lib/typescript/lib/module/ProfileManager/index.d.ts +2 -1
  95. package/lib/typescript/lib/module/ProfileManager/index.d.ts.map +1 -1
  96. package/lib/typescript/src/ProfileManager/Components/BasicInfoManager.d.ts.map +1 -1
  97. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +2 -1
  98. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  99. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  100. package/lib/typescript/src/ProfileManager/Components/DOBManager.d.ts.map +1 -1
  101. package/lib/typescript/src/ProfileManager/Components/EmailManager.d.ts.map +1 -1
  102. package/lib/typescript/src/ProfileManager/Components/PasswordManager.d.ts.map +1 -1
  103. package/lib/typescript/src/ProfileManager/Components/PhoneManager.d.ts.map +1 -1
  104. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts +2 -1
  105. package/lib/typescript/src/ProfileManager/Components/ProfilePicManager.d.ts.map +1 -1
  106. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +2 -1
  107. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  108. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts +1 -1
  109. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  110. package/lib/typescript/src/ProfileManager/Components/SettingsManager.d.ts.map +1 -1
  111. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  112. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  113. package/lib/typescript/src/ProfileManager/index.d.ts +2 -1
  114. package/lib/typescript/src/ProfileManager/index.d.ts.map +1 -1
  115. package/package.json +1 -1
  116. package/src/ProfileManager/Components/BasicInfoManager.tsx +66 -48
  117. package/src/ProfileManager/Components/BasicStatus.tsx +68 -51
  118. package/src/ProfileManager/Components/CodeRedeem.tsx +117 -100
  119. package/src/ProfileManager/Components/DOBManager.tsx +92 -79
  120. package/src/ProfileManager/Components/EmailManager.tsx +62 -47
  121. package/src/ProfileManager/Components/PasswordManager.tsx +87 -70
  122. package/src/ProfileManager/Components/PhoneManager.tsx +24 -11
  123. package/src/ProfileManager/Components/ProfilePicManager.tsx +54 -36
  124. package/src/ProfileManager/Components/ProfileWelcome.tsx +44 -22
  125. package/src/ProfileManager/Components/ProfileWizard.tsx +281 -151
  126. package/src/ProfileManager/Components/SettingsManager.tsx +17 -21
  127. package/src/ProfileManager/Components/VouchCard.tsx +63 -50
  128. package/src/ProfileManager/api/index.ts +0 -3
  129. package/src/ProfileManager/index.tsx +33 -49
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { Image, ScrollView, TouchableOpacity } from "react-native"
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
- <ScrollView style={{ flex:1 }}>
33
- {walkthrough ?
34
- <View style={{ padding:20 }}>
35
- <Text size={30} theme='h1'>Update Your Picture</Text>
36
- <Text style={{ marginTop:15 }} size={16} theme='h2'>Your profile picture is how users will see you in leaderboards and activity feeds.</Text>
37
- </View>
38
- :<></>}
39
- <View style={{ justifyContent:'center', alignItems:'center' }}>
40
- <Image
41
- source={{ uri: player.profile_pic ? player.profile_pic :'https://res.cloudinary.com/hoabts6mc/image/upload/v1714408535/sports_avatar_wdzsxc.webp' }}
42
- style={{ height:400, width:400, borderRadius:4 }}
43
- resizeMode='cover'
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
- <View style={{ position:'absolute', left:0, bottom:0, right: 0, padding:10 }}>
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 { Image, ScrollView } from 'react-native';
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 ProfileWelcome = ({ player, code_details, onStartSetup, onClose }:ProfileWelcomeProps) => {
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
- <ScrollView style={{ flex:1 }}>
28
- <View style={{ padding:20 }}>
29
- <Text size={30} theme='h2'>Welcome @{player.username}!</Text>
30
- <Text style={{ marginTop:15 }} size={16} theme='h2'>We are so glad that you found us! Use the setup wizard to complete your account setup.</Text>
31
- </View>
32
- <Image
33
- source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1714506366/Welcome_James_pfzn7z.webp' }}
34
- style={{ width:300, height:300, alignSelf:'center' }}
35
- resizeMode='cover'
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`}