From 0da98fbf6022345a174e95430bb0bbb6600fa068 Mon Sep 17 00:00:00 2001 From: Diogo Cunha Date: Thu, 20 Jun 2024 15:57:26 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20reverted=20home=20view?= =?UTF-8?q?=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: 🧨 g --- apps/ios/Shared/Views/Home/HomeView.swift | 55 +++++------------------ 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/apps/ios/Shared/Views/Home/HomeView.swift b/apps/ios/Shared/Views/Home/HomeView.swift index ecd1101583..75837040e3 100644 --- a/apps/ios/Shared/Views/Home/HomeView.swift +++ b/apps/ios/Shared/Views/Home/HomeView.swift @@ -61,15 +61,16 @@ struct HomeView: View { case .chats: withToolbar("Chats", chatListView) } } - - ToolbarView { - settingsButton() - Spacer() - contactsButton() - Spacer() - chatsButton() - Spacer() - newChatButton() + .toolbar { + ToolbarItemGroup(placement: .bottomBar) { + settingsButton() + Spacer() + contactsButton() + Spacer() + chatsButton() + Spacer() + newChatButton() + } } if #unavailable(iOS 16) { @@ -223,40 +224,6 @@ struct HomeView: View { } } -extension Notification.Name { - static let toolbarVisibilityChanged = Notification.Name("toolbarVisibilityChanged") -} - -struct ToolbarView: View { - @State var isVisible: Bool = true; - let content: Content - - init(@ViewBuilder content: () -> Content) { - self.content = content() - } - - var body: some View { - VStack { - Spacer() - if isVisible { - VStack {} - .toolbar { - ToolbarItemGroup(placement: .bottomBar) { - content - } - } - } - } - .onReceive(NotificationCenter.default.publisher(for: .toolbarVisibilityChanged)) { notification in - if let visibility = notification.object as? Bool { - if isVisible != visibility { - isVisible.toggle() - } - } - } - } -} - #Preview { HomeView(showSettings: Binding.constant(false)) -} +} \ No newline at end of file