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 api from '@/utils/api';
|
||||
import LoadingScreen from '@/components/LoadingScreen';
|
||||
import { ConstructionSite } from '@/types/types';
|
||||
import { useAlert } from '@/components/AlertComponent';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function SitesScreen() {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
@@ -15,12 +16,12 @@ export default function SitesScreen() {
|
||||
const router = useRouter();
|
||||
const alert = useAlert();
|
||||
|
||||
// Fetch cantieri e documenti
|
||||
// Fetch sites and documents
|
||||
const fetchConstructionSites = async () => {
|
||||
try {
|
||||
if (!refreshing) setIsLoading(true);
|
||||
|
||||
// Fetch Cantieri
|
||||
// Fetch Sites and their attachments count
|
||||
const response = await api.get('/construction-site/sites-attachments');
|
||||
setConstructionSites(response.data);
|
||||
} catch (error) {
|
||||
@@ -41,7 +42,7 @@ export default function SitesScreen() {
|
||||
fetchConstructionSites();
|
||||
};
|
||||
|
||||
// Filtriamo i cantieri in base alla ricerca
|
||||
// Filter sites based on search term
|
||||
const filteredSites = constructionSites.filter(site =>
|
||||
site.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||
site.code.toLowerCase().includes(searchTerm.toLowerCase())
|
||||
@@ -54,9 +55,11 @@ export default function SitesScreen() {
|
||||
return (
|
||||
<View className="flex-1 bg-gray-50">
|
||||
{/* Header */}
|
||||
<View className="bg-white p-6 pt-16 shadow-sm border-b border-gray-100">
|
||||
<Text className="text-3xl font-bold text-gray-800 mb-1">Cantieri</Text>
|
||||
<Text className="text-base text-gray-500">Seleziona un cantiere per vedere i documenti</Text>
|
||||
<View className="bg-white px-6 pb-6 shadow-sm border-b border-gray-100">
|
||||
<SafeAreaView edges={['top']} className='pt-4'>
|
||||
<Text className="text-3xl font-bold text-gray-800 mb-1">Cantieri</Text>
|
||||
<Text className="text-base text-gray-500">Seleziona un cantiere per vedere i documenti</Text>
|
||||
</SafeAreaView>
|
||||
</View>
|
||||
|
||||
<View className="px-5 mt-5 gap-6 flex-1">
|
||||
@@ -74,11 +77,10 @@ export default function SitesScreen() {
|
||||
/>
|
||||
</View>
|
||||
|
||||
{/* Lista Cantieri */}
|
||||
{/* TODO: Rimuovere lo ScrollIndicator? */}
|
||||
{/* Sites List */}
|
||||
<ScrollView
|
||||
contentContainerStyle={{ gap: 16, paddingBottom: 40 }}
|
||||
showsVerticalScrollIndicator={true}
|
||||
showsVerticalScrollIndicator={false}
|
||||
refreshControl={
|
||||
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} colors={['#099499']} />
|
||||
}
|
||||
@@ -88,8 +90,8 @@ export default function SitesScreen() {
|
||||
key={index}
|
||||
onPress={() => router.push({
|
||||
pathname: '/(protected)/sites/[id]',
|
||||
params: {
|
||||
id: site.id ,
|
||||
params: {
|
||||
id: site.id,
|
||||
siteData: JSON.stringify(site),
|
||||
}
|
||||
})}
|
||||
@@ -111,7 +113,6 @@ export default function SitesScreen() {
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* Freccia al posto del download */}
|
||||
<ChevronRight size={24} color="#9ca3af" />
|
||||
</TouchableOpacity>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user