From ffbff93374a3ffa4d77dcdc9d747ba94f9abddc8 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 3 Dec 2022 19:21:47 +0000 Subject: [PATCH] ios: menu to hide revealed chat item (#1490) --- apps/ios/Shared/Views/Chat/ChatView.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 332438ce00..0a3a7da0b8 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -480,6 +480,9 @@ struct ChatView: View { if ci.meta.editable && !mc.isVoice { menu.append(editAction()) } + if revealed { + menu.append(hideUIAction()) + } menu.append(deleteUIAction()) } else if ci.meta.itemDeleted { menu.append(revealUIAction()) @@ -562,6 +565,17 @@ struct ChatView: View { } } } + + private func hideUIAction() -> UIAction { + UIAction( + title: NSLocalizedString("Hide", comment: "chat item action"), + image: UIImage(systemName: "eye.slash") + ) { _ in + withAnimation { + revealed = false + } + } + } private func deleteUIAction() -> UIAction { UIAction(