Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 53a6ce6

Browse files
committedApr 26, 2023
#171 removes about section and add 'follow speakerfirstname' label above socials
1 parent 5ec1c71 commit 53a6ce6

File tree

3 files changed

+42
-22
lines changed

3 files changed

+42
-22
lines changed
 

‎app/components/carousel/CarouselCard.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const CarouselCard: React.FunctionComponent<CarouselCardProps> & SubCompo
4646
totalCardCount,
4747
variant,
4848
}) => {
49-
const { label, subtitle, meta, body, image } = item as DynamicCarouselItem
49+
const { label, subtitle, meta, body, image, bodyLabel } = item as DynamicCarouselItem
5050
const source = subtitle ? image : item
5151
const isMultipleCards = totalCardCount > 1 && index === totalCardCount
5252

@@ -117,7 +117,22 @@ export const CarouselCard: React.FunctionComponent<CarouselCardProps> & SubCompo
117117
]}
118118
/>
119119
)}
120-
<AnimatedText text={body} style={[$mr, $animatedSlideData]} />
120+
{!!bodyLabel && (
121+
<AnimatedText
122+
text={bodyLabel}
123+
style={[
124+
$mb,
125+
$animatedSlideData,
126+
{
127+
fontSize: $label.fontSize,
128+
fontWeight: $label.fontWeight,
129+
lineHeight: $label.lineHeight,
130+
color: $label.color,
131+
},
132+
]}
133+
/>
134+
)}
135+
{!!body && <AnimatedText text={body} style={[$mr, $animatedSlideData]} />}
121136
<View style={$ctaContainer}>
122137
{!!leftButton && (
123138
<Animated.View style={[$leftButton, $animatedSlideData]}>{leftButton}</Animated.View>

‎app/components/carousel/carousel.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface SocialButtonData {
2424
}
2525

2626
export interface DynamicCarouselItem {
27-
body: string
27+
body?: string
2828
image: ImageSourcePropType
2929
imageStyle?: ImageStyle
3030
label?: string
@@ -33,6 +33,7 @@ export interface DynamicCarouselItem {
3333
rightButton?: ButtonData
3434
socialButtons?: SocialButtonData[]
3535
subtitle: string
36+
bodyLabel?: string
3637
}
3738

3839
interface DynamicCarouselProps {

‎app/screens/TalkDetailsScreen/TalkDetailsScreen.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { ScheduledEvent, Speaker } from "../../services/api/webflow-api.types"
2222
import { useFloatingActionEvents, useScrollY } from "../../hooks"
2323
import { SocialButtons } from "../../components/SocialButton"
2424
import { stringOrPlaceholder } from "../../utils/stringOrPlaceholder"
25-
import { DynamicCarouselItem } from "../../components/carousel/carousel.types"
25+
import { DynamicCarouselItem, SocialButtonData } from "../../components/carousel/carousel.types"
2626
import { WEBFLOW_MAP } from "../../services/api/webflow-consts"
2727

2828
export type Variants = "workshop" | "talk"
@@ -148,18 +148,22 @@ const talkDetailsProps = (schedule: ScheduledEvent): TalkDetailsProps => {
148148
{ url: talk?.["speaker-s"][0]?.externalURL, icon: "link" },
149149
],
150150
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 = [
158153
{ url: speaker?.twitter, icon: "twitter" },
159154
{ url: speaker?.github, icon: "github" },
160155
{ 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+
}),
163167
}
164168
}
165169

@@ -169,7 +173,6 @@ type TalkDetailsSingleSpeakerScreenProps = TalkDetailsSingleSpeakerProps & {
169173

170174
const TalkDetailsSingleSpeaker: React.FunctionComponent<TalkDetailsSingleSpeakerScreenProps> =
171175
function TalkDetailsSingleSpeaker({
172-
bio,
173176
company,
174177
description,
175178
firstName,
@@ -178,6 +181,7 @@ const TalkDetailsSingleSpeaker: React.FunctionComponent<TalkDetailsSingleSpeaker
178181
scheduleType,
179182
socialButtons,
180183
}) {
184+
const hasSocialButtons = socialButtons.some((button) => button.url)
181185
return (
182186
<>
183187
<View style={$containerSpacing}>
@@ -196,14 +200,14 @@ const TalkDetailsSingleSpeaker: React.FunctionComponent<TalkDetailsSingleSpeaker
196200
<Text style={$bodyText} text={description} />
197201
</View>
198202

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+
)}
207211
</>
208212
)
209213
}

0 commit comments

Comments
 (0)
Please sign in to comment.