be-components 2.3.6 → 2.4.0
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/Engage/components/CompanyCard.js +26 -2
- package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -1
- package/lib/commonjs/Engage/components/EngageHeader.js +6 -2
- package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -1
- package/lib/commonjs/Engage/index.js +6 -2
- package/lib/commonjs/Engage/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/ArticleCard.js +73 -0
- package/lib/commonjs/SocialComponents/ArticleCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/CompanyProfile/api/index.js +175 -0
- package/lib/commonjs/SocialComponents/CompanyProfile/api/index.js.map +1 -0
- package/lib/commonjs/SocialComponents/CompanyProfile/index.js +592 -0
- package/lib/commonjs/SocialComponents/CompanyProfile/index.js.map +1 -0
- package/lib/commonjs/SocialComponents/PodcastCard.js +53 -0
- package/lib/commonjs/SocialComponents/PodcastCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/PodcastEpisodeCard.js +63 -0
- package/lib/commonjs/SocialComponents/PodcastEpisodeCard.js.map +1 -0
- package/lib/commonjs/SocialComponents/PodcastModule/api/index.js +53 -0
- package/lib/commonjs/SocialComponents/PodcastModule/api/index.js.map +1 -0
- package/lib/commonjs/SocialComponents/PodcastModule/index.js +242 -0
- package/lib/commonjs/SocialComponents/PodcastModule/index.js.map +1 -0
- package/lib/commonjs/SocialComponents/api/index.js +23 -1
- package/lib/commonjs/SocialComponents/api/index.js.map +1 -1
- package/lib/commonjs/SocialComponents/index.js +14 -0
- package/lib/commonjs/SocialComponents/index.js.map +1 -1
- package/lib/module/Engage/components/CompanyCard.js +24 -2
- package/lib/module/Engage/components/CompanyCard.js.map +1 -1
- package/lib/module/Engage/components/EngageHeader.js +6 -2
- package/lib/module/Engage/components/EngageHeader.js.map +1 -1
- package/lib/module/Engage/index.js +6 -2
- package/lib/module/Engage/index.js.map +1 -1
- package/lib/module/SocialComponents/ArticleCard.js +66 -0
- package/lib/module/SocialComponents/ArticleCard.js.map +1 -0
- package/lib/module/SocialComponents/CompanyProfile/api/index.js +169 -0
- package/lib/module/SocialComponents/CompanyProfile/api/index.js.map +1 -0
- package/lib/module/SocialComponents/CompanyProfile/index.js +583 -0
- package/lib/module/SocialComponents/CompanyProfile/index.js.map +1 -0
- package/lib/module/SocialComponents/PodcastCard.js +46 -0
- package/lib/module/SocialComponents/PodcastCard.js.map +1 -0
- package/lib/module/SocialComponents/PodcastEpisodeCard.js +56 -0
- package/lib/module/SocialComponents/PodcastEpisodeCard.js.map +1 -0
- package/lib/module/SocialComponents/PodcastModule/api/index.js +47 -0
- package/lib/module/SocialComponents/PodcastModule/api/index.js.map +1 -0
- package/lib/module/SocialComponents/PodcastModule/index.js +233 -0
- package/lib/module/SocialComponents/PodcastModule/index.js.map +1 -0
- package/lib/module/SocialComponents/api/index.js +23 -1
- package/lib/module/SocialComponents/api/index.js.map +1 -1
- package/lib/module/SocialComponents/index.js +3 -1
- package/lib/module/SocialComponents/index.js.map +1 -1
- package/lib/typescript/src/Engage/components/CompanyCard.d.ts +4 -2
- package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -1
- package/lib/typescript/src/Engage/components/EngageHeader.d.ts +4 -2
- package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -1
- package/lib/typescript/src/Engage/index.d.ts +4 -2
- package/lib/typescript/src/Engage/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/ArticleCard.d.ts +12 -0
- package/lib/typescript/src/SocialComponents/ArticleCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/CompanyProfile/api/index.d.ts +34 -0
- package/lib/typescript/src/SocialComponents/CompanyProfile/api/index.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/CompanyProfile/index.d.ts +19 -0
- package/lib/typescript/src/SocialComponents/CompanyProfile/index.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/PodcastCard.d.ts +10 -0
- package/lib/typescript/src/SocialComponents/PodcastCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/PodcastEpisodeCard.d.ts +11 -0
- package/lib/typescript/src/SocialComponents/PodcastEpisodeCard.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/PodcastModule/api/index.d.ts +9 -0
- package/lib/typescript/src/SocialComponents/PodcastModule/api/index.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/PodcastModule/index.d.ts +14 -0
- package/lib/typescript/src/SocialComponents/PodcastModule/index.d.ts.map +1 -0
- package/lib/typescript/src/SocialComponents/api/index.d.ts +6 -2
- package/lib/typescript/src/SocialComponents/api/index.d.ts.map +1 -1
- package/lib/typescript/src/SocialComponents/index.d.ts +3 -1
- package/lib/typescript/src/SocialComponents/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Engage/components/CompanyCard.tsx +27 -5
- package/src/Engage/components/EngageHeader.tsx +6 -2
- package/src/Engage/index.tsx +6 -2
- package/src/SocialComponents/ArticleCard.tsx +54 -0
- package/src/SocialComponents/CompanyProfile/api/index.ts +151 -0
- package/src/SocialComponents/CompanyProfile/index.tsx +438 -0
- package/src/SocialComponents/PodcastCard.tsx +31 -0
- package/src/SocialComponents/PodcastEpisodeCard.tsx +41 -0
- package/src/SocialComponents/PodcastModule/api/index.ts +44 -0
- package/src/SocialComponents/PodcastModule/index.tsx +161 -0
- package/src/SocialComponents/api/index.ts +18 -3
- package/src/SocialComponents/index.tsx +5 -2
- package/src/types.d.ts +99 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, ActivityIndicator, Image, ScrollView, TouchableOpacity } from "react-native"
|
|
3
|
+
import type { PodcastEpisodesProps, PodcastProps, PublicPlayerProps } from '../../types';
|
|
4
|
+
import { PodcastApi } from './api';
|
|
5
|
+
import Colors from '../../constants/colors';
|
|
6
|
+
import { SocialPodcastHelpers } from '../api';
|
|
7
|
+
import { view_styles } from '../../constants/styles';
|
|
8
|
+
import { Button, Icons, Text } from '../../Components';
|
|
9
|
+
import PodcastEpisodeCard from '../PodcastEpisodeCard';
|
|
10
|
+
import moment from 'moment-mini';
|
|
11
|
+
|
|
12
|
+
type PodcastModuleProps = {
|
|
13
|
+
podcast_id:string,
|
|
14
|
+
padding_insets?:{ top:number, bottom:number },
|
|
15
|
+
onBack?:() => void,
|
|
16
|
+
onSelectEpisode:(pe:PodcastEpisodesProps) => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const PodcastModule = ({ podcast_id, padding_insets, onSelectEpisode, onBack }:PodcastModuleProps) => {
|
|
20
|
+
const [ module_size, setModuleSize ] = useState({ height:700, width:330 });
|
|
21
|
+
const [ pod_data, setPodData ] = useState<{
|
|
22
|
+
loading:boolean,
|
|
23
|
+
episodes_loading:boolean,
|
|
24
|
+
podcast?:PodcastProps,
|
|
25
|
+
podcast_episodes:PodcastEpisodesProps[],
|
|
26
|
+
players:PublicPlayerProps[],
|
|
27
|
+
episodes_offset:number
|
|
28
|
+
}>({
|
|
29
|
+
loading:false,
|
|
30
|
+
episodes_loading: false,
|
|
31
|
+
podcast_episodes:[],
|
|
32
|
+
players:[],
|
|
33
|
+
episodes_offset:0
|
|
34
|
+
});
|
|
35
|
+
const { loading, episodes_loading, podcast, podcast_episodes, episodes_offset } = pod_data;
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
PodcastApi.setEnvironment();
|
|
39
|
+
getPodDataFromServer(podcast_id, 0);
|
|
40
|
+
},[podcast_id]);
|
|
41
|
+
|
|
42
|
+
const getPodDataFromServer = async(id:string, offset:number) => {
|
|
43
|
+
setPodData({ ...pod_data, loading:true });
|
|
44
|
+
const pod = await PodcastApi.getPodcastById(id);
|
|
45
|
+
const pod_ep = await PodcastApi.getPodcastEpisodesByPodcast(id, offset);
|
|
46
|
+
const ps = await PodcastApi.getPlayersByPlayerIds(pod?.player_ids);
|
|
47
|
+
setPodData({
|
|
48
|
+
...pod_data,
|
|
49
|
+
loading: false,
|
|
50
|
+
episodes_loading: false,
|
|
51
|
+
podcast: pod,
|
|
52
|
+
players:ps,
|
|
53
|
+
podcast_episodes: pod_ep,
|
|
54
|
+
episodes_offset:offset
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const getEpisdoesFromServer = async(id:string, offset:number) => {
|
|
59
|
+
setPodData({ ...pod_data, episodes_loading: true });
|
|
60
|
+
const pod_eps = await PodcastApi.getPodcastEpisodesByPodcast(id, offset);
|
|
61
|
+
setPodData({
|
|
62
|
+
...pod_data,
|
|
63
|
+
episodes_loading: false,
|
|
64
|
+
podcast_episodes: pod_eps,
|
|
65
|
+
episodes_offset: offset
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const renderEpsidoes = (data: { item:PodcastEpisodesProps, index:number }) => {
|
|
70
|
+
const ep_width = (module_size.width - 60) / 2
|
|
71
|
+
return (
|
|
72
|
+
<View>
|
|
73
|
+
<PodcastEpisodeCard
|
|
74
|
+
podcast_episode={data.item}
|
|
75
|
+
width={ep_width}
|
|
76
|
+
onSelectEpisode={onSelectEpisode}
|
|
77
|
+
/>
|
|
78
|
+
</View>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if(!podcast || loading){
|
|
83
|
+
return (
|
|
84
|
+
<View style={{ flex:1 }}>
|
|
85
|
+
<ActivityIndicator style={{ padding:20, alignSelf: 'center' }} size='large' color={Colors.brand.midnight} />
|
|
86
|
+
</View>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<View style={{ flex:1 }}>
|
|
92
|
+
<View style={{ flex:1, backgroundColor:Colors.shades.black_faded }} onLayout={(ev) => {
|
|
93
|
+
const { height, width } = ev.nativeEvent.layout
|
|
94
|
+
setModuleSize({ width, height });
|
|
95
|
+
}}>
|
|
96
|
+
<View style={{ position:'absolute', top:0, left:0, right:0 }} nativeID='profile_image'>
|
|
97
|
+
<Image
|
|
98
|
+
source={{ uri: SocialPodcastHelpers.getPodcastImage(podcast) }}
|
|
99
|
+
style={{ width: module_size.width, height: module_size.width, borderBottomRightRadius:50, borderBottomLeftRadius:50 }}
|
|
100
|
+
resizeMode='cover'
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
</View>
|
|
104
|
+
<ScrollView style={{ flex:1 }}>
|
|
105
|
+
<View style={{ ...view_styles.section, marginTop:module_size.width - 150 }}>
|
|
106
|
+
<View style={{ ...view_styles.section_header }}>
|
|
107
|
+
<View style={{ flex:1 }}>
|
|
108
|
+
<Text theme='header'>{podcast.title}</Text>
|
|
109
|
+
<Text style={{ marginTop:4 }} theme='body_2'>{podcast.description_override ?? podcast.description}</Text>
|
|
110
|
+
</View>
|
|
111
|
+
</View>
|
|
112
|
+
</View>
|
|
113
|
+
<View style={{ ...view_styles.section }}>
|
|
114
|
+
<View style={{ ...view_styles.section_header }}>
|
|
115
|
+
<View style={{ flex:1 }}>
|
|
116
|
+
<Text theme='header'>Episodes</Text>
|
|
117
|
+
<Text style={{ marginTop:3 }} theme='body_2'>Select an episode below to listed to it!</Text>
|
|
118
|
+
</View>
|
|
119
|
+
</View>
|
|
120
|
+
<View style={{ ...view_styles.section_body, padding:0 }}>
|
|
121
|
+
<View style={{ ...view_styles.body_row }}>
|
|
122
|
+
{episodes_offset > 0 ?
|
|
123
|
+
<Button
|
|
124
|
+
title='PREV'
|
|
125
|
+
title_color={Colors.brand.electric}
|
|
126
|
+
backgroundColor='transparent'
|
|
127
|
+
onPress={() => getEpisdoesFromServer(podcast_id, episodes_offset - 1)}
|
|
128
|
+
/>
|
|
129
|
+
:<View/>}
|
|
130
|
+
<View style={{ flex:1 }} />
|
|
131
|
+
<Button
|
|
132
|
+
title='NEXT'
|
|
133
|
+
title_color={Colors.brand.electric}
|
|
134
|
+
backgroundColor='transparent'
|
|
135
|
+
onPress={() => getEpisdoesFromServer(podcast_id, episodes_offset + 1)}
|
|
136
|
+
/>
|
|
137
|
+
</View>
|
|
138
|
+
{episodes_loading ?
|
|
139
|
+
<ActivityIndicator style={{ padding:20, alignSelf:'center' }} size='large' color={Colors.brand.midnight} />
|
|
140
|
+
:<></>}
|
|
141
|
+
<View style={{ flexDirection:'row', flexWrap: 'wrap' }}>
|
|
142
|
+
{podcast_episodes.sort((a,b) => moment(a.publish_date).unix() - moment(b.publish_date).unix()).map((e,i) => {
|
|
143
|
+
return renderEpsidoes({ item:e, index:i })
|
|
144
|
+
})}
|
|
145
|
+
</View>
|
|
146
|
+
</View>
|
|
147
|
+
</View>
|
|
148
|
+
</ScrollView>
|
|
149
|
+
{onBack ?
|
|
150
|
+
<TouchableOpacity
|
|
151
|
+
style={{ position:'absolute', top:padding_insets?.top ?? 0, left:0, ...view_styles.section, backgroundColor:Colors.shades.shade100, height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center' }}
|
|
152
|
+
onPress={() => onBack()}>
|
|
153
|
+
<Icons.ChevronIcon direction='left' color={Colors.brand.midnight} size={14} />
|
|
154
|
+
</TouchableOpacity>
|
|
155
|
+
:<></>}
|
|
156
|
+
</View>
|
|
157
|
+
</View>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export default PodcastModule
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { APIOverrides } from "../../ApiOverrides";
|
|
3
|
-
import type { AthleteProps, EventProps, LeagueProps, MatchProps, OrderProps, PlayerFollowerProps, PostReactionProps, TeamProps, TournamentProps } from "../../types";
|
|
3
|
+
import type { AthleteProps, EventProps, LeagueProps, MatchProps, OrderProps, PlayerFollowerProps, PodcastEpisodesProps, PodcastProps, PostReactionProps, TeamProps, TournamentProps } from "../../types";
|
|
4
4
|
import Colors from "../../constants/colors";
|
|
5
5
|
import moment from "moment-mini";
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ let SOCIAL_SVC_API = '';
|
|
|
8
8
|
let EVENT_SVC_API = '';
|
|
9
9
|
let MK_SVC_API = '';
|
|
10
10
|
|
|
11
|
-
export { SocialComponentApi, SocialOrderHelpers }
|
|
11
|
+
export { SocialComponentApi, SocialOrderHelpers, SocialPodcastHelpers }
|
|
12
12
|
|
|
13
13
|
const SocialComponentApi = {
|
|
14
14
|
setEnvironment: () => {
|
|
@@ -184,5 +184,20 @@ const SocialOrderHelpers = {
|
|
|
184
184
|
if(decimals){ new_odds = odds.toFixed(decimals) }
|
|
185
185
|
if(odds < 0){ return `${new_odds}` }
|
|
186
186
|
return `+${new_odds}`
|
|
187
|
-
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const SocialPodcastHelpers = {
|
|
191
|
+
getPodcastImage: (podcast:PodcastProps):string => {
|
|
192
|
+
let image_source = podcast.image_override?.url
|
|
193
|
+
if(!image_source){ image_source = podcast.image?.url }
|
|
194
|
+
if(image_source && image_source !== ''){ return image_source }
|
|
195
|
+
return 'https://res.cloudinary.com/hoabts6mc/image/upload/v1728494579/default_pod_nji5sk.webp'
|
|
196
|
+
},
|
|
197
|
+
getEpisodeImage: (podcast_episode:PodcastEpisodesProps):string => {
|
|
198
|
+
let image_source = podcast_episode.image_override?.url
|
|
199
|
+
if(!image_source){ image_source = podcast_episode.image?.url }
|
|
200
|
+
if(image_source && image_source != ''){ return image_source }
|
|
201
|
+
return 'https://res.cloudinary.com/hoabts6mc/image/upload/v1728494579/default_pod_nji5sk.webp'
|
|
202
|
+
}
|
|
188
203
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import PlayerCard from "./PlayerCard";
|
|
2
2
|
import PlayerList from "./PlayerList";
|
|
3
3
|
import PlayerProfile from "./PlayerProfile";
|
|
4
|
-
|
|
4
|
+
import CompanyProfile from './CompanyProfile';
|
|
5
|
+
import PodcastModule from './PodcastModule';
|
|
5
6
|
export {
|
|
6
7
|
PlayerCard,
|
|
7
8
|
PlayerList,
|
|
8
|
-
PlayerProfile
|
|
9
|
+
PlayerProfile,
|
|
10
|
+
CompanyProfile,
|
|
11
|
+
PodcastModule
|
|
9
12
|
}
|
package/src/types.d.ts
CHANGED
|
@@ -24,6 +24,105 @@ export interface PublicPlayerProps {
|
|
|
24
24
|
vouched_status:'unverified' | 'failed' | 'verified',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
|
|
28
|
+
export interface ArticleFeedProps {
|
|
29
|
+
article_feed_id: string,
|
|
30
|
+
company_id?:string,
|
|
31
|
+
claim_status:string,
|
|
32
|
+
player_ids: string[],
|
|
33
|
+
status:string,
|
|
34
|
+
feed_image: any,
|
|
35
|
+
feed_type: 'api'|'rss',
|
|
36
|
+
feed_name: string,
|
|
37
|
+
is_live?:boolean,
|
|
38
|
+
live_stream_url?:string,
|
|
39
|
+
live_stream_type?:string,
|
|
40
|
+
rss_url?: string,
|
|
41
|
+
api_name?:string,
|
|
42
|
+
create_datetime:any,
|
|
43
|
+
last_update_datetime:any
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export interface ArticleProps {
|
|
48
|
+
article_id:string,
|
|
49
|
+
company_id:string,
|
|
50
|
+
article_feed_id:string,
|
|
51
|
+
url:string,
|
|
52
|
+
article_type:string,
|
|
53
|
+
source?:string,
|
|
54
|
+
video_type?:string,
|
|
55
|
+
author?:string,
|
|
56
|
+
categories: string[]
|
|
57
|
+
content_snippet?:string,
|
|
58
|
+
image?: {
|
|
59
|
+
url:string,
|
|
60
|
+
width:string,
|
|
61
|
+
height:string,
|
|
62
|
+
type:string
|
|
63
|
+
},
|
|
64
|
+
guid?:string,
|
|
65
|
+
title:string,
|
|
66
|
+
publish_datetime:any,
|
|
67
|
+
status: string,
|
|
68
|
+
create_datetime:any,
|
|
69
|
+
last_update_datetime:any
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface PodcastProps {
|
|
73
|
+
podcast_id: string,
|
|
74
|
+
company_id?: string,
|
|
75
|
+
lead_email?:string,
|
|
76
|
+
lead_contact_name?:string,
|
|
77
|
+
secondary_contact?:string,
|
|
78
|
+
last_episode_pull?:any,
|
|
79
|
+
title: string,
|
|
80
|
+
description: string,
|
|
81
|
+
claim_status?:string,
|
|
82
|
+
global_rank?:number,
|
|
83
|
+
publisher_original?:string,
|
|
84
|
+
publisher_highlighted?:string,
|
|
85
|
+
website?:string,
|
|
86
|
+
listen_notes_score?:number,
|
|
87
|
+
listen_notes_id?:string,
|
|
88
|
+
image_override?:any
|
|
89
|
+
description_override?:string,
|
|
90
|
+
suggested_text?:string,
|
|
91
|
+
key_words?:string[];
|
|
92
|
+
player_ids?: string[];
|
|
93
|
+
image?: any,
|
|
94
|
+
rss_url?: string,
|
|
95
|
+
status: string,
|
|
96
|
+
create_datetime:any,
|
|
97
|
+
last_update_datetime:any
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface PodcastEpisodesProps {
|
|
101
|
+
podcast_episode_id:string,
|
|
102
|
+
podcast_id:string,
|
|
103
|
+
url:string,
|
|
104
|
+
length:string | number,
|
|
105
|
+
type: string,
|
|
106
|
+
author?:string,
|
|
107
|
+
description?:string,
|
|
108
|
+
image?: {
|
|
109
|
+
url:string,
|
|
110
|
+
height?:number,
|
|
111
|
+
width?:number
|
|
112
|
+
},
|
|
113
|
+
image_override?:any,
|
|
114
|
+
description_override?:string,
|
|
115
|
+
explicit?:boolean,
|
|
116
|
+
episode?:string,
|
|
117
|
+
guid?:string,
|
|
118
|
+
title:string,
|
|
119
|
+
external_link?:string,
|
|
120
|
+
publish_date:any,
|
|
121
|
+
status: 'visible' | 'hidden',
|
|
122
|
+
create_datetime:any,
|
|
123
|
+
last_update_datetime: any,
|
|
124
|
+
}
|
|
125
|
+
|
|
27
126
|
export interface CompanyProps {
|
|
28
127
|
company_id:string,
|
|
29
128
|
company_name: string,
|