Skip to content

Commit

Permalink
Merge pull request #38852 from brandonhenry/37984-no-results-found-te…
Browse files Browse the repository at this point in the history
…xt-updates

Fix for "No results found" text is not aligned to left edge
  • Loading branch information
grgia committed Apr 2, 2024
2 parents a1801c8 + 9585a87 commit d7161ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function BaseSelectionList<TItem extends ListItem>(
listHeaderWrapperStyle,
isRowMultilineSupported = false,
textInputRef,
headerMessageStyle,
}: BaseSelectionListProps<TItem>,
ref: ForwardedRef<SelectionListHandle>,
) {
Expand Down Expand Up @@ -516,7 +517,7 @@ function BaseSelectionList<TItem extends ListItem>(
</View>
)}
{!!headerMessage && (
<View style={[styles.ph5, styles.pb5]}>
<View style={headerMessageStyle ?? [styles.ph5, styles.pb5]}>
<Text style={[styles.textLabel, styles.colorMuted]}>{headerMessage}</Text>
</View>
)}
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
/** Message to display at the top of the list */
headerMessage?: string;

/** Styles to apply to the header message */
headerMessageStyle?: StyleProp<ViewStyle>;

/** Text to display on the confirm button */
confirmButtonText?: string;

Expand Down
1 change: 1 addition & 0 deletions src/pages/SearchPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function SearchPage({betas, reports, isSearchingForReports, navigation}: SearchP
textInputHint={offlineMessage}
onChangeText={setSearchValue}
headerMessage={headerMessage}
headerMessageStyle={headerMessage === translate('common.noResultsFound') ? [themeStyles.ph4, themeStyles.pb5] : undefined}
onLayout={setPerformanceTimersEnd}
autoFocus
onSelectRow={selectReport}
Expand Down

0 comments on commit d7161ae

Please sign in to comment.