Add Labels in settings

This commit is contained in:
Thomas Ricouard 2024-08-14 17:22:44 +02:00
parent 456d85eda2
commit a737ac19e5

View file

@ -136,10 +136,10 @@ struct SettingsTabs: View {
} }
} }
} }
addAccountButton
if !appAccountsManager.availableAccounts.isEmpty { if !appAccountsManager.availableAccounts.isEmpty {
editAccountButton editAccountButton
} }
addAccountButton
} }
#if !os(visionOS) #if !os(visionOS)
.listRowBackground(theme.primaryBackgroundColor) .listRowBackground(theme.primaryBackgroundColor)
@ -154,6 +154,7 @@ struct SettingsTabs: View {
await timelineCache.clearCache(for: client.id) await timelineCache.clearCache(for: client.id)
await sub.deleteSubscription() await sub.deleteSubscription()
appAccountsManager.delete(account: account) appAccountsManager.delete(account: account)
Telemetry.signal("account.removed")
} }
} }
@ -314,7 +315,7 @@ struct SettingsTabs: View {
Button { Button {
addAccountSheetPresented.toggle() addAccountSheetPresented.toggle()
} label: { } label: {
Text("settings.account.add") Label("settings.account.add", systemImage: "person.badge.plus")
} }
.sheet(isPresented: $addAccountSheetPresented) { .sheet(isPresented: $addAccountSheetPresented) {
AddAccountView() AddAccountView()
@ -322,15 +323,17 @@ struct SettingsTabs: View {
} }
private var editAccountButton: some View { private var editAccountButton: some View {
Button(role: isEditingAccount ? .none : .destructive) { Button(role: .destructive) {
withAnimation { withAnimation {
isEditingAccount.toggle() isEditingAccount.toggle()
} }
} label: { } label: {
if isEditingAccount { if isEditingAccount {
Text("action.done") Label("action.done", systemImage: "person.badge.minus")
.foregroundStyle(.red)
} else { } else {
Text("account.action.logout") Label("account.action.logout", systemImage: "person.badge.minus")
.foregroundStyle(.red)
} }
} }
} }