feat: Update assets and improve code comments across multiple components
- Updated favicon and various image assets. - Enhanced comments. - Adjusted styles and functionality in several components for improved user experience. - Updated package-lock.json to reflect dependency updates.
This commit is contained in:
@@ -6,6 +6,7 @@ import { AuthContext } from '@/utils/authContext';
|
||||
import { ActivityItem } from '@/types/types';
|
||||
import api from '@/utils/api';
|
||||
import LoadingScreen from '@/components/LoadingScreen';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function HomeScreen() {
|
||||
const router = useRouter();
|
||||
@@ -63,27 +64,29 @@ export default function HomeScreen() {
|
||||
|
||||
return (
|
||||
<View className="flex-1 bg-[#099499]">
|
||||
{/* Banner Custom */}
|
||||
<View className="pt-16 pb-6 px-6 shadow-sm z-10">
|
||||
<View className="flex-row justify-between items-start">
|
||||
<View className="flex-row items-center gap-4 flex-1 mr-4">
|
||||
<View className="flex-1">
|
||||
<Text className="text-teal-100 text-lg font-medium uppercase tracking-wider mb-1">Benvenuto</Text>
|
||||
<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>
|
||||
<SafeAreaView edges={['top']} className='pt-4'>
|
||||
{/* Custom Banner */}
|
||||
<View className="pb-6 px-6 shadow-sm z-10">
|
||||
<View className="flex-row justify-between items-start">
|
||||
<View className="flex-row items-center gap-4 flex-1 mr-4">
|
||||
<View className="flex-1">
|
||||
<Text className="text-teal-100 text-lg font-medium uppercase tracking-wider mb-1">Benvenuto</Text>
|
||||
<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>
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex-row gap-4 flex-shrink-0">
|
||||
<TouchableOpacity className="p-3 bg-white/10 rounded-full active:bg-white/20" onPress={() => router.push('/profile')}>
|
||||
<User size={28} color="white" />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
<View className="flex-row gap-4 flex-shrink-0">
|
||||
<TouchableOpacity className="p-3 bg-white/10 rounded-full active:bg-white/20" onPress={() => router.push('/profile')}>
|
||||
<User size={28} color="white" />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
|
||||
{/* Contenuto Scrollabile */}
|
||||
{/* Scrollable Content */}
|
||||
<ScrollView
|
||||
className="flex-1 bg-gray-50 rounded-t-[2.5rem] px-5 pt-6"
|
||||
contentContainerStyle={{ paddingBottom: 50, gap: 24 }}
|
||||
@@ -93,10 +96,13 @@ export default function HomeScreen() {
|
||||
}
|
||||
>
|
||||
|
||||
{/* Warning Card */}
|
||||
{/* Warning Card - Incomplete Attendance */}
|
||||
{incompleteAttendance && (
|
||||
<View className="bg-white p-6 rounded-3xl shadow-md border-l-8 border-orange-500 flex-row items-center justify-between">
|
||||
<View className="flex-row items-center gap-5 flex-1">
|
||||
<TouchableOpacity
|
||||
className="bg-white p-6 rounded-3xl shadow-md border-l-8 border-orange-500"
|
||||
onPress={() => router.push('/attendance')}
|
||||
>
|
||||
<View className="flex-row items-center gap-5">
|
||||
<View className="bg-orange-100 p-4 rounded-full">
|
||||
<AlertTriangle size={32} color="#f97316" />
|
||||
</View>
|
||||
@@ -105,10 +111,7 @@ export default function HomeScreen() {
|
||||
<Text className="text-base text-gray-500 mt-1">{incompleteAttendance}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<TouchableOpacity onPress={() => router.push('/attendance')} className="bg-orange-50 px-5 py-3 rounded-xl ml-2 active:bg-orange-100">
|
||||
<Text className="text-orange-600 text-sm font-bold uppercase tracking-wide">Risolvi</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
|
||||
{/* Quick Actions */}
|
||||
@@ -141,6 +144,7 @@ export default function HomeScreen() {
|
||||
<View>
|
||||
<View className="flex-row justify-between items-center px-1 mb-4">
|
||||
<Text className="text-gray-800 text-xl font-bold">Ultime Attività</Text>
|
||||
{/* TODO: Could be expanded */}
|
||||
{/* <TouchableOpacity>
|
||||
<Text className="text-base text-[#099499] font-bold p-1">Vedi tutto</Text>
|
||||
</TouchableOpacity> */}
|
||||
@@ -153,12 +157,12 @@ export default function HomeScreen() {
|
||||
<View key={item.id} className="bg-white p-5 rounded-3xl shadow-sm border border-gray-100 flex-row items-center justify-between">
|
||||
<View className="flex-row items-center gap-4 flex-1">
|
||||
|
||||
{/* Icona */}
|
||||
{/* Icon */}
|
||||
<View className={`${config.bg} p-4 rounded-2xl flex-shrink-0`}>
|
||||
<IconComponent size={24} color={config.color} />
|
||||
</View>
|
||||
|
||||
{/* Titolo e Sottotitolo */}
|
||||
{/* Title and Subtitle */}
|
||||
<View className="flex-1 mr-2">
|
||||
<Text
|
||||
className="text-lg font-bold text-gray-800 mb-0.5 leading-tight"
|
||||
@@ -176,7 +180,7 @@ export default function HomeScreen() {
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Data */}
|
||||
{/* Date */}
|
||||
<View className="flex-shrink-0">
|
||||
<Text className="text-sm font-bold text-gray-300">{item.date_display}</Text>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user