feat: enhance configuration management, add update checks, and improve UI components
This commit is contained in:
@@ -64,6 +64,8 @@ export default function RequestPermitModal({ visible, types, onClose, onSubmit }
|
||||
|
||||
if (response.data.status === 'success') {
|
||||
alert.showAlert('success', 'Successo', response.data.message || 'La tua richiesta è stata inviata con successo.');
|
||||
onSubmit(requestData);
|
||||
onClose();
|
||||
} else {
|
||||
alert.showAlert('error', 'Errore', response.data.message || 'Impossibile inviare la richiesta.');
|
||||
}
|
||||
@@ -92,8 +94,6 @@ export default function RequestPermitModal({ visible, types, onClose, onSubmit }
|
||||
|
||||
try {
|
||||
await saveRequest(requestData);
|
||||
onSubmit(requestData);
|
||||
onClose();
|
||||
} catch (e) {
|
||||
alert.showAlert("error", "Errore", "Impossibile inviare la richiesta.");
|
||||
}
|
||||
|
||||
43
components/UpdateScreen.tsx
Normal file
43
components/UpdateScreen.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import React from 'react';
|
||||
import { View, Text, TouchableOpacity } from 'react-native';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
import { CloudDownload } from 'lucide-react-native';
|
||||
|
||||
interface UpdateScreenProps {
|
||||
onUpdate: () => void;
|
||||
isOpeningStore?: boolean;
|
||||
}
|
||||
|
||||
export default function UpdateScreen({ onUpdate, isOpeningStore = false }: UpdateScreenProps) {
|
||||
return (
|
||||
<SafeAreaView className="flex-1 bg-white">
|
||||
<View className="flex-1 items-center justify-center px-8">
|
||||
{/* Icon */}
|
||||
<View className="bg-gray-100 p-6 rounded-full mb-6">
|
||||
<CloudDownload size={64} className="text-[#099499]" pointerEvents="none" />
|
||||
</View>
|
||||
|
||||
<Text className="text-2xl font-bold text-gray-800 mb-2 text-center">
|
||||
Aggiornamento Richiesto
|
||||
</Text>
|
||||
|
||||
<Text className="text-base text-gray-500 text-center mb-10 leading-6">
|
||||
È disponibile una nuova versione dell'applicazione.{'\n'}Per continuare a utilizzarla è necessario effettuare l'aggiornamento.
|
||||
</Text>
|
||||
|
||||
{/* Update Button */}
|
||||
<TouchableOpacity
|
||||
onPress={onUpdate}
|
||||
disabled={isOpeningStore}
|
||||
className={`flex-row items-center justify-center w-full py-4 rounded-xl gap-4 ${
|
||||
isOpeningStore ? 'bg-gray-300' : 'bg-[#099499] active:bg-[#077f83]'
|
||||
}`}
|
||||
>
|
||||
<Text className="text-white font-bold text-lg">
|
||||
{isOpeningStore ? 'Apertura store...' : 'Aggiorna Ora'}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user