mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Spit and polish on the Accounts views
This commit is contained in:
@@ -105,7 +105,9 @@ struct AccountsManagementView: View {
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 25, height: 25)
|
||||
Text(account.nameForDisplay)
|
||||
}.swipeActions(edge: .trailing, allowsFullSwipe: false) {
|
||||
}
|
||||
.transition(.move(edge: .top))
|
||||
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
|
||||
if account != AccountManager.shared.defaultAccount {
|
||||
Button(role: .destructive) {
|
||||
accountToRemove.wrappedValue = account
|
||||
@@ -118,17 +120,19 @@ struct AccountsManagementView: View {
|
||||
}
|
||||
}.tint(.red)
|
||||
}
|
||||
Button {
|
||||
withAnimation {
|
||||
account.isActive.toggle()
|
||||
}
|
||||
} label: {
|
||||
if account.isActive {
|
||||
Image(systemName: "minus.circle")
|
||||
} else {
|
||||
Image(systemName: "togglepower")
|
||||
}
|
||||
}.tint(account.isActive ? .yellow : Color(uiColor: AppAssets.primaryAccentColor))
|
||||
}
|
||||
}
|
||||
|
||||
var inactiveFooterText: some View {
|
||||
if AccountManager.shared.sortedAccounts.filter({ $0.isActive == false }).count == 0 {
|
||||
return Text("NO_INACTIVE_ACCOUNT_FOOTER", tableName: "Settings")
|
||||
} else {
|
||||
return Text("")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct AddAccountView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user