Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "No results found" text is not aligned to left edge #38852

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function BaseSelectionList<TItem extends ListItem>(
listHeaderWrapperStyle,
isRowMultilineSupported = false,
textInputRef,
headerMessageStyle,
}: BaseSelectionListProps<TItem>,
ref: ForwardedRef<SelectionListHandle>,
) {
Expand Down Expand Up @@ -514,7 +515,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 @@ -229,6 +229,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 @@ -168,6 +168,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
Loading