All files / app/(tabs)/ranking/components ListFooter.tsx

100% Statements 4/4
100% Branches 2/2
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43                        2x 2x   1x                                                      
/**
 * 列表底部加载器 - 加载更多数据时显示
 */
import { ActivityIndicator } from 'react-native';
import { Text, YStack } from 'tamagui';
import { useThemeColors } from '@/src/hooks/useThemeColors';
 
interface ListFooterProps {
  isLoadingMore: boolean;
}
 
export function ListFooter({ isLoadingMore }: ListFooterProps) {
  const colors = useThemeColors();
  if (!isLoadingMore) return null;
 
  return (
    <YStack
      padding="$6"
      alignItems="center"
      gap="$3"
      backgroundColor={colors.background as any}
      marginTop="$2"
    >
      <YStack
        width={60}
        height={60}
        borderRadius="$12"
        backgroundColor={colors.primaryLight as any}
        alignItems="center"
        justifyContent="center"
      >
        <ActivityIndicator size="large" color={colors.primary} />
      </YStack>
      <Text fontSize={16} color={colors.text as any} fontWeight="700" letterSpacing={0.3}>
        加载更多猫粮中...
      </Text>
      <Text fontSize={14} color={colors.textSecondary as any} fontWeight="500">
        为您精选优质产品
      </Text>
    </YStack>
  );
}