be-components 3.8.6 → 3.8.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/Components/Themed.js +6 -0
- package/lib/commonjs/Components/Themed.js.map +1 -1
- package/lib/commonjs/Components/Toggle.js +0 -1
- package/lib/commonjs/Components/Toggle.js.map +1 -1
- package/lib/commonjs/SocialComponents/ArticleCard.js +31 -22
- package/lib/commonjs/SocialComponents/ArticleCard.js.map +1 -1
- package/lib/commonjs/SocialComponents/CompanyProfile/index.js +300 -267
- package/lib/commonjs/SocialComponents/CompanyProfile/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/PlayerCard.js +28 -41
- package/lib/commonjs/SocialComponents/PlayerCard.js.map +1 -1
- package/lib/commonjs/SocialComponents/PlayerList.js +9 -8
- package/lib/commonjs/SocialComponents/PlayerList.js.map +1 -1
- package/lib/commonjs/SocialComponents/PlayerProfile/components/PlayerFollowersList.js +36 -43
- package/lib/commonjs/SocialComponents/PlayerProfile/components/PlayerFollowersList.js.map +1 -1
- package/lib/commonjs/SocialComponents/PlayerProfile/index.js +384 -356
- package/lib/commonjs/SocialComponents/PlayerProfile/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/PodcastCard.js +14 -12
- package/lib/commonjs/SocialComponents/PodcastCard.js.map +1 -1
- package/lib/commonjs/SocialComponents/PodcastModule/index.js +0 -1
- package/lib/commonjs/SocialComponents/PodcastModule/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/SocialOrdersList.js +5 -1
- package/lib/commonjs/SocialComponents/SocialOrdersList.js.map +1 -1
- package/lib/commonjs/constants/useColors.js +2 -0
- package/lib/commonjs/constants/useColors.js.map +1 -1
- package/lib/module/Components/Themed.js +6 -0
- package/lib/module/Components/Themed.js.map +1 -1
- package/lib/module/Components/Toggle.js +0 -1
- package/lib/module/Components/Toggle.js.map +1 -1
- package/lib/module/SocialComponents/ArticleCard.js +27 -18
- package/lib/module/SocialComponents/ArticleCard.js.map +1 -1
- package/lib/module/SocialComponents/CompanyProfile/index.js +297 -264
- package/lib/module/SocialComponents/CompanyProfile/index.js.map +1 -1
- package/lib/module/SocialComponents/PlayerCard.js +22 -35
- package/lib/module/SocialComponents/PlayerCard.js.map +1 -1
- package/lib/module/SocialComponents/PlayerList.js +8 -7
- package/lib/module/SocialComponents/PlayerList.js.map +1 -1
- package/lib/module/SocialComponents/PlayerProfile/components/PlayerFollowersList.js +28 -35
- package/lib/module/SocialComponents/PlayerProfile/components/PlayerFollowersList.js.map +1 -1
- package/lib/module/SocialComponents/PlayerProfile/index.js +382 -355
- package/lib/module/SocialComponents/PlayerProfile/index.js.map +1 -1
- package/lib/module/SocialComponents/PodcastCard.js +11 -9
- package/lib/module/SocialComponents/PodcastCard.js.map +1 -1
- package/lib/module/SocialComponents/PodcastModule/index.js +0 -1
- package/lib/module/SocialComponents/PodcastModule/index.js.map +1 -1
- package/lib/module/SocialComponents/SocialOrdersList.js +5 -1
- package/lib/module/SocialComponents/SocialOrdersList.js.map +1 -1
- package/lib/module/constants/useColors.js +2 -0
- package/lib/module/constants/useColors.js.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Themed.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Toggle.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/ArticleCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/CompanyProfile/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerCard.d.ts +1 -3
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerList.d.ts +1 -2
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerProfile/components/PlayerFollowersList.d.ts +2 -2
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerProfile/components/PlayerFollowersList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerProfile/index.d.ts +1 -2
- package/lib/typescript/lib/commonjs/SocialComponents/PlayerProfile/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PodcastCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/PodcastModule/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants/useColors.d.ts +1 -0
- package/lib/typescript/lib/commonjs/constants/useColors.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Themed.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Toggle.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/ArticleCard.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/ArticleCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/CompanyProfile/index.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/CompanyProfile/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PlayerCard.d.ts +2 -5
- package/lib/typescript/lib/module/SocialComponents/PlayerCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PlayerList.d.ts +2 -4
- package/lib/typescript/lib/module/SocialComponents/PlayerList.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PlayerProfile/components/PlayerFollowersList.d.ts +3 -4
- package/lib/typescript/lib/module/SocialComponents/PlayerProfile/components/PlayerFollowersList.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PlayerProfile/index.d.ts +2 -5
- package/lib/typescript/lib/module/SocialComponents/PlayerProfile/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PodcastCard.d.ts +1 -2
- package/lib/typescript/lib/module/SocialComponents/PodcastCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/PodcastModule/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/SocialComponents/SocialOrdersList.d.ts.map +1 -1
- package/lib/typescript/lib/module/constants/useColors.d.ts +1 -0
- package/lib/typescript/lib/module/constants/useColors.d.ts.map +1 -1
- package/lib/typescript/src/Components/Themed.d.ts +1 -1
- package/lib/typescript/src/Components/Themed.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/ArticleCard.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/CompanyProfile/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PlayerCard.d.ts +2 -4
- package/lib/typescript/src/SocialComponents/PlayerCard.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PlayerList.d.ts +2 -2
- package/lib/typescript/src/SocialComponents/PlayerList.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PlayerProfile/components/PlayerFollowersList.d.ts +2 -1
- package/lib/typescript/src/SocialComponents/PlayerProfile/components/PlayerFollowersList.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PlayerProfile/index.d.ts +3 -4
- package/lib/typescript/src/SocialComponents/PlayerProfile/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PodcastCard.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/PodcastModule/index.d.ts.map +1 -1
- package/lib/typescript/src/constants/useColors.d.ts +1 -0
- package/lib/typescript/src/constants/useColors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Components/Themed.tsx +7 -1
- package/src/Components/Toggle.tsx +1 -1
- package/src/SocialComponents/ArticleCard.tsx +15 -20
- package/src/SocialComponents/CompanyProfile/index.tsx +186 -160
- package/src/SocialComponents/PlayerCard.tsx +16 -24
- package/src/SocialComponents/PlayerList.tsx +6 -7
- package/src/SocialComponents/PlayerProfile/components/PlayerFollowersList.tsx +25 -33
- package/src/SocialComponents/PlayerProfile/index.tsx +228 -221
- package/src/SocialComponents/PodcastCard.tsx +8 -9
- package/src/SocialComponents/PodcastModule/index.tsx +0 -1
- package/src/SocialComponents/SocialOrdersList.tsx +1 -1
- package/src/constants/useColors.tsx +2 -0
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ActivityIndicator, Image, FlatList } from 'react-native';
|
|
3
3
|
import type { ArticleFeedProps, ArticleProps, BEEventProps, BracketCompetitionProps, BracketProps, CompanyProps, CompetitionProps, CompetitionResultTypeProps, CompetitionTypeProps, EventProps, LeagueProps, PodcastProps, PublicPlayerProps, SquaresCompetitionProps } from '../../types';
|
|
4
4
|
import type { CompanyMemberProps } from '../../Authenticator/api/types';
|
|
5
5
|
import { CompanyProfileApi, CompanyProfileHelpers } from './api';
|
|
6
|
-
import
|
|
7
|
-
import { Icons, Text } from '../../Components';
|
|
8
|
-
import { view_styles } from '../../constants/styles';
|
|
6
|
+
import { Icons, Toggle } from '../../Components';
|
|
9
7
|
import PlayerCard from '../PlayerCard';
|
|
10
8
|
import CompetitionCard from '../../Engage/components/CompetitionCard';
|
|
11
9
|
import BracketCompetitionCard from '../../Engage/components/BracketCompetitionCard';
|
|
@@ -13,6 +11,8 @@ import SquaresCompetitionCard from '../../Engage/components/SquaresCompetitionCa
|
|
|
13
11
|
import ArticleCard from '../ArticleCard';
|
|
14
12
|
import PodcastCard from '../PodcastCard';
|
|
15
13
|
import moment from 'moment-mini';
|
|
14
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
15
|
+
import { useColors } from '../../constants/useColors';
|
|
16
16
|
|
|
17
17
|
type CompanyProfileProps = {
|
|
18
18
|
company_id:string,
|
|
@@ -27,7 +27,11 @@ type CompanyProfileProps = {
|
|
|
27
27
|
onBack?:() => void,
|
|
28
28
|
onShareCompany?:(company:CompanyProps) => void
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
const co_profile_sections = ['gap','info','members','podcasts','engage_toggle', 'competitions','feeds']
|
|
30
32
|
const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSelectBracketCompetition, onSelectSquaresCompetition, onArticleSelect, onEvent, onSelectPodcast, onSelectPlayer, onBack, onShareCompany }:CompanyProfileProps) => {
|
|
33
|
+
const Colors = useColors();
|
|
34
|
+
|
|
31
35
|
const [ module_size, setModuleSize ] = useState({ height:700, width:300 });
|
|
32
36
|
const [ podcast_data, setPodcastData ] = useState<{
|
|
33
37
|
podcast_loading:boolean,
|
|
@@ -48,7 +52,7 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
48
52
|
company_loading: false,
|
|
49
53
|
company_members: [],
|
|
50
54
|
players:[],
|
|
51
|
-
active_toggle: '
|
|
55
|
+
active_toggle: 'competitions'
|
|
52
56
|
});
|
|
53
57
|
const { company_loading, company_members, company, players, active_toggle } = company_data;
|
|
54
58
|
|
|
@@ -100,10 +104,10 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
100
104
|
|
|
101
105
|
useEffect(() => {
|
|
102
106
|
switch(active_toggle){
|
|
103
|
-
case '
|
|
107
|
+
case 'competitions':
|
|
104
108
|
getCompsFromServer(company_id, 0);
|
|
105
109
|
return
|
|
106
|
-
case '
|
|
110
|
+
case 'feeds':
|
|
107
111
|
getFeedFromServer(company_id, 0);
|
|
108
112
|
return
|
|
109
113
|
default: return
|
|
@@ -188,12 +192,13 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
188
192
|
const player = players.find(p => p.player_id == data.item.player_id);
|
|
189
193
|
if(!player){ return <></> }
|
|
190
194
|
return (
|
|
191
|
-
<View style={{
|
|
195
|
+
<View float style={{ margin:4 }}>
|
|
192
196
|
<PlayerCard
|
|
193
197
|
player={player}
|
|
194
|
-
width={
|
|
195
|
-
|
|
198
|
+
width={150}
|
|
199
|
+
|
|
196
200
|
alignment='vertical'
|
|
201
|
+
show_follow
|
|
197
202
|
onSelectPlayer={onSelectPlayer}
|
|
198
203
|
onFollowingUpdate={(pf) => console.log(pf)}
|
|
199
204
|
/>
|
|
@@ -206,7 +211,7 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
206
211
|
let article_width = (module_size.width - 60) / 2
|
|
207
212
|
if(article_width > 240){ article_width = 240 }
|
|
208
213
|
return (
|
|
209
|
-
<View style={{
|
|
214
|
+
<View float style={{ margin:4 }}>
|
|
210
215
|
<ArticleCard
|
|
211
216
|
article_feed={article_feed}
|
|
212
217
|
article={data.item}
|
|
@@ -222,7 +227,7 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
222
227
|
let pod_width = (module_size.width) / 3
|
|
223
228
|
if(pod_width > 200){ pod_width = 200 }
|
|
224
229
|
return (
|
|
225
|
-
<View style={{
|
|
230
|
+
<View float style={{ margin:4 }}>
|
|
226
231
|
<PodcastCard
|
|
227
232
|
podcast={data.item}
|
|
228
233
|
width={pod_width}
|
|
@@ -233,16 +238,6 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
233
238
|
)
|
|
234
239
|
}
|
|
235
240
|
|
|
236
|
-
const renderToggles = (data:{ item:string, index:number }) => {
|
|
237
|
-
const active = data.item == active_toggle ? true : false
|
|
238
|
-
return (
|
|
239
|
-
<TouchableOpacity style={{ width: (module_size.width - 65) / 2, padding:15, borderRadius:22, backgroundColor:active?Colors.brand.midnight:'transparent' }}
|
|
240
|
-
onPress={() => setCompanyData({ ...company_data, active_toggle: data.item })}>
|
|
241
|
-
<Text textAlign='center' weight='bold' size={14} color={active ?Colors.shades.white:Colors.brand.midnight}>{data.item}</Text>
|
|
242
|
-
</TouchableOpacity>
|
|
243
|
-
)
|
|
244
|
-
}
|
|
245
|
-
|
|
246
241
|
const renderComps = (data: { item:{ type: 'competition'|'squares_competition'|'bracket_competition', id:string, start_time:any }, index:number }) => {
|
|
247
242
|
switch(data.item.type){
|
|
248
243
|
case 'competition':
|
|
@@ -253,14 +248,15 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
253
248
|
const competition_result_type = competition_result_types.find(ct => ct.competition_result_type_id == competition.competition_result_type_id);
|
|
254
249
|
if(!competition_result_type){ return <></> }
|
|
255
250
|
return (
|
|
256
|
-
<
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
251
|
+
<View float style={{ margin:5 }}>
|
|
252
|
+
<CompetitionCard
|
|
253
|
+
competition={competition}
|
|
254
|
+
company={company}
|
|
255
|
+
competition_type={competition_type}
|
|
256
|
+
competition_result_type={competition_result_type}
|
|
257
|
+
onCompetitionSelect={onSelectCompetition}
|
|
258
|
+
/>
|
|
259
|
+
</View>
|
|
264
260
|
)
|
|
265
261
|
case 'bracket_competition':
|
|
266
262
|
const bracket_competition = bracket_competitions.find(bc => bc.bracket_competition_id == data.item.id);
|
|
@@ -270,102 +266,101 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
270
266
|
const bracket = brackets.find(b => b.bracket_id == bracket_competition.bracket_id);
|
|
271
267
|
const league = leagues.find(l => l.league_id == bracket?.league_id);
|
|
272
268
|
return (
|
|
273
|
-
<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
269
|
+
<View float style={{ margin:5 }}>
|
|
270
|
+
<BracketCompetitionCard
|
|
271
|
+
bracket_competition={bracket_competition}
|
|
272
|
+
competition_result_type={crt}
|
|
273
|
+
company={company}
|
|
274
|
+
bracket={bracket}
|
|
275
|
+
league={league}
|
|
276
|
+
onCompetitionSelect={onSelectBracketCompetition}
|
|
277
|
+
/>
|
|
278
|
+
</View>
|
|
281
279
|
)
|
|
282
280
|
case 'squares_competition':
|
|
283
281
|
const squares_competition = squares_competitions.find(sc => sc.sq_comp_id == data.item.id);
|
|
284
282
|
if(!squares_competition){ return <></> }
|
|
285
283
|
const event = events.find(e => e.event_id == squares_competition.event_id);
|
|
286
284
|
return (
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
285
|
+
<View float style={{ margin:5 }}>
|
|
286
|
+
<SquaresCompetitionCard
|
|
287
|
+
squares_competition={squares_competition}
|
|
288
|
+
onSelectCompetition={onSelectSquaresCompetition}
|
|
289
|
+
company={company}
|
|
290
|
+
event={event}
|
|
291
|
+
/>
|
|
292
|
+
</View>
|
|
293
293
|
)
|
|
294
294
|
default: return <></>
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
resizeMode='cover'
|
|
317
|
-
/>
|
|
318
|
-
</View>
|
|
319
|
-
<ScrollView style={{ flex:1 }}>
|
|
320
|
-
<View style={{ ...view_styles.section, marginTop:module_size.width - 150 }}>
|
|
321
|
-
<View style={{ ...view_styles.section_header }}>
|
|
322
|
-
<View style={{ flex:1, marginRight:10 }}>
|
|
323
|
-
<Text theme='header'>{company.company_name}</Text>
|
|
324
|
-
<Text style={{ marginTop:4 }} theme='body_2'>{company.company_description}</Text>
|
|
325
|
-
</View>
|
|
326
|
-
<View style={{ backgroundColor:Colors.highlights.highlight500, padding:10, borderRadius:22 }}>
|
|
327
|
-
<Text size={10} weight='bold' color={Colors.shades.white} textAlign='center'>{company.type.toUpperCase()}</Text>
|
|
297
|
+
|
|
298
|
+
const renderSections = (data: { item:string, index:number }) => {
|
|
299
|
+
switch(data.item){
|
|
300
|
+
case 'gap':
|
|
301
|
+
return (
|
|
302
|
+
<View transparent style={{ height:300 }} />
|
|
303
|
+
)
|
|
304
|
+
case 'info':
|
|
305
|
+
if(!company){ return <></> }
|
|
306
|
+
return (
|
|
307
|
+
<View style={{ borderTopRightRadius: 22, borderTopLeftRadius:22 }}>
|
|
308
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:20, borderTopRightRadius: 22, borderTopLeftRadius:22 }}>
|
|
309
|
+
<View transparent style={{ flex:1 }}>
|
|
310
|
+
<Text theme='h1'>{company.company_name}</Text>
|
|
311
|
+
<Text style={{ marginTop:4 }} theme='description'>{company.company_description}</Text>
|
|
312
|
+
</View>
|
|
313
|
+
<Button disabled style={{ backgroundColor:Colors.absolutes.highlights.highlight500 }}>
|
|
314
|
+
<Text size={10} theme='h1' color={Colors.text.white} textAlign='center'>{company.type.toUpperCase()}</Text>
|
|
315
|
+
</Button>
|
|
328
316
|
</View>
|
|
329
317
|
</View>
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
318
|
+
)
|
|
319
|
+
case 'members':
|
|
320
|
+
if(!company){ return <></> }
|
|
321
|
+
return (
|
|
322
|
+
<View>
|
|
323
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:20 }}>
|
|
324
|
+
<View transparent>
|
|
325
|
+
<Text theme='h1'>Members</Text>
|
|
326
|
+
<Text style={{ marginTop:3 }} theme='description'>The following are members of {company.company_name}</Text>
|
|
327
|
+
</View>
|
|
328
|
+
<View transparent style={{ padding:10, flex:1, alignItems:'flex-end' }}>
|
|
329
|
+
<Text theme='h1'>{company_members.length}</Text>
|
|
330
|
+
</View>
|
|
339
331
|
</View>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
332
|
+
<View type='body' style={{ padding:10 }}>
|
|
333
|
+
<View type='row'>
|
|
334
|
+
<View style={{ flex:1 }}>
|
|
335
|
+
<FlatList
|
|
336
|
+
key='company_members'
|
|
337
|
+
horizontal
|
|
338
|
+
showsHorizontalScrollIndicator={false}
|
|
339
|
+
data={company_members}
|
|
340
|
+
renderItem={renderMembers}
|
|
341
|
+
keyExtractor={(item) => item.player_id.toString()}
|
|
342
|
+
/>
|
|
343
|
+
</View>
|
|
352
344
|
</View>
|
|
353
345
|
</View>
|
|
354
346
|
</View>
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
347
|
+
)
|
|
348
|
+
case 'podcasts':
|
|
349
|
+
if(!company){ return <></> }
|
|
350
|
+
if(podcasts.length == 0){ return <></> }
|
|
351
|
+
return (
|
|
352
|
+
<View>
|
|
353
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:20 }}>
|
|
354
|
+
<View transparent style={{ flex:1 }}>
|
|
355
|
+
<Text theme='h1'>Podcasts</Text>
|
|
356
|
+
<Text style={{ marginTop:3 }} theme='description'>The following are podcasts hosted by {company.company_name}</Text>
|
|
357
|
+
</View>
|
|
358
|
+
<View transparent style={{ padding:10 }}>
|
|
359
|
+
<Text theme='h2'>{podcasts.length}</Text>
|
|
365
360
|
</View>
|
|
366
361
|
</View>
|
|
367
|
-
<View style={{
|
|
368
|
-
<View
|
|
362
|
+
<View type='body' style={{ padding:10 }}>
|
|
363
|
+
<View type='row'>
|
|
369
364
|
<View style={{ flex:1 }}>
|
|
370
365
|
<FlatList
|
|
371
366
|
key='company_pods'
|
|
@@ -379,69 +374,100 @@ const CompanyProfile = ({ company_id, padding_insets, onSelectCompetition, onSel
|
|
|
379
374
|
</View>
|
|
380
375
|
</View>
|
|
381
376
|
</View>
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
<
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
<View style={{ ...view_styles.body_row, margin:10, marginLeft:20, marginRight:20, borderRadius:22, padding:1, backgroundColor:Colors.shades.shade100 }}>
|
|
392
|
-
<FlatList
|
|
393
|
-
key={'toggles'}
|
|
394
|
-
horizontal
|
|
395
|
-
showsHorizontalScrollIndicator={false}
|
|
396
|
-
data={['Comps', 'Feeds']}
|
|
397
|
-
renderItem={renderToggles}
|
|
398
|
-
keyExtractor={(item) => item}
|
|
399
|
-
/>
|
|
377
|
+
)
|
|
378
|
+
case 'engage_toggle':
|
|
379
|
+
return (
|
|
380
|
+
<View>
|
|
381
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
|
|
382
|
+
<View transparent style={{flex:1, paddingLeft:10}}>
|
|
383
|
+
<Text theme='h1'>Engage with {company?.company_name}</Text>
|
|
384
|
+
<Text style={{ marginTop:3 }} theme='description'>Use the toggle to find ways to engage</Text>
|
|
385
|
+
</View>
|
|
400
386
|
</View>
|
|
401
|
-
{
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
renderItem={renderComps}
|
|
410
|
-
keyExtractor={(item) => `${item.id}:${item.type}`}
|
|
387
|
+
<View style={{ padding:10 }}>
|
|
388
|
+
<Toggle
|
|
389
|
+
options={[
|
|
390
|
+
{ key: 'competitions', label: 'Comps' },
|
|
391
|
+
{ key: 'feeds', label: 'Feeds' }
|
|
392
|
+
]}
|
|
393
|
+
selected_option={active_toggle}
|
|
394
|
+
onSelectOption={(option) => setCompanyData({ ...company_data, active_toggle: option })}
|
|
411
395
|
/>
|
|
412
396
|
</View>
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
})}
|
|
422
|
-
</View>
|
|
423
|
-
</View>
|
|
397
|
+
</View>
|
|
398
|
+
)
|
|
399
|
+
case 'competitions':
|
|
400
|
+
if(active_toggle != 'competitions'){ return <></> }
|
|
401
|
+
return (
|
|
402
|
+
<View style={{ padding:10 }}>
|
|
403
|
+
{competition_loading ?
|
|
404
|
+
<ActivityIndicator size='large' color={Colors.text.h1} style={{ padding:20, alignSelf:'center' }} />
|
|
424
405
|
:<></>}
|
|
406
|
+
<FlatList
|
|
407
|
+
key={'comps_list'}
|
|
408
|
+
data={sorted_comps.sort((a,b) => a.start_time.unix() - b.start_time.unix())}
|
|
409
|
+
renderItem={renderComps}
|
|
410
|
+
keyExtractor={(item) => `${item.id}:${item.type}`}
|
|
411
|
+
/>
|
|
425
412
|
</View>
|
|
426
|
-
|
|
427
|
-
|
|
413
|
+
)
|
|
414
|
+
case 'feeds':
|
|
415
|
+
if(active_toggle!='feeds'){ return <></> }
|
|
416
|
+
return (
|
|
417
|
+
<View style={{ padding:10 }}>
|
|
418
|
+
{feed_loading ?
|
|
419
|
+
<ActivityIndicator size='large' color={Colors.text.h1} style={{ padding:20, alignSelf:'center' }} />
|
|
420
|
+
:<></>}
|
|
421
|
+
<View style={{ flexDirection:'row', flexWrap:'wrap', justifyContent:'center' }}>
|
|
422
|
+
{articles.sort((a,b) => moment(b.create_datetime).unix() - moment(a.create_datetime).unix()).map((a,i) => {
|
|
423
|
+
return renderArticles({ item: a, index:i })
|
|
424
|
+
})}
|
|
425
|
+
</View>
|
|
426
|
+
</View>
|
|
427
|
+
)
|
|
428
|
+
default: return <></>
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return (
|
|
433
|
+
<View style={{ flex:1 }} onLayout={(ev) => {
|
|
434
|
+
const { height, width } = ev.nativeEvent.layout
|
|
435
|
+
setModuleSize({ width, height });
|
|
436
|
+
}}>
|
|
437
|
+
<View style={{ position:'absolute', top:0, left:0, right:0, alignItems:'center' }} nativeID='profile_image'>
|
|
438
|
+
<Image
|
|
439
|
+
source={{ uri: company?.company_image?.url }}
|
|
440
|
+
style={{ width: module_size.width, height: module_size.width, borderBottomRightRadius:50, borderBottomLeftRadius:50, backgroundColor:Colors.text.white }}
|
|
441
|
+
resizeMode='cover'
|
|
442
|
+
/>
|
|
443
|
+
</View>
|
|
444
|
+
<FlatList
|
|
445
|
+
data={co_profile_sections}
|
|
446
|
+
key='co_profile_sections_list'
|
|
447
|
+
keyExtractor={(item) => item}
|
|
448
|
+
onRefresh={() => getCompanyDataFromServer(company_id)}
|
|
449
|
+
refreshing={company_loading}
|
|
450
|
+
renderItem={renderSections}
|
|
451
|
+
/>
|
|
428
452
|
{onBack ?
|
|
429
|
-
<
|
|
430
|
-
|
|
453
|
+
<Button
|
|
454
|
+
float
|
|
455
|
+
style={{ position:'absolute', top:padding_insets?.top ?? 0, left:0, height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center' }}
|
|
431
456
|
onPress={() => onBack()}>
|
|
432
|
-
<Icons.ChevronIcon direction='left' color={Colors.
|
|
433
|
-
</
|
|
457
|
+
<Icons.ChevronIcon direction='left' color={Colors.text.h1} size={14} />
|
|
458
|
+
</Button>
|
|
434
459
|
:<></>}
|
|
435
|
-
{onShareCompany?
|
|
436
|
-
<
|
|
437
|
-
|
|
460
|
+
{company && onShareCompany?
|
|
461
|
+
<Button
|
|
462
|
+
float
|
|
463
|
+
style={{ position:'absolute', top:padding_insets?.top ?? 0, right:0, height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center' }}
|
|
438
464
|
onPress={() => onShareCompany(company)}>
|
|
439
|
-
<Icons.ShareIcon color={Colors.
|
|
440
|
-
</
|
|
465
|
+
<Icons.ShareIcon color={Colors.text.h1} size={14} />
|
|
466
|
+
</Button>
|
|
441
467
|
:<></>}
|
|
442
468
|
</View>
|
|
443
|
-
</View>
|
|
444
469
|
)
|
|
445
470
|
}
|
|
446
471
|
|
|
447
|
-
export default CompanyProfile
|
|
472
|
+
export default CompanyProfile
|
|
473
|
+
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PlayerFollowerProps, PublicPlayerProps } from "../types";
|
|
3
|
-
import { Image,
|
|
4
|
-
import Colors from '../constants/colors';
|
|
5
|
-
import { Text } from '../Components';
|
|
6
|
-
import { view_styles } from '../constants/styles';
|
|
3
|
+
import { Image, StyleSheet } from 'react-native';
|
|
7
4
|
import PlayerFollowButton from './PlayerFollowButton';
|
|
5
|
+
import { Button, Text, View } from '../Components/Themed';
|
|
6
|
+
import { useColors } from '../constants/useColors';
|
|
8
7
|
|
|
9
8
|
type PlayerCardProps = {
|
|
10
9
|
player:PublicPlayerProps,
|
|
@@ -15,20 +14,16 @@ type PlayerCardProps = {
|
|
|
15
14
|
player_following?:PlayerFollowerProps,
|
|
16
15
|
show_follow?:boolean,
|
|
17
16
|
style?:any,
|
|
18
|
-
|
|
19
|
-
float?:boolean,
|
|
20
|
-
onSelectPlayer:(p:PublicPlayerProps) => void,
|
|
17
|
+
onSelectPlayer?:(p:PublicPlayerProps) => void,
|
|
21
18
|
onFollowingUpdate:(pf:PlayerFollowerProps) => void
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
const PlayerCard = ({ player, width,
|
|
25
|
-
|
|
21
|
+
const PlayerCard = ({ player, width, follow_loading, alignment, style, show_follow, player_follower, player_following, onSelectPlayer, onFollowingUpdate }:PlayerCardProps) => {
|
|
22
|
+
const Colors = useColors();
|
|
26
23
|
let player_style = alignment == 'vertical' ? local_styles.player_vertical : local_styles.player_horizontal;
|
|
27
|
-
let container_style = { ...local_styles.container }
|
|
28
|
-
if(float){ container_style = { ...container_style, ...view_styles.float } }
|
|
29
24
|
return (
|
|
30
|
-
<View style={{ ...
|
|
31
|
-
<
|
|
25
|
+
<View style={{ ...style, borderColor:Colors.borders.light, borderRadius:8 }}>
|
|
26
|
+
<Button disabled={!onSelectPlayer} style={player_style} onPress={() => onSelectPlayer ? onSelectPlayer(player): console.log('')}>
|
|
32
27
|
{alignment == 'vertical' ?
|
|
33
28
|
<View>
|
|
34
29
|
<Image
|
|
@@ -46,12 +41,12 @@ const PlayerCard = ({ player, width, border, follow_loading, alignment, style, f
|
|
|
46
41
|
/>
|
|
47
42
|
</View>
|
|
48
43
|
}
|
|
49
|
-
<View style={{
|
|
50
|
-
<Text size={14}
|
|
51
|
-
<Text style={{ marginTop:4 }} size={14}
|
|
44
|
+
<View style={{ flexGrow:1, padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
45
|
+
<Text size={14} theme='h1' textAlign={alignment == 'vertical' ? 'center' : 'left'}>{player.first_name} {player.last_name}</Text>
|
|
46
|
+
<Text style={{ marginTop:4 }} size={14} theme='description' textAlign={alignment == 'vertical' ? 'center' : 'left'}>@{player.username}</Text>
|
|
52
47
|
</View>
|
|
53
48
|
{show_follow ?
|
|
54
|
-
<View style={{ padding:10, paddingTop:alignment=='vertical'?0:10 }}>
|
|
49
|
+
<View style={{ padding:10, paddingTop:alignment=='vertical'?0:10, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
|
|
55
50
|
<PlayerFollowButton
|
|
56
51
|
loading={follow_loading}
|
|
57
52
|
player_id={player.player_id}
|
|
@@ -61,26 +56,23 @@ const PlayerCard = ({ player, width, border, follow_loading, alignment, style, f
|
|
|
61
56
|
/>
|
|
62
57
|
</View>
|
|
63
58
|
:<></>}
|
|
64
|
-
</
|
|
59
|
+
</Button>
|
|
65
60
|
</View>
|
|
66
61
|
)
|
|
67
62
|
}
|
|
68
63
|
|
|
69
64
|
const local_styles = StyleSheet.create({
|
|
70
|
-
container: {
|
|
71
|
-
flex:1,
|
|
72
|
-
backgroundColor:Colors.shades.white,
|
|
73
|
-
borderRadius:8
|
|
74
|
-
},
|
|
75
65
|
player_vertical: {
|
|
76
66
|
flex:1,
|
|
77
67
|
flexDirection:'column',
|
|
68
|
+
padding:0
|
|
78
69
|
//alignItems:'center'
|
|
79
70
|
},
|
|
80
71
|
player_horizontal: {
|
|
81
72
|
flex:1,
|
|
82
73
|
flexDirection: 'row',
|
|
83
|
-
alignItems:'center'
|
|
74
|
+
alignItems:'center',
|
|
75
|
+
padding:0
|
|
84
76
|
}
|
|
85
77
|
})
|
|
86
78
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
3
|
import { SocialComponentApi } from './api';
|
|
4
4
|
import PlayerCard from './PlayerCard';
|
|
5
5
|
import type { PlayerFollowerProps, PublicPlayerProps } from '../types';
|
|
6
|
+
import { View } from '../Components/Themed';
|
|
6
7
|
|
|
7
8
|
type PlayerListProps = {
|
|
8
9
|
players:PublicPlayerProps[],
|
|
9
10
|
style?: any,
|
|
10
|
-
onPlayerSelect
|
|
11
|
+
onPlayerSelect?:(p:PublicPlayerProps) => void,
|
|
11
12
|
options: {
|
|
12
13
|
follow_status?:boolean,
|
|
13
14
|
direction: 'horizontal' | 'vertical',
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
const PlayerList = ({ players,
|
|
18
|
+
const PlayerList = ({ players, options, onPlayerSelect }:PlayerListProps) => {
|
|
18
19
|
const [ size, setSize ] = useState({ width: 0, height:0 });
|
|
19
20
|
const [ follow_status_loading, setFollowStatusLoading ] = useState(false);
|
|
20
21
|
const [ player_followers, setPlayerFollowers ] = useState<PlayerFollowerProps[]>([]);
|
|
@@ -32,7 +33,6 @@ const PlayerList = ({ players, style, options, onPlayerSelect }:PlayerListProps)
|
|
|
32
33
|
if(follow_status){
|
|
33
34
|
setFollowStatusLoading(true);
|
|
34
35
|
const player_followers = await SocialComponentApi.getBulkPlayerfollowers(players.map(p => p.player_id));
|
|
35
|
-
console.log(player_followers)
|
|
36
36
|
setPlayerFollowers(player_followers)
|
|
37
37
|
setFollowStatusLoading(false);
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ const PlayerList = ({ players, style, options, onPlayerSelect }:PlayerListProps)
|
|
|
41
41
|
const alignment = direction == 'vertical' ? 'horizontal' : 'vertical'
|
|
42
42
|
const player_width = direction == 'vertical' ? size.width - 20: (size.width - 40) / 2
|
|
43
43
|
return (
|
|
44
|
-
<View style={{
|
|
44
|
+
<View style={{ flex:1, ...new_style }} onLayout={(ev) => {
|
|
45
45
|
const { width, height } = ev.nativeEvent.layout
|
|
46
46
|
setSize({ width, height })
|
|
47
47
|
}}>
|
|
@@ -49,12 +49,11 @@ const PlayerList = ({ players, style, options, onPlayerSelect }:PlayerListProps)
|
|
|
49
49
|
let following = player_followers.find(pf => pf.following_id == p.player_id);
|
|
50
50
|
let follower = player_followers.find(pf => pf.player_id == p.player_id);
|
|
51
51
|
return (
|
|
52
|
-
<View key={p.player_id.toString()} style={{ width: player_width, margin:8 }}>
|
|
52
|
+
<View float key={p.player_id.toString()} style={{ width: player_width, margin:8, borderBottomLeftRadius:8, borderBottomRightRadius:8 }}>
|
|
53
53
|
<PlayerCard
|
|
54
54
|
width={player_width}
|
|
55
55
|
style={{ borderRadius:8 }}
|
|
56
56
|
player={p}
|
|
57
|
-
float={true}
|
|
58
57
|
alignment={alignment}
|
|
59
58
|
player_following={following}
|
|
60
59
|
player_follower={follower}
|