diff --git a/pages/Settings.tsx b/pages/Settings.tsx index 9d6e897..bb1b939 100644 --- a/pages/Settings.tsx +++ b/pages/Settings.tsx @@ -135,17 +135,17 @@ export const SettingsPage: React.FC = () => { try { await CondoService.updateSettings(globalSettings); setSuccessMsg('Configurazione salvata!'); setTimeout(() => { setSuccessMsg(''); window.location.reload(); }, 1500); } catch (e) { console.error(e); } finally { setSaving(false); } }; const handleBrandingSubmit = async (e: React.FormEvent) => { - e.preventDefault(); if (!globalSettings) return; setSaving(true); + e.preventDefault(); if (!globalSettings) return; setSaving(true); setSuccessMsg(''); try { const updated = { ...globalSettings, branding: brandingForm }; await CondoService.updateSettings(updated); setGlobalSettings(updated); window.dispatchEvent(new Event('branding-updated')); setSuccessMsg('Branding salvato!'); setTimeout(() => setSuccessMsg(''), 3000); - } catch(e) { console.error(e); } finally { setSaving(false); } + } catch(e) { console.error(e); alert('Errore salvataggio branding'); } finally { setSaving(false); } }; const handleStorageSubmit = async (e: React.FormEvent) => { - e.preventDefault(); if (!globalSettings) return; setSaving(true); + e.preventDefault(); if (!globalSettings) return; setSaving(true); setSuccessMsg(''); try { const updated = { ...globalSettings, storageConfig: storageForm }; await CondoService.updateSettings(updated); setGlobalSettings(updated); setSuccessMsg('Configurazione Storage salvata!'); setTimeout(() => setSuccessMsg(''), 3000); } catch (e) { console.error(e); } finally { setSaving(false); } }; const handleLogoUpload = (e: React.ChangeEvent) => { @@ -221,7 +221,7 @@ export const SettingsPage: React.FC = () => {

Nessun Condominio Selezionato

Per accedere a questa sezione devi prima creare o selezionare un condominio.

- @@ -267,7 +267,7 @@ export const SettingsPage: React.FC = () => {
setProfileForm({...profileForm, phone: e.target.value})} className="w-full border border-slate-200 p-3 rounded-xl focus:ring-2 focus:ring-blue-500 outline-none" />
setProfileForm({...profileForm, password: e.target.value})} className="w-full border border-slate-200 p-3 rounded-xl focus:ring-2 focus:ring-blue-500 outline-none" />
-
{profileMsg &&

{profileMsg}

}
+
{profileMsg &&

{profileMsg}

}
)} @@ -291,7 +291,12 @@ export const SettingsPage: React.FC = () => {
{brandingForm.logoUrl ? Logo : }
{brandingForm.loginBackgroundUrl ? Bg : }
-
+
+
{successMsg && {successMsg}}
+ +
)} @@ -308,7 +313,12 @@ export const SettingsPage: React.FC = () => { ))} -
+
+
{successMsg && {successMsg}}
+ +
)} @@ -333,7 +343,12 @@ export const SettingsPage: React.FC = () => {
setActiveCondo({...activeCondo, paypalClientId: e.target.value})} className="w-full border border-slate-200 p-3 rounded-xl text-xs font-mono" />
-
+
+
{successMsg && {successMsg}}
+ +
)} @@ -353,7 +368,12 @@ export const SettingsPage: React.FC = () => { setStorageForm({...storageForm, bucket: e.target.value})} className="w-full border p-3 rounded-xl" placeholder="Bucket Name" /> )} -
+
+
{successMsg && {successMsg}}
+ +
)} @@ -361,7 +381,7 @@ export const SettingsPage: React.FC = () => { {/* TAB LISTA CONDOMINI */} {activeTab === 'condos' && (
-

Elenco Condomini

+

Elenco Condomini

{condos.map(c => (
@@ -382,7 +402,7 @@ export const SettingsPage: React.FC = () => { <> {!activeCondo ? : (
-

Famiglie

+

Famiglie

@@ -397,7 +417,7 @@ export const SettingsPage: React.FC = () => { {/* TAB USERS (ADMIN) */} {activeTab === 'users' && (
-

Utenti

+

Utenti

{users.map(u => (
@@ -414,7 +434,7 @@ export const SettingsPage: React.FC = () => { <> {!activeCondo ? : (
-

Bacheca

+

Bacheca

{notices.map(n => (

{n.title}

{n.content}

))}
)} @@ -426,7 +446,7 @@ export const SettingsPage: React.FC = () => { <> {!activeCondo ? : (
-

Alerts

+

Alerts

{alerts.map(a => (

{a.subject}

{a.daysOffset}gg {a.offsetType}

))}
)}
NomeUnitàAzioni