From 1e4012b1f689debbee0661e7b3c187ade9e2243c Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Fri, 3 May 2024 14:31:24 +0400 Subject: [PATCH] list going behind toolbars --- apps/ios/Shared/Views/ChatList/ChatsView.swift | 12 ++++++++++++ apps/ios/Shared/Views/Home/HomeView.swift | 18 +++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/apps/ios/Shared/Views/ChatList/ChatsView.swift b/apps/ios/Shared/Views/ChatList/ChatsView.swift index 82d19c367d..a18903cf94 100644 --- a/apps/ios/Shared/Views/ChatList/ChatsView.swift +++ b/apps/ios/Shared/Views/ChatList/ChatsView.swift @@ -23,6 +23,7 @@ struct ChatsView: View { @State private var newChatMenuOption: NewChatMenuOption? = nil // TODO remove? @AppStorage(DEFAULT_SHOW_UNREAD_AND_FAVORITES) private var showUnreadAndFavorites = false + @AppStorage(DEFAULT_SEARCH_IN_BOTTOM) private var searchInBottom = false @AppStorage(DEFAULT_CHAT_LIST_REVERSED) private var chatListReversed = false var body: some View { @@ -81,12 +82,23 @@ struct ChatsView: View { // .listRowSeparator(.hidden) // .frame(maxWidth: .infinity) // } + + if !searchInBottom { + Color.clear + .listRowSeparator(.hidden) + .frame(height: 35) // account for topToolbar height + } + ForEach(cs, id: \.viewId) { chat in ChatListNavLink(chat: chat) .padding(.trailing, -16) .disabled(chatModel.chatRunning != true || chatModel.deletedChats.contains(chat.chatInfo.id)) } .offset(x: -8) + + Color.clear + .listRowSeparator(.hidden) + .frame(height: searchInBottom ? 80 : 40) // account for bottomToolbar height } } .onChange(of: chatModel.chatId) { _ in diff --git a/apps/ios/Shared/Views/Home/HomeView.swift b/apps/ios/Shared/Views/Home/HomeView.swift index 1371c57248..0897e18445 100644 --- a/apps/ios/Shared/Views/Home/HomeView.swift +++ b/apps/ios/Shared/Views/Home/HomeView.swift @@ -271,19 +271,11 @@ struct HomeView: View { private func chatsView() -> some View { // TODO onboarding buttons (remove?) // TODO for reversed chat list start at bottom - VStack { - Spacer() - .frame(height: searchInBottom ? 0 : 45) // account for topToolbar height - - ChatsView( - searchText: $searchText, - searchShowingSimplexLink: $searchShowingSimplexLink, - searchChatFilteredBySimplexLink: $searchChatFilteredBySimplexLink - ) - - Spacer() - .frame(height: searchInBottom ? 90 : 50) // account for bottomToolbar height - } + ChatsView( + searchText: $searchText, + searchShowingSimplexLink: $searchShowingSimplexLink, + searchChatFilteredBySimplexLink: $searchChatFilteredBySimplexLink + ) .padding(.top, 5) }