diff --git a/app/(protected)/_layout.tsx b/app/(protected)/_layout.tsx index 8feb106..2c2e669 100644 --- a/app/(protected)/_layout.tsx +++ b/app/(protected)/_layout.tsx @@ -43,35 +43,35 @@ export default function ProtectedLayout() { name="index" options={{ title: 'Home', - tabBarIcon: ({ color, size }) => , + tabBarIcon: ({ color, size }) => , }} /> , + tabBarIcon: ({ color, size }) => , }} /> , + tabBarIcon: ({ color, size }) => , }} /> , + tabBarIcon: ({ color, size }) => , }} /> , + tabBarIcon: ({ color, size }) => , href: authState.user?.isAdmin ? undefined : null, }} /> @@ -79,7 +79,7 @@ export default function ProtectedLayout() { name="machine/index" options={{ title: 'Macchine', - tabBarIcon: ({ color, size }) => , + tabBarIcon: ({ color, size }) => , href: !authState.user?.isAdmin ? undefined : null, }} /> @@ -88,6 +88,7 @@ export default function ProtectedLayout() { options={{ href: null, title: 'Profilo', + tabBarStyle: { display: 'none' }, }} /> diff --git a/app/(protected)/invoice/index.tsx b/app/(protected)/invoice/index.tsx index b79d5bc..a00e8e3 100644 --- a/app/(protected)/invoice/index.tsx +++ b/app/(protected)/invoice/index.tsx @@ -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() { {/* List */} - item.id.toString()} className="flex-1" contentContainerStyle={{ padding: 20, paddingBottom: 100, gap: 16 }} showsVerticalScrollIndicator={true} scrollIndicatorInsets={{ right: 1 }} refreshControl={} - > - {invoices.length === 0 ? ( + initialNumToRender={10} + maxToRenderPerBatch={10} + windowSize={5} + renderItem={({ item }) => ( + + )} + ListEmptyComponent={ Nessuna fattura trovata - ) : ( - invoices.map((invoice) => ( - - )))} - + } + /> {/* FAB Filter */} { - if (visible) { - setScanned(false); - scanInProgress.current = false; - if (permission && !permission.granted && permission.canAskAgain) { - requestPermission(); - } + if (!visible) return; + setScanned(false); + scanInProgress.current = false; + if (permission && !permission.granted && permission.canAskAgain) { + requestPermission(); } }, [visible, permission]); @@ -43,10 +42,6 @@ export default function QrScanModal({ visible, onClose, onScan }: QrScanModalPro return ; } - if (!permission.granted && visible) { - requestPermission(); - } - return ( - {/* Dark Overlay with Transparent "Hole" (Visually Simulated with Borders or Opacity) */} - - {/* Header Overlay */} - - Scansiona QR Code - Inquadra il codice nel riquadro - + {/* Mask Overlay with transparent cutout */} + + + + - {/* Central Area (Transparent for the camera) */} - - - {/* Decorative Corners */} + {/* Scanner Target Frame */} + - {/* Animated Scan Line or Icon */} - {!scanned && } + {!scanned && } - - {/* Footer Overlay */} - - - - - Chiudi + + + + + + {/* UI Overlay */} + + + {/* Header */} + + + Scansiona QR Code + + + Inquadra il codice nel riquadro + + + + {/* Footer */} + + + + + + + Chiudi + +