Skip to content

Commit

Permalink
Fix headerMessage wrapper render logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wildan-m committed Aug 19, 2024
1 parent 62722e8 commit 7b61d2b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,12 @@ function BaseSelectionList<TItem extends ListItem>(
)}
{/* If we are loading new options we will avoid showing any header message. This is mostly because one of the header messages says there are no options. */}
{/* This is misleading because we might be in the process of loading fresh options from the server. */}
{(((!isLoadingNewOptions || headerMessage !== translate('common.noResultsFound')) && !!headerMessage) ||
(flattenedSections.allOptions.length === 0 && !showLoadingPlaceholder)) && (
<View style={headerMessageStyle ?? [styles.ph5, styles.pb5]}>
<Text style={[styles.textLabel, styles.colorMuted, styles.minHeight5]}>{headerMessage}</Text>
</View>
)}
{(!isLoadingNewOptions || headerMessage !== translate('common.noResultsFound') || (flattenedSections.allOptions.length === 0 && !showLoadingPlaceholder)) &&
!!headerMessage && (
<View style={headerMessageStyle ?? [styles.ph5, styles.pb5]}>
<Text style={[styles.textLabel, styles.colorMuted, styles.minHeight5]}>{headerMessage}</Text>
</View>
)}
{!!headerContent && headerContent}
{flattenedSections.allOptions.length === 0 ? (
renderListEmptyContent()
Expand Down

0 comments on commit 7b61d2b

Please sign in to comment.