Skip to content

Commit abc6a0e

Browse files
authored
(fix) Workshop Assistants layout fix (#166)
1 parent 52bf0ec commit abc6a0e

File tree

4 files changed

+33
-38
lines changed

4 files changed

+33
-38
lines changed

app/components/SocialButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const SocialButtons = ({ socialButtons }: SocialButtonsProps) => (
5151
<SocialButton
5252
{...socialButtonProps}
5353
key={`${socialButtonProps.icon}-${index}`}
54-
style={$socialButtons}
54+
style={socialButtons.length - 1 > index && $socialButtons}
5555
/>
5656
))}
5757
</>

app/screens/TalkDetailsScreen/AssistantsList.tsx

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { translate } from "../../i18n"
55
import { colors, spacing } from "../../theme"
66
import { Speaker } from "../../services/api/webflow-api.types"
77
import { SocialButtons } from "../../components/SocialButton"
8-
98
export interface AssistantsListProp {
109
assistants: Speaker[]
1110
}
@@ -16,59 +15,54 @@ export function AssistantsList(props: AssistantsListProp) {
1615
if (!assistants) return null
1716

1817
return (
19-
<>
18+
<View style={$assistantRoot}>
19+
<Text
20+
preset="listHeading"
21+
text={translate("talkDetailsScreen.assistingTheWorkshop")}
22+
style={$assistantHeading}
23+
/>
2024
<View style={$assistantContainer}>
21-
<Text
22-
preset="listHeading"
23-
text={translate("talkDetailsScreen.assistingTheWorkshop")}
24-
style={$assistantHeading}
25-
/>
26-
<View
27-
style={assistants.length < 2 ? $assistantsContainerWithOne : $assistantsContainerWithMore}
28-
>
29-
{assistants.map((assistant) => (
30-
<View style={$assistant} key={assistant._id}>
31-
<AutoImage source={{ uri: assistant["speaker-photo"].url }} style={$assistantImage} />
32-
<Text preset="companionHeading" text={assistant.name} />
33-
<Text preset="label" style={$assistantCompany} text={assistant.company} />
34-
<View style={$assistantLinks}>
35-
<SocialButtons
36-
socialButtons={[
37-
{ icon: "twitter", url: assistant.twitter },
38-
{ icon: "github", url: assistant.github },
39-
{ icon: "link", url: assistant.externalURL },
40-
]}
41-
/>
42-
</View>
25+
{assistants.map((assistant) => (
26+
<View style={$assistant} key={assistant._id}>
27+
<AutoImage source={{ uri: assistant["speaker-photo"].url }} style={$assistantImage} />
28+
<Text preset="companionHeading" text={assistant.name} />
29+
<Text preset="label" style={$assistantCompany} text={assistant.company} />
30+
<View style={$assistantLinks}>
31+
<SocialButtons
32+
socialButtons={[
33+
{ icon: "twitter", url: assistant.twitter },
34+
{ icon: "github", url: assistant.github },
35+
{ icon: "link", url: assistant.externalURL },
36+
]}
37+
/>
4338
</View>
44-
))}
45-
</View>
39+
</View>
40+
))}
4641
</View>
47-
</>
42+
</View>
4843
)
4944
}
5045

51-
const $assistantsContainerWithOne: ViewStyle = {
52-
flexDirection: "row",
53-
marginStart: spacing.large,
54-
}
55-
56-
const $assistantsContainerWithMore: ViewStyle = {
46+
const $assistantContainer: ViewStyle = {
5747
flexDirection: "row",
58-
justifyContent: "space-around",
48+
flexWrap: "wrap",
49+
justifyContent: "space-between",
5950
}
6051

61-
const $assistantContainer: ViewStyle = {
52+
const $assistantRoot: ViewStyle = {
6253
marginTop: spacing.large,
6354
marginBottom: spacing.huge,
6455
}
6556

6657
const $assistant: ViewStyle = {
6758
alignItems: "center",
59+
marginTop: spacing.large,
60+
width: "48%",
61+
justifyContent: "center",
6862
}
6963

7064
const $assistantHeading: TextStyle = {
71-
marginVertical: spacing.large,
65+
marginTop: spacing.large,
7266
}
7367

7468
const $assistantImage: ImageStyle = {

app/screens/TalkDetailsScreen/TalkDetailsScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ const talkDetailsProps = (schedule: ScheduledEvent): TalkDetailsProps => {
157157
socialButtons: [
158158
{ url: speaker?.twitter, icon: "twitter" },
159159
{ url: speaker?.github, icon: "github" },
160-
{ url: speaker?.externalURL || speaker?.website, icon: "link" },
160+
{ url: speaker?.externalURL, icon: "link" },
161161
],
162162
})),
163163
}

app/services/api/webflow-helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const cleanedSpeaker = (speaker?: RawSpeaker): Speaker | null => {
6767
...speaker,
6868
"speaker-type": WEBFLOW_MAP.speakersType[speaker["speaker-type"]],
6969
"talk-level": WEBFLOW_MAP.speakersTalk[speaker["talk-level"]],
70+
externalURL: speaker["external-url"] ?? speaker.website,
7071
}
7172
}
7273

0 commit comments

Comments
 (0)