Skip to content

Commit

Permalink
added new styling for headermessage
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonhenry committed Mar 27, 2024
1 parent 2faf908 commit cfd7a8b
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 @@ -69,6 +69,7 @@ function BaseSelectionList<TItem extends ListItem>(
listHeaderWrapperStyle,
isRowMultilineSupported = false,
textInputRef,
headerMessageStyle = [styles.ph5, styles.pb5]
}: 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]}>
<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

0 comments on commit cfd7a8b

Please sign in to comment.