Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ import {HandCard} from '@components/Icon/Illustrations';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import SearchBar from '@components/SearchBar';
import Text from '@components/Text';
import useBottomSafeSafeAreaPaddingStyle from '@hooks/useBottomSafeSafeAreaPaddingStyle';
import useEmptyViewHeaderHeight from '@hooks/useEmptyViewHeaderHeight';
import useExpensifyCardFeeds from '@hooks/useExpensifyCardFeeds';
import useHandleBackButton from '@hooks/useHandleBackButton';
import useLocalize from '@hooks/useLocalize';
import usePolicy from '@hooks/usePolicy';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useSearchResults from '@hooks/useSearchResults';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import {clearDeletePaymentMethodError} from '@libs/actions/PaymentMethods';
import {filterCardsByPersonalDetails, getCardsByCardholderName, sortCardsByCardholderName} from '@libs/CardUtils';
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
Expand Down Expand Up @@ -72,6 +76,8 @@ function WorkspaceExpensifyCardListPage({route, cardsList, fundID}: WorkspaceExp
const shouldChangeLayout = isMediumScreenWidth || shouldUseNarrowLayout;

const isBankAccountVerified = !cardOnWaitlist;
const {windowHeight} = useWindowDimensions();
const headerHeight = useEmptyViewHeaderHeight(shouldUseNarrowLayout, isBankAccountVerified);

const policyCurrency = useMemo(() => policy?.outputCurrency ?? CONST.CURRENCY.USD, [policy]);

Expand Down Expand Up @@ -220,12 +226,20 @@ function WorkspaceExpensifyCardListPage({route, cardsList, fundID}: WorkspaceExp
{isEmptyObject(cardsList) ? (
<EmptyCardView isBankAccountVerified={isBankAccountVerified} />
) : (
<FlatList
data={filteredSortedCards}
renderItem={renderItem}
ListHeaderComponent={renderListHeader}
contentContainerStyle={bottomSafeAreaPaddingStyle}
/>
<ScrollView
addBottomSafeAreaPadding
showsVerticalScrollIndicator={false}
>
<View style={{height: windowHeight - headerHeight}}>
<FlatList
data={filteredSortedCards}
renderItem={renderItem}
ListHeaderComponent={renderListHeader}
contentContainerStyle={bottomSafeAreaPaddingStyle}
/>
</View>
<Text style={[styles.textMicroSupporting, styles.m5]}>{translate('workspace.expensifyCard.disclaimer')}</Text>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the text block here, outside of the FlatList but inside the ScrollView led to this issue:

which we addressed by moving the text block within the FlatList's ListFooterComponent and adjusting styles.

</ScrollView>
)}
<DelegateNoAccessModal
isNoDelegateAccessMenuVisible={isNoDelegateAccessMenuVisible}
Expand Down