diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 81c914b..776c368 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -367,6 +367,8 @@ function AppContent() { const [exporting, setExporting] = useState(false); const [importing, setImporting] = useState(false); const [exportIncludeImages, setExportIncludeImages] = useState(true); + const [showExportModal, setShowExportModal] = useState(false); + const [importResult, setImportResult] = useState<{medications: number, doses: number, shares: number} | null>(null); // User dropdown state (for mobile click-based behavior) const [userDropdownOpen, setUserDropdownOpen] = useState(false); @@ -1168,11 +1170,12 @@ function AppContent() { return; } - alert(t('exportImport.importSuccess') + "\n" + t('exportImport.importSuccessDetails', { + // Show success message in UI instead of browser alert + setImportResult({ medications: data.imported?.medications || 0, doses: data.imported?.doseHistory || 0, shares: data.imported?.shareLinks || 0, - })); + }); // Reload all data loadMeds(); @@ -2847,33 +2850,42 @@ function AppContent() {
+ {/* Import Success Message */} + {importResult && ( +
+
+
+ ✓ {t('exportImport.importSuccess')} + {t('exportImport.importSuccessDetails', { + medications: importResult.medications, + doses: importResult.doses, + shares: importResult.shares + })} +
+ +
+
+ )} {/* Export */} -
-
+
{t('exportImport.exportTitle')} {t('exportImport.exportDesc')}
+
- - -
{/* Import */}
@@ -2881,16 +2893,22 @@ function AppContent() { {t('exportImport.importTitle')} {t('exportImport.importDesc')}
-
@@ -2936,6 +2954,57 @@ function AppContent() { )} + + {/* Export Options Modal */} + {showExportModal && ( +
setShowExportModal(false)}> +
e.stopPropagation()} style={{maxWidth: "450px"}}> + +

{t('exportImport.exportOptions')}

+
+ + +
+
+ +
+
+
+ )} } /> diff --git a/frontend/src/i18n/de.json b/frontend/src/i18n/de.json index 1781486..c0cf874 100644 --- a/frontend/src/i18n/de.json +++ b/frontend/src/i18n/de.json @@ -374,6 +374,11 @@ "sensitiveWarning": "Benachrichtigungs-URLs können Passwörter enthalten und werden im Klartext gespeichert.", "includeImages": "Medikamentenbilder einschließen", "includeImagesHint": "Bilder vergrößern die Datei erheblich. Deaktivieren für kleinere Exports (~50 KB statt mehrere MB).", + "exportOptions": "Export-Optionen", + "exportWithImages": "Mit Bildern", + "exportWithImagesDesc": "Vollständiges Backup mit allen Medikamentenbildern. Größere Datei.", + "exportDataOnly": "Nur Daten", + "exportDataOnlyDesc": "Kompaktes Backup ohne Bilder. Viel kleinere Datei (~50 KB).", "confirmImport": "Alle Daten ersetzen?", "confirmImportMessage": "Dies löscht dauerhaft alle deine aktuellen Medikamente, Einnahmehistorie, Einstellungen und Teilen-Links und ersetzt sie durch die importierten Daten.", "confirmImportWarning": "Diese Aktion kann nicht rückgängig gemacht werden!", diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index d72b6a9..3b9e60d 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -376,6 +376,11 @@ "sensitiveWarning": "Notification URLs may contain passwords and will be stored in plain text.", "includeImages": "Include medication images", "includeImagesHint": "Images significantly increase file size. Uncheck for smaller exports (~50 KB instead of several MB).", + "exportOptions": "Export Options", + "exportWithImages": "With Images", + "exportWithImagesDesc": "Full backup including all medication images. Larger file size.", + "exportDataOnly": "Data Only", + "exportDataOnlyDesc": "Compact backup without images. Much smaller file size (~50 KB).", "confirmImport": "Replace All Data?", "confirmImportMessage": "This will permanently delete all your current medications, dose history, settings, and share links, then replace them with the imported data.", "confirmImportWarning": "This action cannot be undone!",