@@ -22,7 +22,7 @@ import { ScheduledEvent, Speaker } from "../../services/api/webflow-api.types"
22
22
import { useFloatingActionEvents , useScrollY } from "../../hooks"
23
23
import { SocialButtons } from "../../components/SocialButton"
24
24
import { stringOrPlaceholder } from "../../utils/stringOrPlaceholder"
25
- import { DynamicCarouselItem } from "../../components/carousel/carousel.types"
25
+ import { DynamicCarouselItem , SocialButtonData } from "../../components/carousel/carousel.types"
26
26
import { WEBFLOW_MAP } from "../../services/api/webflow-consts"
27
27
28
28
export type Variants = "workshop" | "talk"
@@ -148,18 +148,22 @@ const talkDetailsProps = (schedule: ScheduledEvent): TalkDetailsProps => {
148
148
{ url : talk ?. [ "speaker-s" ] [ 0 ] ?. externalURL , icon : "link" } ,
149
149
] ,
150
150
isMultipleSpeakers : talk ?. [ "speaker-s" ] . length > 1 ,
151
- carouselData : talk ?. [ "speaker-s" ] . map ( ( speaker ) => ( {
152
- image : { uri : speaker ?. [ "speaker-photo" ] . url } ,
153
- imageStyle : { height : 320 } ,
154
- subtitle : speaker ?. name ,
155
- label : speaker ?. company ,
156
- body : stringOrPlaceholder ( speaker ?. [ "speaker-bio" ] ) ,
157
- socialButtons : [
151
+ carouselData : talk ?. [ "speaker-s" ] . map ( ( speaker ) => {
152
+ const socialButtons = [
158
153
{ url : speaker ?. twitter , icon : "twitter" } ,
159
154
{ url : speaker ?. github , icon : "github" } ,
160
155
{ url : speaker ?. externalURL , icon : "link" } ,
161
- ] ,
162
- } ) ) ,
156
+ ] as SocialButtonData [ ]
157
+ const hasSocialButtons = socialButtons . some ( ( button ) => button . url )
158
+ return {
159
+ image : { uri : speaker ?. [ "speaker-photo" ] . url } ,
160
+ imageStyle : { height : 320 } ,
161
+ subtitle : speaker ?. name ,
162
+ label : speaker ?. company ,
163
+ socialButtons,
164
+ bodyLabel : hasSocialButtons && `Follow ${ talk ?. [ "speaker-s" ] [ 0 ] [ "speaker-first-name" ] } ` ,
165
+ }
166
+ } ) ,
163
167
}
164
168
}
165
169
@@ -169,7 +173,6 @@ type TalkDetailsSingleSpeakerScreenProps = TalkDetailsSingleSpeakerProps & {
169
173
170
174
const TalkDetailsSingleSpeaker : React . FunctionComponent < TalkDetailsSingleSpeakerScreenProps > =
171
175
function TalkDetailsSingleSpeaker ( {
172
- bio,
173
176
company,
174
177
description,
175
178
firstName,
@@ -178,6 +181,7 @@ const TalkDetailsSingleSpeaker: React.FunctionComponent<TalkDetailsSingleSpeaker
178
181
scheduleType,
179
182
socialButtons,
180
183
} ) {
184
+ const hasSocialButtons = socialButtons . some ( ( button ) => button . url )
181
185
return (
182
186
< >
183
187
< View style = { $containerSpacing } >
@@ -196,14 +200,14 @@ const TalkDetailsSingleSpeaker: React.FunctionComponent<TalkDetailsSingleSpeaker
196
200
< Text style = { $bodyText } text = { description } />
197
201
</ View >
198
202
199
- < View style = { $containerSpacing } >
200
- < Text preset = "eventTitle" style = { $aboutHeading } text = { `About ${ firstName } ` } / >
201
- < Text style = { $bodyText } text = { bio } />
202
- </ View >
203
-
204
- < View style = { $linksContainer } >
205
- < SocialButtons socialButtons = { socialButtons } / >
206
- </ View >
203
+ { hasSocialButtons && (
204
+ < View style = { $containerSpacing } >
205
+ < Text preset = "eventTitle" style = { $aboutHeading } text = { `Follow ${ firstName } ` } />
206
+ < View style = { $linksContainer } >
207
+ < SocialButtons socialButtons = { socialButtons } />
208
+ </ View >
209
+ </ View >
210
+ ) }
207
211
</ >
208
212
)
209
213
}
0 commit comments