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 {
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)
}
}
}