mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-09 16:55:51 +00:00
chore: 🤖 reverted home view changes
BREAKING CHANGE: 🧨 g
This commit is contained in:
@@ -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<Content: View>: 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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user