diff --git a/mobile/assets/i18n/en-US.json b/mobile/assets/i18n/en-US.json index bd97554ea..603eeac52 100644 --- a/mobile/assets/i18n/en-US.json +++ b/mobile/assets/i18n/en-US.json @@ -151,6 +151,7 @@ "delete_dialog_alert_local_non_backed_up": "Some of the items aren't backed up to Immich and will be permanently removed from your device", "delete_dialog_cancel": "Cancel", "delete_dialog_ok": "Delete", + "delete_dialog_ok_force": "Delete Anyway", "delete_dialog_title": "Delete Permanently", "delete_shared_link_dialog_content": "Are you sure you want to delete this shared link?", "delete_shared_link_dialog_title": "Delete Shared Link", diff --git a/mobile/lib/modules/home/ui/control_bottom_app_bar.dart b/mobile/lib/modules/home/ui/control_bottom_app_bar.dart index 6ac6a8e10..a3c93c9d6 100644 --- a/mobile/lib/modules/home/ui/control_bottom_app_bar.dart +++ b/mobile/lib/modules/home/ui/control_bottom_app_bar.dart @@ -113,7 +113,13 @@ class ControlBottomAppBar extends ConsumerWidget { content: selectionAssetState.hasLocal ? "delete_dialog_alert_local_non_backed_up" : "delete_dialog_alert_local", + ok: selectionAssetState.hasLocal + ? "delete_dialog_ok_force" + : "delete_dialog_ok", onDelete: onDeleteLocal, + contentColor: selectionAssetState.hasLocal + ? Colors.red[400] + : null, ); }, ); diff --git a/mobile/lib/modules/home/ui/delete_dialog.dart b/mobile/lib/modules/home/ui/delete_dialog.dart index 23d107700..3b97a674d 100644 --- a/mobile/lib/modules/home/ui/delete_dialog.dart +++ b/mobile/lib/modules/home/ui/delete_dialog.dart @@ -4,13 +4,19 @@ import 'package:immich_mobile/shared/ui/confirm_dialog.dart'; class DeleteDialog extends ConfirmDialog { final Function onDelete; - const DeleteDialog({Key? key, required this.onDelete, content}) - : super( + const DeleteDialog({ + Key? key, + required this.onDelete, + String? content, + String? ok, + Color? contentColor, + }) : super( key: key, title: "delete_dialog_title", content: content ?? "delete_dialog_alert", cancel: "delete_dialog_cancel", - ok: "delete_dialog_ok", + ok: ok ?? "delete_dialog_ok", onOk: onDelete, + contentColor: contentColor, ); } diff --git a/mobile/lib/shared/ui/confirm_dialog.dart b/mobile/lib/shared/ui/confirm_dialog.dart index 26afd5d16..ca5fee7ec 100644 --- a/mobile/lib/shared/ui/confirm_dialog.dart +++ b/mobile/lib/shared/ui/confirm_dialog.dart @@ -5,6 +5,7 @@ class ConfirmDialog extends StatelessWidget { final Function onOk; final String title; final String content; + final Color? contentColor; final String cancel; final String ok; @@ -15,6 +16,7 @@ class ConfirmDialog extends StatelessWidget { required this.content, this.cancel = "delete_dialog_cancel", this.ok = "backup_controller_page_background_battery_info_ok", + this.contentColor, }) : super(key: key); @override @@ -22,7 +24,10 @@ class ConfirmDialog extends StatelessWidget { return AlertDialog( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), title: Text(title).tr(), - content: Text(content).tr(), + content: Text( + content, + style: TextStyle(color: contentColor), + ).tr(), actions: [ TextButton( onPressed: () => Navigator.of(context).pop(false),