From 48897cd8907977597c8df7ba0fffab7bcf5976c1 Mon Sep 17 00:00:00 2001 From: Milan Stute Date: Mon, 8 Mar 2021 23:33:07 +0100 Subject: [PATCH] Use NavigationView --- .../Views/OpenHaystackMainView.swift | 35 +++++-------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift b/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift index 8fbb8e4..29f6fbb 100644 --- a/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift +++ b/OpenHaystack/OpenHaystack/HaystackApp/Views/OpenHaystackMainView.swift @@ -31,29 +31,16 @@ struct OpenHaystackMainView: View { @State var showESP32DeploySheet = false var body: some View { - GeometryReader { geo in - ZStack { - VStack { - HStack { - ManageAccessoriesView( - alertType: self.$alertType, - focusedAccessory: self.$focusedAccessory, - accessoryToDeploy: self.$accessoryToDeploy, - showESP32DeploySheet: self.$showESP32DeploySheet) - Spacer() - - VStack { - self.mapView - }.frame(width: geo.size.width * 0.5, alignment: .trailing) - - } - - if searchPartyTokenLoaded == false { - TextField("Search Party token", text: self.$searchPartyToken) - } - } + NavigationView { + ManageAccessoriesView( + alertType: self.$alertType, + focusedAccessory: self.$focusedAccessory, + accessoryToDeploy: self.$accessoryToDeploy, + showESP32DeploySheet: self.$showESP32DeploySheet) + VStack { + self.mapView if self.popUpAlertType != nil { VStack { Spacer() @@ -88,8 +75,7 @@ struct OpenHaystackMainView: View { self.onAppear() } } - .padding([.leading, .trailing, .bottom]) - .frame(minWidth: 720, maxWidth: .infinity, minHeight: 480, maxHeight: .infinity) + .navigationTitle("OpenHaystack") } // MARK: Subviews @@ -113,9 +99,6 @@ struct OpenHaystackMainView: View { AccessoryMapView(accessoryController: self.accessoryController, mapType: self.$mapType, focusedAccessory: self.focusedAccessory) .overlay(self.mapOverlay) - .cornerRadius(15.0) - .clipped() - .padding([.top, .bottom], 15) VStack { Spacer()