Add “show location” feature in other sessions list

This commit is contained in:
Alfonso Grillo
2022-11-02 15:31:36 +01:00
parent 3488cc508d
commit ea50296b10
5 changed files with 21 additions and 6 deletions
@@ -21,6 +21,7 @@ struct UserOtherSessionsToolbar: ToolbarContent {
@Binding var isEditModeEnabled: Bool
@Binding var filter: UserOtherSessionsFilter
@Binding var isShowLocationEnabled: Bool
let allItemsSelected: Bool
let sessionCount: Int
let onToggleSelection: () -> Void
@@ -93,6 +94,14 @@ struct UserOtherSessionsToolbar: ToolbarContent {
Label(VectorL10n.userOtherSessionMenuSignOutSessions(String(sessionCount)), systemImage: "rectangle.portrait.and.arrow.forward.fill")
}
}
Button {
isShowLocationEnabled.toggle()
} label: {
let text = isShowLocationEnabled ? VectorL10n.userSessionsHideLocationInfo : VectorL10n.userSessionsShowLocationInfo
let image = isShowLocationEnabled ? "eye.slash" : "eye"
Label(text, systemImage: image)
}
} label: {
Image(systemName: "ellipsis")
.padding(.horizontal, 4)