mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Add “show location“ feature in session overview
This commit is contained in:
@@ -36,12 +36,17 @@ enum UserSessionOverviewViewModelResult: Equatable {
|
||||
|
||||
// MARK: View
|
||||
|
||||
struct UserSessionOverviewViewBindings {
|
||||
var showLocationInfo = false
|
||||
}
|
||||
|
||||
struct UserSessionOverviewViewState: BindableState {
|
||||
var cardViewData: UserSessionCardViewData
|
||||
let isCurrentSession: Bool
|
||||
var isPusherEnabled: Bool?
|
||||
var remotelyTogglingPushersAvailable: Bool
|
||||
var showLoadingIndicator: Bool
|
||||
var bindings: UserSessionOverviewViewBindings = .init()
|
||||
}
|
||||
|
||||
enum UserSessionOverviewViewAction {
|
||||
|
||||
@@ -28,7 +28,7 @@ struct UserSessionOverview: View {
|
||||
},
|
||||
onViewDetailsAction: { _ in
|
||||
viewModel.send(viewAction: .viewSessionDetails)
|
||||
})
|
||||
}, showLocationInformations: viewModel.showLocationInfo)
|
||||
.padding(16)
|
||||
SwiftUI.Section {
|
||||
UserSessionOverviewItem(title: VectorL10n.userSessionOverviewSessionDetailsButtonTitle,
|
||||
@@ -68,6 +68,14 @@ struct UserSessionOverview: View {
|
||||
Label(VectorL10n.manageSessionRename, systemImage: "pencil")
|
||||
}
|
||||
.accessibilityIdentifier(VectorL10n.manageSessionRename)
|
||||
|
||||
if viewModel.viewState.isCurrentSession == false {
|
||||
Button { viewModel.showLocationInfo.toggle() } label: {
|
||||
let text = viewModel.showLocationInfo ? VectorL10n.userSessionsHideLocationInfo : VectorL10n.userSessionsShowLocationInfo
|
||||
let image = viewModel.showLocationInfo ? "eye.slash" : "eye"
|
||||
Label(text, systemImage: image)
|
||||
}
|
||||
}
|
||||
}
|
||||
DestructiveButton {
|
||||
viewModel.send(viewAction: .logoutOfSession)
|
||||
|
||||
Reference in New Issue
Block a user