From 7f71ddce1dfc844d50f22f16000c46f35bd9c4d7 Mon Sep 17 00:00:00 2001 From: Joel Klabo Date: Thu, 29 Dec 2022 17:58:56 -0800 Subject: [PATCH] Move Relay Add Button to Section Header --- damus/Views/ConfigView.swift | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/damus/Views/ConfigView.swift b/damus/Views/ConfigView.swift index 870d04fc..719c2d11 100644 --- a/damus/Views/ConfigView.swift +++ b/damus/Views/ConfigView.swift @@ -54,10 +54,19 @@ struct ConfigView: View { var body: some View { ZStack(alignment: .leading) { Form { - Section("Relays") { + Section { List(Array(relays), id: \.url) { relay in 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") { @@ -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") .navigationBarTitleDisplayMode(.large)