From 1dea54bae5062650d22a656d84012ef62c85a3a4 Mon Sep 17 00:00:00 2001 From: Sam Shi Date: Fri, 30 Dec 2022 23:36:21 -0500 Subject: [PATCH] move instance suggestion label into Button label to enable full-row tap target --- .../App/Tabs/Settings/AddAccountsView.swift | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/IceCubesApp/App/Tabs/Settings/AddAccountsView.swift b/IceCubesApp/App/Tabs/Settings/AddAccountsView.swift index fb884f34..31517f29 100644 --- a/IceCubesApp/App/Tabs/Settings/AddAccountsView.swift +++ b/IceCubesApp/App/Tabs/Settings/AddAccountsView.swift @@ -89,20 +89,22 @@ struct AddAccountView: View { .listRowBackground(theme.primaryBackgroundColor) } else { ForEach(instanceName.isEmpty ? instances : instances.filter{ $0.name.contains(instanceName.lowercased()) }) { instance in - VStack(alignment: .leading, spacing: 4) { - Text(instance.name) - .font(.headline) - Text(instance.info?.shortDescription ?? "") - .font(.body) - .foregroundColor(.gray) - Text("\(instance.users) users ⸱ \(instance.statuses) posts") - .font(.footnote) - .foregroundColor(.gray) + Button { + self.instanceName = instance.name + } label: { + VStack(alignment: .leading, spacing: 4) { + Text(instance.name) + .font(.headline) + .foregroundColor(.primary) + Text(instance.info?.shortDescription ?? "") + .font(.body) + .foregroundColor(.gray) + Text("\(instance.users) users ⸱ \(instance.statuses) posts") + .font(.footnote) + .foregroundColor(.gray) + } } .listRowBackground(theme.primaryBackgroundColor) - .onTapGesture { - self.instanceName = instance.name - } } } }