Skip to content

Commit

Permalink
Merge pull request #47634 from wildan-m/wildan/fix/47601-huge-space-w…
Browse files Browse the repository at this point in the history
…s-switcher

[CP Staging] Fix headerMessage wrapper render logic
  • Loading branch information
luacmartins authored Aug 19, 2024
2 parents e903ec9 + 7b61d2b commit 8f9ca45
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 8f9ca45

Please sign in to comment.