Cleanup merge leftovers

This commit is contained in:
Alfonso Grillo 2022-11-03 14:47:08 +01:00
parent c9f2aaa15f
commit 7934403d92
4 changed files with 27 additions and 16 deletions

View file

@ -87,6 +87,15 @@ struct UserOtherSessionsToolbar: ToolbarContent {
Label(VectorL10n.userOtherSessionMenuSelectSessions, systemImage: "checkmark.circle")
}
.disabled(sessionCount == 0)
Button {
isShowLocationEnabled.toggle()
} label: {
let text = isShowLocationEnabled ? VectorL10n.userSessionsHideLocationInfo : VectorL10n.userSessionsShowLocationInfo
let image = isShowLocationEnabled ? "eye.slash" : "eye"
Label(text, systemImage: image)
}
if sessionCount > 0 {
DestructiveButton {
onSignOut()
@ -94,14 +103,6 @@ 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)

View file

@ -54,10 +54,16 @@ struct UserSessionListItem: View {
Image(sessionDetailsIcon)
.padding(.leading, 2)
}
Text(viewData.sessionDetails)
.font(theme.fonts.caption1)
.foregroundColor(theme.colors.secondaryContent)
.multilineTextAlignment(.leading)
VStack(alignment: .leading, spacing: 0) {
Text(viewData.sessionDetails)
if showsLocationInfo, let ipText = ipText {
Text(ipText)
}
}
.font(theme.fonts.caption1)
.foregroundColor(theme.colors.secondaryContent)
.multilineTextAlignment(.leading)
}
.padding(.bottom, 16)
.padding(.trailing, 16)
@ -68,7 +74,8 @@ struct UserSessionListItem: View {
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.leading, 16)
}.onTapGesture {
}
.onTapGesture {
onBackgroundTap?(viewData.sessionId)
}
.onLongPressGesture {

View file

@ -27,7 +27,6 @@ struct UserSessionListItemViewData: Identifiable, Hashable {
let sessionId: SessionId
let sessionName: String
let sessionDetails: String
let highlightSessionDetails: Bool
let deviceAvatarViewData: DeviceAvatarViewData
let sessionDetailsIcon: String?
let isSelected: Bool

View file

@ -144,11 +144,15 @@ struct UserSessionsOverview: View {
private var otherSessionsMenu: some View {
Menu {
Button { viewModel.showLocationInfo.toggle() } label: {
Button {
viewModel.showLocationInfo.toggle()
} label: {
let text = viewModel.showLocationInfo ? VectorL10n.userSessionsHideLocationInfo : VectorL10n.userSessionsShowLocationInfo
let image = viewModel.showLocationInfo ? "eye.slash" : "eye"
Label(text, systemImage: image)
}
signOutButton
} label: {
menuImage
}
@ -186,7 +190,7 @@ struct UserSessionsOverview: View {
.foregroundColor(theme.colors.secondaryContent)
.padding(.bottom, 8.0)
Spacer()
optionsMenu
otherSessionsMenu
}
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionInfo)