mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
Sign out menu button
This commit is contained in:
+22
-2
@@ -21,8 +21,10 @@ struct UserOtherSessionsToolbar: ToolbarContent {
|
||||
|
||||
@Binding var isEditModeEnabled: Bool
|
||||
@Binding var filter: UserOtherSessionsFilter
|
||||
var allItemsSelected: Bool
|
||||
let allItemsSelected: Bool
|
||||
let sessionCount: Int
|
||||
let onToggleSelection: () -> Void
|
||||
let onSignOut: () -> Void
|
||||
|
||||
var body: some ToolbarContent {
|
||||
navigationBarLeading()
|
||||
@@ -83,7 +85,7 @@ struct UserOtherSessionsToolbar: ToolbarContent {
|
||||
} label: {
|
||||
Label(VectorL10n.userOtherSessionMenuSelectSessions, systemImage: "checkmark.circle")
|
||||
}
|
||||
|
||||
signOutButton()
|
||||
} label: {
|
||||
Image(systemName: "ellipsis")
|
||||
.padding(.horizontal, 4)
|
||||
@@ -91,4 +93,22 @@ struct UserOtherSessionsToolbar: ToolbarContent {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func signOutButton() -> some View {
|
||||
let label = Label(VectorL10n.userOtherSessionMenuSignOutSessions(String(sessionCount)), systemImage: "rectangle.portrait.and.arrow.forward.fill")
|
||||
if #available(iOS 15, *) {
|
||||
Button(role: .destructive) {
|
||||
onSignOut()
|
||||
} label: {
|
||||
label
|
||||
}
|
||||
} else {
|
||||
Button {
|
||||
onSignOut()
|
||||
} label: {
|
||||
label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user