be-components 5.2.5 → 5.2.7
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/BettorSearch/index.js +13 -39
- package/lib/commonjs/BettorSearch/index.js.map +1 -1
- package/lib/commonjs/Campaign/components/CampaignAnalytics.js +4 -5
- package/lib/commonjs/Campaign/components/CampaignAnalytics.js.map +1 -1
- package/lib/commonjs/PlayerRecommender/components/ContactsSelector.js +117 -17
- package/lib/commonjs/PlayerRecommender/components/ContactsSelector.js.map +1 -1
- package/lib/commonjs/SocialComponents/Contacts/api/index.js +0 -1
- package/lib/commonjs/SocialComponents/Contacts/api/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/FormattedTextInput/index.js +0 -3
- package/lib/commonjs/SocialComponents/FormattedTextInput/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/GroupChat/index.js +1 -0
- package/lib/commonjs/SocialComponents/GroupChat/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/PostCard/components/ImageList.js +1 -1
- package/lib/commonjs/SocialComponents/Poster/index.js +1 -0
- package/lib/commonjs/SocialComponents/Poster/index.js.map +1 -1
- package/lib/module/BettorSearch/index.js +10 -36
- package/lib/module/BettorSearch/index.js.map +1 -1
- package/lib/module/Campaign/components/CampaignAnalytics.js +5 -6
- package/lib/module/Campaign/components/CampaignAnalytics.js.map +1 -1
- package/lib/module/PlayerRecommender/components/ContactsSelector.js +118 -18
- package/lib/module/PlayerRecommender/components/ContactsSelector.js.map +1 -1
- package/lib/module/SocialComponents/Contacts/api/index.js +0 -1
- package/lib/module/SocialComponents/Contacts/api/index.js.map +1 -1
- package/lib/module/SocialComponents/FormattedTextInput/index.js +0 -3
- package/lib/module/SocialComponents/FormattedTextInput/index.js.map +1 -1
- package/lib/module/SocialComponents/GroupChat/index.js +1 -0
- package/lib/module/SocialComponents/GroupChat/index.js.map +1 -1
- package/lib/module/SocialComponents/PostCard/components/ImageList.js +1 -1
- package/lib/module/SocialComponents/Poster/index.js +1 -0
- package/lib/module/SocialComponents/Poster/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/BettorSearch/index.d.ts +1 -4
- package/lib/typescript/lib/commonjs/BettorSearch/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Campaign/components/CampaignAnalytics.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/PlayerRecommender/components/ContactsSelector.d.ts +2 -2
- package/lib/typescript/lib/commonjs/PlayerRecommender/components/ContactsSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/Contacts/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/FormattedTextInput/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/GroupChat/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/Poster/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/BettorSearch/index.d.ts +2 -6
- package/lib/typescript/lib/module/BettorSearch/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Campaign/components/CampaignAnalytics.d.ts.map +1 -1
- package/lib/typescript/lib/module/PlayerRecommender/components/ContactsSelector.d.ts +2 -2
- package/lib/typescript/lib/module/PlayerRecommender/components/ContactsSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/Contacts/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/FormattedTextInput/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/GroupChat/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/Poster/index.d.ts.map +1 -1
- package/lib/typescript/src/BettorSearch/index.d.ts +1 -1
- package/lib/typescript/src/BettorSearch/index.d.ts.map +1 -1
- package/lib/typescript/src/Campaign/components/CampaignAnalytics.d.ts.map +1 -1
- package/lib/typescript/src/PlayerRecommender/components/ContactsSelector.d.ts +2 -2
- package/lib/typescript/src/PlayerRecommender/components/ContactsSelector.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/Contacts/api/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/FormattedTextInput/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/GroupChat/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/Poster/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/BettorSearch/index.tsx +20 -28
- package/src/Campaign/components/CampaignAnalytics.tsx +3 -4
- package/src/PlayerRecommender/components/ContactsSelector.tsx +89 -17
- package/src/SocialComponents/Contacts/api/index.tsx +0 -1
- package/src/SocialComponents/FormattedTextInput/index.tsx +1 -5
- package/src/SocialComponents/GroupChat/index.tsx +1 -0
- package/src/SocialComponents/PostCard/components/ImageList.tsx +1 -1
- package/src/SocialComponents/Poster/index.tsx +1 -0
|
@@ -7,20 +7,22 @@ import { PlayerRecommenderApi } from '../api';
|
|
|
7
7
|
import { ActivityIndicator, FlatList, Image } from 'react-native';
|
|
8
8
|
import { Button, Text, View } from '../../Components/Themed';
|
|
9
9
|
import PlayerFollowButton from '../../SocialComponents/PlayerFollowButton';
|
|
10
|
-
import { Icons, Toggle } from '../../Components';
|
|
10
|
+
import { Checkbox, Icons, Toggle } from '../../Components';
|
|
11
11
|
import SearchBox from '../../Components/SearchBox';
|
|
12
|
+
import Pagination from '../../Components/Pagination';
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
type ContactsSelectorProps = {
|
|
15
16
|
player_id?:string,
|
|
16
17
|
referral_code?:string,
|
|
17
|
-
|
|
18
|
+
onInviteContacts: (pc:PlayerContactProps[]) => void,
|
|
18
19
|
onSelectContact:(pc:PlayerContactProps, p?:PublicPlayerProps) => void,
|
|
19
20
|
}
|
|
20
|
-
const sections = ['toggle', 'search', 'contacts','players']
|
|
21
|
-
const ContactsSelector = ({ player_id, referral_code, onSelectContact,
|
|
21
|
+
const sections = ['toggle', 'selected', 'search', 'pagination', 'contacts','players']
|
|
22
|
+
const ContactsSelector = ({ player_id, referral_code, onSelectContact, onInviteContacts }:ContactsSelectorProps) => {
|
|
22
23
|
const Colors = useColors();
|
|
23
24
|
const { is_available, permission, compareContacts } = useContacts({ referral_code });
|
|
25
|
+
const [ selected_contacts, setSelectedContacts ] = useState<PlayerContactProps[]>([]);
|
|
24
26
|
const [ contacts, setContacts ] = useState<{
|
|
25
27
|
loading:boolean,
|
|
26
28
|
checked:boolean
|
|
@@ -42,14 +44,15 @@ const ContactsSelector = ({ player_id, referral_code, onSelectContact, onInviteC
|
|
|
42
44
|
players: [],
|
|
43
45
|
player_followers:[]
|
|
44
46
|
});
|
|
47
|
+
const [ offset, setOffset ] = useState(0);
|
|
45
48
|
const { contacts_loading, players, player_followers, player_contacts, active_toggle } = contact_data
|
|
46
49
|
let converted = player_contacts.filter(pc => pc.sub_type == 'phone' && pc.connected_player_id);
|
|
47
50
|
let pending = player_contacts.filter(pc => pc.sub_type == 'phone' && !pc.connected_player_id)
|
|
48
|
-
let visible_converted = converted.slice(
|
|
49
|
-
let visible_pending = pending.slice(
|
|
51
|
+
let visible_converted = converted.slice(offset * 20, (offset*20) + 20);
|
|
52
|
+
let visible_pending = pending.slice(offset * 20, (offset*20) + 20);
|
|
50
53
|
if(search){
|
|
51
|
-
visible_converted = converted.filter(c => `${c.first_name} ${c.last_name}`.toLowerCase().includes(search.toLowerCase())).slice(
|
|
52
|
-
visible_pending = pending.filter(c => `${c.first_name} ${c.last_name}`.toLowerCase().includes(search.toLowerCase())).slice(
|
|
54
|
+
visible_converted = converted.filter(c => `${c.first_name} ${c.last_name}`.toLowerCase().includes(search.toLowerCase())).slice(offset * 20, (offset*20) + 20);
|
|
55
|
+
visible_pending = pending.filter(c => `${c.first_name} ${c.last_name}`.toLowerCase().includes(search.toLowerCase())).slice(offset * 20, (offset*20) + 20);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
|
|
@@ -84,9 +87,20 @@ const ContactsSelector = ({ player_id, referral_code, onSelectContact, onInviteC
|
|
|
84
87
|
const renderContacts = (data:{ item:PlayerContactProps, index:number }) => {
|
|
85
88
|
const pf = player_followers.find(pf => pf.following_id == data.item.connected_player_id);
|
|
86
89
|
const player = players.find(p => p.player_id == data.item.connected_player_id);
|
|
87
|
-
|
|
90
|
+
const selected = selected_contacts.find(c => c.player_contact_id == data.item.player_contact_id) ? true : false
|
|
88
91
|
return (
|
|
89
|
-
<Button
|
|
92
|
+
<Button
|
|
93
|
+
key={data.item.player_contact_id.toString()}
|
|
94
|
+
float
|
|
95
|
+
style={{ padding:0, margin:4 }}
|
|
96
|
+
onPress={() => {
|
|
97
|
+
if(player){ return onSelectContact(data.item, player) }
|
|
98
|
+
if(selected){
|
|
99
|
+
return setSelectedContacts(selected_contacts.filter(c => c.player_contact_id != data.item.player_contact_id))
|
|
100
|
+
}
|
|
101
|
+
return setSelectedContacts(selected_contacts.concat(data.item))
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
90
104
|
<Image
|
|
91
105
|
source={{ uri: player?.profile_pic && player?.profile_pic != '' ? player?.profile_pic : 'https://res.cloudinary.com/hoabts6mc/image/upload/v1722453927/default_man_n96ofq.webp' }}
|
|
92
106
|
style={{ height:75, width:115, borderTopRightRadius:8, borderTopLeftRadius:8 }}
|
|
@@ -113,11 +127,18 @@ const ContactsSelector = ({ player_id, referral_code, onSelectContact, onInviteC
|
|
|
113
127
|
/>
|
|
114
128
|
:
|
|
115
129
|
<Button
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
130
|
+
transparent
|
|
131
|
+
style={{ padding:10, flexDirection:'row', alignItems:'center' }}
|
|
132
|
+
onPress={() => {
|
|
133
|
+
if(selected){
|
|
134
|
+
return setSelectedContacts(selected_contacts.filter(c => c.player_contact_id != data.item.player_contact_id))
|
|
135
|
+
}
|
|
136
|
+
return setSelectedContacts(selected_contacts.concat(data.item))
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
<Checkbox size={14} color={Colors.text.action} checked={selected} disabled onSelect={() => console.log('')}/>
|
|
140
|
+
<Text theme='action' style={{ marginLeft:10 }}>Select</Text>
|
|
141
|
+
</Button>
|
|
121
142
|
}
|
|
122
143
|
</View>
|
|
123
144
|
</Button>
|
|
@@ -135,7 +156,10 @@ const ContactsSelector = ({ player_id, referral_code, onSelectContact, onInviteC
|
|
|
135
156
|
{ key: 'inactive', label: 'Not Joined' }
|
|
136
157
|
]}
|
|
137
158
|
selected_option={active_toggle}
|
|
138
|
-
onSelectOption={(key) =>
|
|
159
|
+
onSelectOption={(key) => {
|
|
160
|
+
setContactData({ ...contact_data, active_toggle: key });
|
|
161
|
+
setOffset(0)
|
|
162
|
+
}}
|
|
139
163
|
/>
|
|
140
164
|
</View>
|
|
141
165
|
)
|
|
@@ -144,10 +168,58 @@ const ContactsSelector = ({ player_id, referral_code, onSelectContact, onInviteC
|
|
|
144
168
|
<View style={{ padding:10, paddingTop:0 }}>
|
|
145
169
|
<SearchBox
|
|
146
170
|
hide_search_button
|
|
147
|
-
onChange={(text) =>
|
|
171
|
+
onChange={(text) => {
|
|
172
|
+
if(offset != 0){ setOffset(0) }
|
|
173
|
+
setSearch(text)
|
|
174
|
+
}}
|
|
148
175
|
/>
|
|
149
176
|
</View>
|
|
150
177
|
)
|
|
178
|
+
case 'selected':
|
|
179
|
+
if(selected_contacts.length == 0){ return <></> }
|
|
180
|
+
if(active_toggle == 'active'){ return <></> }
|
|
181
|
+
return (
|
|
182
|
+
<View>
|
|
183
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
184
|
+
<View transparent style={{ flex:1 }}>
|
|
185
|
+
<Text theme='h1'>Selected Contacts</Text>
|
|
186
|
+
<Text style={{ marginTop:3 }}>Send these contacts an invite!</Text>
|
|
187
|
+
</View>
|
|
188
|
+
<View transparent style={{ marginLeft:10, marginRight:10 }}>
|
|
189
|
+
<Text theme='h1' color={Colors.text.action}>{selected_contacts.length}</Text>
|
|
190
|
+
</View>
|
|
191
|
+
<Button
|
|
192
|
+
title='X'
|
|
193
|
+
transparent
|
|
194
|
+
title_color={Colors.text.error}
|
|
195
|
+
style={{ marginRight:10 }}
|
|
196
|
+
onPress={() => setSelectedContacts([])}
|
|
197
|
+
/>
|
|
198
|
+
<Button
|
|
199
|
+
title='Invite'
|
|
200
|
+
type='success'
|
|
201
|
+
onPress={() => onInviteContacts(selected_contacts)}
|
|
202
|
+
/>
|
|
203
|
+
</View>
|
|
204
|
+
<View style={{ padding:10 }}>
|
|
205
|
+
<FlatList
|
|
206
|
+
data={selected_contacts}
|
|
207
|
+
renderItem={renderContacts}
|
|
208
|
+
keyExtractor={(item) => item.player_contact_id.toString()}
|
|
209
|
+
horizontal
|
|
210
|
+
key={'selected_list'}
|
|
211
|
+
/>
|
|
212
|
+
</View>
|
|
213
|
+
</View>
|
|
214
|
+
)
|
|
215
|
+
case 'pagination':
|
|
216
|
+
return (
|
|
217
|
+
<Pagination
|
|
218
|
+
offset={offset}
|
|
219
|
+
onNext={() => setOffset(offset + 1)}
|
|
220
|
+
onPrevious={() => setOffset(offset - 1)}
|
|
221
|
+
/>
|
|
222
|
+
)
|
|
151
223
|
case 'contacts':
|
|
152
224
|
if(active_toggle != 'inactive'){ return <></> }
|
|
153
225
|
return (
|
|
@@ -43,7 +43,6 @@ const ContactsApi = {
|
|
|
43
43
|
compareContacts: async(player_contacts:PlayerContactProps[]):Promise<PlayerContactProps[]> => {
|
|
44
44
|
try {
|
|
45
45
|
const resp = await axios.post(`${AUTH_SVC_API}/v1/players/contacts/compare`, { player_contacts });
|
|
46
|
-
console.log(resp.data)
|
|
47
46
|
return resp.data.player_contacts
|
|
48
47
|
} catch (e) {
|
|
49
48
|
console.log(e)
|
|
@@ -90,20 +90,16 @@ const FormattedTextInput = ({ width, disable_scroll, submit_title, hide_border,
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const searchPlayer = async(tag:TextTagProps) => {
|
|
93
|
-
setActionLoading(true);
|
|
94
93
|
const player = await SocialComponentApi.searchPlayerByUsername(tag.tag);
|
|
95
94
|
if(player){
|
|
96
95
|
validateTag({ ...tag, local_id: (Math.random()*10000).toFixed(), data: player, tag_type_id:player.player_id });
|
|
97
|
-
setActionLoading(false);
|
|
98
96
|
} else {
|
|
99
97
|
setTagSelector({
|
|
100
98
|
visible:true,
|
|
101
99
|
working_tag:tag,
|
|
102
100
|
type:'player'
|
|
103
101
|
});
|
|
104
|
-
}
|
|
105
|
-
setActionLoading(false);
|
|
106
|
-
|
|
102
|
+
}
|
|
107
103
|
}
|
|
108
104
|
|
|
109
105
|
|
|
@@ -360,6 +360,7 @@ const GroupChat = ({ my_id, player_id, width, group_id, access_token, insets, di
|
|
|
360
360
|
<FlatList
|
|
361
361
|
data={sections}
|
|
362
362
|
key={'chat_sections'}
|
|
363
|
+
keyboardShouldPersistTaps
|
|
363
364
|
scrollEnabled={false}
|
|
364
365
|
keyExtractor={item => item}
|
|
365
366
|
renderItem={renderSections}
|
|
@@ -11,7 +11,7 @@ type ImageListProps = {
|
|
|
11
11
|
}
|
|
12
12
|
const ImageList = ({ width, images, onSelectImage }:ImageListProps) => {
|
|
13
13
|
|
|
14
|
-
const new_images = SocialComponentHelpers.organizeImages(images, width-2,
|
|
14
|
+
const new_images = SocialComponentHelpers.organizeImages(images, width-2, 350, 2, 125)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
const renderImages = (data:{ item:any, index:number }) => {
|