From 75ebc01e7f30249c5a715a618b73acde0f459f60 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Fri, 1 Dec 2023 19:05:39 +0000 Subject: [PATCH] icons --- .../Shared/Views/ChatList/ChatListView.swift | 32 +++++++++---------- .../Views/NewChat/NewChatMenuButton.swift | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatListView.swift b/apps/ios/Shared/Views/ChatList/ChatListView.swift index bd4eaf1be..9a7ffd6f5 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListView.swift @@ -12,7 +12,7 @@ import SimpleXChat struct ChatListView: View { @EnvironmentObject var chatModel: ChatModel @Binding var showSettings: Bool - @State private var searchMode = false + @FocusState private var searchMode @State private var searchText = "" @State private var newChatMenuOption: NewChatMenuOption? = nil @State private var userPickerVisible = false @@ -85,7 +85,6 @@ struct ChatListView: View { .listStyle(.plain) .navigationBarTitleDisplayMode(.inline) .navigationBarHidden(searchMode) - .animation(.easeInOut(duration: 0.2)) .toolbar { ToolbarItem(placement: .navigationBarLeading) { let user = chatModel.currentUser ?? User.sampleData @@ -155,7 +154,6 @@ struct ChatListView: View { .disabled(chatModel.chatRunning != true) } .offset(x: -8) - .animation(nil) } } .onChange(of: chatModel.chatId) { _ in @@ -257,7 +255,7 @@ struct ChatListView: View { } private struct ChatListSearchBar: View { - @Binding var searchMode: Bool + @FocusState.Binding var searchMode: Bool @Binding var searchText: String @State private var showScanCodeSheet = false @State private var alert: PlanAndConnectAlert? @@ -269,13 +267,9 @@ private struct ChatListSearchBar: View { HStack(spacing: 4) { Image(systemName: "magnifyingglass") TextField("Search or paste link", text: $searchText) + .focused($searchMode) .foregroundColor(.primary) .frame(maxWidth: .infinity) - .onTapGesture { - withAnimation { - searchMode = true - } - } if searchMode { Image(systemName: "xmark.circle.fill") @@ -284,19 +278,25 @@ private struct ChatListSearchBar: View { searchText = "" } } else { - HStack(spacing: 16) { - Image(systemName: "doc") - .onTapGesture { - if let str = UIPasteboard.general.string { - searchText = str + HStack(spacing: 24) { + if UIPasteboard.general.hasURLs { + Image(systemName: "doc") + .onTapGesture { + if let str = UIPasteboard.general.string { + searchText = str + } } - } + } - Image(systemName: "qrcode") + Image(systemName: "qrcode.viewfinder") + .resizable() + .scaledToFit() + .frame(width: 27, height: 27) .onTapGesture { showScanCodeSheet = true } } + .padding(.trailing, 2) } } .padding(EdgeInsets(top: 7, leading: 7, bottom: 7, trailing: 7)) diff --git a/apps/ios/Shared/Views/NewChat/NewChatMenuButton.swift b/apps/ios/Shared/Views/NewChat/NewChatMenuButton.swift index e1d918109..c3452ce18 100644 --- a/apps/ios/Shared/Views/NewChat/NewChatMenuButton.swift +++ b/apps/ios/Shared/Views/NewChat/NewChatMenuButton.swift @@ -23,12 +23,12 @@ struct NewChatMenuButton: View { Button { newChatMenuOption = .newContact } label: { - Text("New contact") + Text("Add contact") } Button { newChatMenuOption = .newGroup } label: { - Text("New group") + Text("Create group") } } label: { Image(systemName: "square.and.pencil")