Refactor Navigation Toolbar into Separate View
This commit is contained in:
parent
379d3c8a0e
commit
5e199f41f8
@ -29,16 +29,12 @@ struct ContentView: View {
|
||||
FeedListView(feeds: [])
|
||||
.environmentObject(dataStore)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .bottomBar) {
|
||||
HStack {
|
||||
Button(action: {
|
||||
self.currentView = 0
|
||||
}) {
|
||||
VStack {
|
||||
Label("Discovery", systemImage: "dot.radiowaves.left.and.right")
|
||||
Text("Discovery")
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
@ -47,7 +43,6 @@ struct ContentView: View {
|
||||
}) {
|
||||
VStack {
|
||||
Label("Feeds", systemImage: "person.2")
|
||||
Text("Feeds")
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
@ -56,11 +51,13 @@ struct ContentView: View {
|
||||
}) {
|
||||
VStack {
|
||||
Label("Settings",systemImage: "gear")
|
||||
Text("Settings")
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(height: UIScreen.main.bounds.height * 0.05)
|
||||
}
|
||||
.padding()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,12 +18,6 @@ struct SettingsView: View {
|
||||
|
||||
|
||||
List {
|
||||
HStack {
|
||||
Spacer()
|
||||
Button("Edit") {
|
||||
isPresentingEditView = true
|
||||
}
|
||||
}
|
||||
Section(header: Text("Personal Feed ID")) {
|
||||
Label(dataStore.personalID, systemImage: "person.crop.circle")
|
||||
}
|
||||
@ -34,6 +28,13 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
.navigationTitle("Settings")
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button("Edit") {
|
||||
isPresentingEditView = true
|
||||
}
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $isPresentingEditView) {
|
||||
NavigationStack {
|
||||
SettingsEditView()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user