Update tabBarIcon sizes, use FlatList for invoices and refactor QrScanModal layout

This commit is contained in:
2026-08-31 17:37:54 +02:00
parent ccbc8d62c5
commit 8ce26da0c5
4 changed files with 71 additions and 50 deletions
+13 -9
View File
@@ -1,5 +1,5 @@
import React, { useState, useEffect, useCallback } from 'react';
import { View, Text, ScrollView, TouchableOpacity, RefreshControl } from 'react-native';
import { View, Text, FlatList, TouchableOpacity, RefreshControl } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useRouter } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
@@ -112,22 +112,26 @@ export default function InvoiceScreen() {
<View className="flex-1 bg-gray-50 rounded-t-[2.5rem] overflow-hidden">
{/* List */}
<ScrollView
<FlatList
data={invoices}
keyExtractor={(item) => item.id.toString()}
className="flex-1"
contentContainerStyle={{ padding: 20, paddingBottom: 100, gap: 16 }}
showsVerticalScrollIndicator={true}
scrollIndicatorInsets={{ right: 1 }}
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} colors={['#1071C2']} />}
>
{invoices.length === 0 ? (
initialNumToRender={10}
maxToRenderPerBatch={10}
windowSize={5}
renderItem={({ item }) => (
<InvoiceCard item={item} onPress={handleInvoicePress} />
)}
ListEmptyComponent={
<View className="bg-white p-8 rounded-3xl border border-gray-100 items-center justify-center border-dashed mt-4">
<Text className="text-gray-400 font-medium text-center">Nessuna fattura trovata</Text>
</View>
) : (
invoices.map((invoice) => (
<InvoiceCard key={invoice.id} item={invoice} onPress={handleInvoicePress} />
)))}
</ScrollView>
}
/>
{/* FAB Filter */}
<TouchableOpacity