From a737ac19e51e32d49224967d7cfef2d903f746b0 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 14 Aug 2024 17:22:44 +0200 Subject: [PATCH] Add Labels in settings --- IceCubesApp/App/Tabs/Settings/SettingsTab.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 9b8410db..d166eef2 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -136,10 +136,10 @@ struct SettingsTabs: View { } } } + addAccountButton if !appAccountsManager.availableAccounts.isEmpty { editAccountButton } - addAccountButton } #if !os(visionOS) .listRowBackground(theme.primaryBackgroundColor) @@ -154,6 +154,7 @@ struct SettingsTabs: View { await timelineCache.clearCache(for: client.id) await sub.deleteSubscription() appAccountsManager.delete(account: account) + Telemetry.signal("account.removed") } } @@ -314,7 +315,7 @@ struct SettingsTabs: View { Button { addAccountSheetPresented.toggle() } label: { - Text("settings.account.add") + Label("settings.account.add", systemImage: "person.badge.plus") } .sheet(isPresented: $addAccountSheetPresented) { AddAccountView() @@ -322,15 +323,17 @@ struct SettingsTabs: View { } private var editAccountButton: some View { - Button(role: isEditingAccount ? .none : .destructive) { + Button(role: .destructive) { withAnimation { isEditingAccount.toggle() } } label: { if isEditingAccount { - Text("action.done") + Label("action.done", systemImage: "person.badge.minus") + .foregroundStyle(.red) } else { - Text("account.action.logout") + Label("account.action.logout", systemImage: "person.badge.minus") + .foregroundStyle(.red) } } }