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:
2026-02-06 12:56:34 +01:00
parent 7a6a7f5d35
commit 7c8ef45e5a
36 changed files with 325 additions and 317 deletions

View File

@@ -4,17 +4,17 @@ import * as SecureStore from 'expo-secure-store';
const API_BASE_URL = process.env.EXPO_PUBLIC_API_URL;
export const KEY_TOKEN = 'auth_key';
// Crea un'istanza di axios
// Create an Axios instance with default configuration
const api = axios.create({
baseURL: API_BASE_URL,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
timeout: 10000, // 10 secondi timeout
timeout: 10000, // 10 seconds timeout
});
// Interceptor: Aggiunge il token a OGNI richiesta se esiste
// Interceptor: Adds the token to EVERY request if it exists
api.interceptors.request.use(
async (config) => {
const token = await SecureStore.getItemAsync(KEY_TOKEN);
@@ -29,7 +29,7 @@ api.interceptors.request.use(
}
);
// Interceptor: Gestione errori globale (es. token scaduto)
// Interceptor: Global error handling (e.g., expired token)
api.interceptors.response.use(
(response) => response,
async (error) => {
@@ -38,9 +38,9 @@ api.interceptors.response.use(
if (error.response) {
console.error('[API ERROR]', error.response.status, error.response.data);
// Se riceviamo 401 (Unauthorized), potremmo voler fare il logout forzato
// If we receive 401 (Unauthorized), we might want to force logout
if (error.response.status === 401) {
// TODO: Qui potresti emettere un evento per disconnettere l'utente
// TODO: Here you can add logic to redirect to login screen if needed
await SecureStore.deleteItemAsync(KEY_TOKEN);
}
} else {