animation

This commit is contained in:
spaced4ndy 2023-11-30 17:07:05 +04:00
parent ceb9406fcf
commit 784c956460

View File

@ -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)
}