Move Relay Add Button to Section Header

This commit is contained in:
Joel Klabo
2022-12-29 17:58:56 -08:00
committed by William Casarin
parent abf736ec2a
commit 7f71ddce1d

View File

@@ -54,10 +54,19 @@ struct ConfigView: View {
var body: some View { var body: some View {
ZStack(alignment: .leading) { ZStack(alignment: .leading) {
Form { Form {
Section("Relays") { Section {
List(Array(relays), id: \.url) { relay in List(Array(relays), id: \.url) { relay in
RelayView(state: state, relay: relay.url.absoluteString) RelayView(state: state, relay: relay.url.absoluteString)
} }
} header: {
HStack {
Text("Relays")
Spacer()
Button(action: { show_add_relay = true }) {
Image(systemName: "plus")
.foregroundColor(.accentColor)
}
}
} }
Section("Recommended Relays") { Section("Recommended Relays") {
@@ -110,20 +119,6 @@ struct ConfigView: View {
} }
} }
} }
VStack {
HStack {
Spacer()
Button(action: { show_add_relay = true }) {
Label("", systemImage: "plus")
.foregroundColor(.accentColor)
.padding()
}
}
Spacer()
}
} }
.navigationTitle("Settings") .navigationTitle("Settings")
.navigationBarTitleDisplayMode(.large) .navigationBarTitleDisplayMode(.large)