mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Sing out filtering
This commit is contained in:
+40
-5
@@ -164,11 +164,15 @@ struct UserSessionsOverview: View {
|
||||
.background(theme.colors.background)
|
||||
} header: {
|
||||
VStack(alignment: .leading) {
|
||||
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionTitle)
|
||||
.textCase(.uppercase)
|
||||
.font(theme.fonts.footnote)
|
||||
.foregroundColor(theme.colors.secondaryContent)
|
||||
.padding(.bottom, 8.0)
|
||||
HStack {
|
||||
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionTitle)
|
||||
.textCase(.uppercase)
|
||||
.font(theme.fonts.footnote)
|
||||
.foregroundColor(theme.colors.secondaryContent)
|
||||
.padding(.bottom, 8.0)
|
||||
Spacer()
|
||||
optionsMenu
|
||||
}
|
||||
|
||||
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionInfo)
|
||||
.font(theme.fonts.footnote)
|
||||
@@ -198,6 +202,37 @@ struct UserSessionsOverview: View {
|
||||
}
|
||||
.background(theme.colors.system.ignoresSafeArea())
|
||||
}
|
||||
|
||||
private var optionsMenu: some View {
|
||||
Button { } label: {
|
||||
Menu {
|
||||
signOutButton
|
||||
} label: {
|
||||
Image(systemName: "ellipsis")
|
||||
.foregroundColor(theme.colors.secondaryContent)
|
||||
.padding(.horizontal, 4)
|
||||
.padding(.vertical, 12)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var signOutButton: some View {
|
||||
let label = Label(VectorL10n.userOtherSessionMenuSignOutSessions(String(viewModel.viewState.otherSessionsViewData.count)), systemImage: "rectangle.portrait.and.arrow.forward.fill")
|
||||
if #available(iOS 15, *) {
|
||||
Button(role: .destructive) {
|
||||
viewModel.send(viewAction: .signOutOtherSessions)
|
||||
} label: {
|
||||
label
|
||||
}
|
||||
} else {
|
||||
Button {
|
||||
viewModel.send(viewAction: .signOutOtherSessions)
|
||||
} label: {
|
||||
label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
Reference in New Issue
Block a user