Update tabBarIcon sizes, use FlatList for invoices and refactor QrScanModal layout
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user