Skip to content

Commit 4b0d64f

Browse files
authored
Hide icon/header to minimize the height of the service search text on mobile (keybase#19922)
1 parent e23f3d0 commit 4b0d64f

2 files changed

Lines changed: 37 additions & 33 deletions

File tree

‎shared/stories/__tests__/__snapshots__/Storyshots.test.js.snap‎

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎shared/team-building/index.tsx‎

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,37 @@ const ContactsImportButton = (props: ContactProps) => {
196196
)
197197
}
198198

199+
const EmptyResultText = (props: {selectedService: ServiceIdWithContact}) => (
200+
<Kb.Box2
201+
alignSelf="center"
202+
centerChildren={!Styles.isMobile}
203+
direction="vertical"
204+
fullHeight={true}
205+
fullWidth={true}
206+
gap="tiny"
207+
style={styles.emptyContainer}
208+
>
209+
{!Styles.isMobile && (
210+
<Kb.Icon
211+
fontSize={Styles.isMobile ? 48 : 64}
212+
type={serviceIdToIconFont(props.selectedService)}
213+
style={Styles.collapseStyles([
214+
!!props.selectedService && {color: serviceIdToAccentColor(props.selectedService)},
215+
])}
216+
/>
217+
)}
218+
{!Styles.isMobile && (
219+
<Kb.Text center={true} type="BodyBig">
220+
Enter a {serviceIdToLabel(props.selectedService)} username above.
221+
</Kb.Text>
222+
)}
223+
<Kb.Text center={true} style={styles.emptyServiceText} type="BodySmall">
224+
Start a Keybase chat with anyone on {serviceIdToLabel(props.selectedService)}, even if they don’t have a
225+
Keybase account.
226+
</Kb.Text>
227+
</Kb.Box2>
228+
)
229+
199230
class TeamBuilding extends React.PureComponent<Props, {}> {
200231
sectionListRef = React.createRef<Kb.SectionList>()
201232
componentDidMount = () => {
@@ -343,32 +374,7 @@ class TeamBuilding extends React.PureComponent<Props, {}> {
343374
)
344375
}
345376
if (!this.props.showRecs && !this.props.showResults && !!this.props.selectedService) {
346-
return (
347-
<Kb.Box2
348-
alignSelf="center"
349-
centerChildren={true}
350-
direction="vertical"
351-
fullHeight={true}
352-
fullWidth={true}
353-
gap="tiny"
354-
style={styles.emptyContainer}
355-
>
356-
<Kb.Icon
357-
fontSize={Styles.isMobile ? 48 : 64}
358-
type={serviceIdToIconFont(this.props.selectedService)}
359-
style={Styles.collapseStyles([
360-
!!this.props.selectedService && {color: serviceIdToAccentColor(this.props.selectedService)},
361-
])}
362-
/>
363-
<Kb.Text center={true} type="BodyBig">
364-
Enter a {serviceIdToLabel(this.props.selectedService)} username above.
365-
</Kb.Text>
366-
<Kb.Text center={true} type="BodySmall">
367-
Start a Keybase chat with anyone on {serviceIdToLabel(this.props.selectedService)}, even if they
368-
don’t have a Keybase account.
369-
</Kb.Text>
370-
</Kb.Box2>
371-
)
377+
return <EmptyResultText selectedService={this.props.selectedService} />
372378
}
373379
if (this.props.showRecs && this.props.recommendations) {
374380
const highlightDetails = this._listIndexToSectionAndLocalIndex(
@@ -615,6 +621,11 @@ const styles = Styles.styleSheetCreate(
615621
},
616622
isMobile: {maxWidth: '80%'},
617623
}),
624+
emptyServiceText: Styles.platformStyles({
625+
isMobile: {
626+
padding: Styles.globalMargins.small,
627+
},
628+
}),
618629
headerContainer: Styles.platformStyles({
619630
isElectron: {
620631
marginBottom: Styles.globalMargins.xtiny,

0 commit comments

Comments
 (0)