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