From 784c95646028f9b6ed3b790157848d41a196a4c1 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:07:05 +0400 Subject: [PATCH] animation --- apps/ios/Shared/Views/ChatList/ChatListView.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatListView.swift b/apps/ios/Shared/Views/ChatList/ChatListView.swift index 4997d14a0f..f30756a345 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListView.swift @@ -287,9 +287,11 @@ private struct ChatListSearchBar: View { .foregroundColor(.primary) .frame(maxWidth: .infinity) .onTapGesture { - searchMode = true + withAnimation { + searchMode = true + } } - + if searchMode { Image(systemName: "xmark.circle.fill") .opacity(searchText == "" ? 0 : 1) @@ -307,14 +309,16 @@ private struct ChatListSearchBar: View { .foregroundColor(.secondary) .background(Color(.tertiarySystemFill)) .cornerRadius(10.0) - + if searchMode { Text("Cancel") .foregroundColor(.accentColor) .onTapGesture { hideKeyboard() searchText = "" - searchMode = false + withAnimation { + searchMode = false + } } .transition(.identity) }