@@ -6,6 +6,7 @@ import FormAlertWithSubmitButton from '@components/FormAlertWithSubmitButton';
66import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator' ;
77import HeaderWithBackButton from '@components/HeaderWithBackButton' ;
88import ScreenWrapper from '@components/ScreenWrapper' ;
9+ import ScrollView from '@components/ScrollView' ;
910import SelectionList from '@components/SelectionList' ;
1011import CardListItem from '@components/SelectionList/ListItem/CardListItem' ;
1112import type { AdditionalCardProps } from '@components/SelectionList/ListItem/CardListItem' ;
@@ -184,7 +185,8 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
184185 Navigation . goBack ( parentRoute ) ;
185186 } ;
186187
187- const headerMessage = getHeaderMessage ( listData . length > 0 , false , inputValue , countryCode , false ) ;
188+ const hasEligibleCards = eligibleCards . length > 0 ;
189+ const headerMessage = hasEligibleCards ? getHeaderMessage ( listData . length > 0 , false , inputValue , countryCode , false ) : '' ;
188190
189191 return (
190192 < AccessOrNotFoundWrapper
@@ -214,12 +216,16 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
214216 />
215217 < SelectionList
216218 canSelectMultiple
217- textInputOptions = { {
218- headerMessage,
219- value : inputValue ,
220- label : translate ( 'common.search' ) ,
221- onChangeText : setInputValue ,
222- } }
219+ textInputOptions = {
220+ hasEligibleCards
221+ ? {
222+ headerMessage,
223+ value : inputValue ,
224+ label : translate ( 'common.search' ) ,
225+ onChangeText : setInputValue ,
226+ }
227+ : undefined
228+ }
223229 data = { listData }
224230 style = { {
225231 listHeaderWrapperStyle : [ styles . pt5 , styles . pb2 ] ,
@@ -234,19 +240,21 @@ function SpendRuleCardPage({route}: SpendRuleCardPageProps) {
234240 shouldUpdateFocusedIndex
235241 shouldPreventDefaultFocusOnSelectRow = { ! canUseTouchScreen ( ) }
236242 listEmptyContent = {
237- < BlockingView
238- icon = { illustrations . HandCard }
239- iconWidth = { variables . iconSection }
240- iconHeight = { variables . iconSection }
241- title = { inputValue . trim ( ) ? translate ( 'common.noResultsFound' ) : translate ( 'workspace.rules.spendRules.noAvailableCards' ) }
242- titleStyles = { styles . mb2 }
243- subtitle = { translate ( 'workspace.rules.spendRules.noAvailableCardsSubtitle' ) }
244- subtitleStyle = { styles . textSupporting }
245- />
243+ < ScrollView contentContainerStyle = { [ styles . flexGrow1 ] } >
244+ < BlockingView
245+ icon = { illustrations . HandCard }
246+ iconWidth = { variables . iconSection }
247+ iconHeight = { variables . iconSection }
248+ title = { inputValue . trim ( ) ? translate ( 'common.noResultsFound' ) : translate ( 'workspace.rules.spendRules.noAvailableCards' ) }
249+ titleStyles = { styles . mb2 }
250+ subtitle = { translate ( 'workspace.rules.spendRules.noAvailableCardsSubtitle' ) }
251+ subtitleStyle = { styles . textSupporting }
252+ />
253+ </ ScrollView >
246254 }
247255 footerContent = {
248256 < FormAlertWithSubmitButton
249- buttonText = { translate ( 'common.save' ) }
257+ buttonText = { hasEligibleCards ? translate ( 'common.save' ) : translate ( 'common.buttonConfirm ') }
250258 isAlertVisible = { false }
251259 isDisabled = { isCardSettingsLoading }
252260 onSubmit = { handleSave }
0 commit comments