refactor: update tab bar icons size, enhance QR scan modal layout, and remove unused icons

This commit is contained in:
2026-09-10 17:32:48 +02:00
parent b27a660eef
commit 5a6006e2d2
10 changed files with 74 additions and 48 deletions
+6 -5
View File
@@ -43,35 +43,35 @@ export default function ProtectedLayout() {
name="index"
options={{
title: 'Home',
tabBarIcon: ({ color, size }) => <Home pointerEvents="none" color={color} size={24} />,
tabBarIcon: ({ color, size }) => <Home pointerEvents="none" color={color} size={28} />,
}}
/>
<Tabs.Screen
name="attendance/index"
options={{
title: 'Presenze',
tabBarIcon: ({ color, size }) => <Clock pointerEvents="none" color={color} size={24} />,
tabBarIcon: ({ color, size }) => <Clock pointerEvents="none" color={color} size={28} />,
}}
/>
<Tabs.Screen
name="permits/index"
options={{
title: 'Permessi',
tabBarIcon: ({ color, size }) => <CalendarIcon pointerEvents="none" color={color} size={24} />,
tabBarIcon: ({ color, size }) => <CalendarIcon pointerEvents="none" color={color} size={28} />,
}}
/>
<Tabs.Screen
name="sites"
options={{
title: 'Cantieri',
tabBarIcon: ({ color, size }) => <Building pointerEvents="none" color={color} size={24} />,
tabBarIcon: ({ color, size }) => <Building pointerEvents="none" color={color} size={28} />,
}}
/>
<Tabs.Screen
name="automation"
options={{
title: 'Domotica',
tabBarIcon: ({ color, size }) => <Zap pointerEvents="none" color={color} size={24} />,
tabBarIcon: ({ color, size }) => <Zap pointerEvents="none" color={color} size={28} />,
href: authState.user?.role === 'Amministratore' ? undefined : null,
}}
/>
@@ -80,6 +80,7 @@ export default function ProtectedLayout() {
name="profile"
options={{
href: null,
tabBarStyle: { display: 'none' },
title: 'Profilo',
}}
/>
+15 -4
View File
@@ -10,9 +10,11 @@ import React, { useEffect, useState } from 'react';
import { RefreshControl, ScrollView, Text, TouchableOpacity, View } from 'react-native';
import NfcManager from 'react-native-nfc-manager';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useLocalSearchParams } from 'expo-router';
export default function AttendanceScreen() {
const [scannerType, setScannerType] = useState<'qr' | 'nfc'>('qr');
const { autoScan } = useLocalSearchParams();
const alert = useAlert();
const [showScanner, setShowScanner] = useState(false);
const [lastScan, setLastScan] = useState<{ type: string; time: string; site: string } | null>(null);
@@ -47,10 +49,19 @@ export default function AttendanceScreen() {
};
useEffect(() => {
checkNfcAvailability();
fetchAttendances();
setLastScan(null);
}, []);
const init = async () => {
await checkNfcAvailability();
fetchAttendances();
setLastScan(null);
if (autoScan === 'true') {
setTimeout(() => {
handleStartScan();
}, 300);
}
};
init();
}, [autoScan]);
const onRefresh = () => {
setRefreshing(true);
+2 -2
View File
@@ -74,7 +74,7 @@ export default function HomeScreen() {
<Text className="text-white text-3xl font-bold leading-tight">
{user?.name} {user?.surname}
</Text>
<Text className="text-xl text-teal-200">{user?.role}</Text>
<Text className="text-xl text-teal-200 mt-1">{user?.role}</Text>
</View>
</View>
<View className="flex-row gap-4 flex-shrink-0">
@@ -119,7 +119,7 @@ export default function HomeScreen() {
<Text className="text-gray-800 text-xl font-bold mb-4 px-1">Azioni Rapide</Text>
<View className="flex-row gap-5">
<TouchableOpacity
onPress={() => router.push('/attendance')}
onPress={() => router.push('/attendance?autoScan=true')}
className="flex-1 bg-white p-6 rounded-3xl shadow-sm items-center justify-center gap-4 border border-gray-100 active:scale-[0.98]"
>
<View className="w-20 h-20 rounded-full bg-teal-50 items-center justify-center mb-1">