mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Cleanup merge leftovers
This commit is contained in:
parent
c9f2aaa15f
commit
7934403d92
4 changed files with 27 additions and 16 deletions
|
@ -87,6 +87,15 @@ struct UserOtherSessionsToolbar: ToolbarContent {
|
||||||
Label(VectorL10n.userOtherSessionMenuSelectSessions, systemImage: "checkmark.circle")
|
Label(VectorL10n.userOtherSessionMenuSelectSessions, systemImage: "checkmark.circle")
|
||||||
}
|
}
|
||||||
.disabled(sessionCount == 0)
|
.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 {
|
if sessionCount > 0 {
|
||||||
DestructiveButton {
|
DestructiveButton {
|
||||||
onSignOut()
|
onSignOut()
|
||||||
|
@ -94,14 +103,6 @@ struct UserOtherSessionsToolbar: ToolbarContent {
|
||||||
Label(VectorL10n.userOtherSessionMenuSignOutSessions(String(sessionCount)), systemImage: "rectangle.portrait.and.arrow.forward.fill")
|
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: {
|
} label: {
|
||||||
Image(systemName: "ellipsis")
|
Image(systemName: "ellipsis")
|
||||||
.padding(.horizontal, 4)
|
.padding(.horizontal, 4)
|
||||||
|
|
|
@ -54,10 +54,16 @@ struct UserSessionListItem: View {
|
||||||
Image(sessionDetailsIcon)
|
Image(sessionDetailsIcon)
|
||||||
.padding(.leading, 2)
|
.padding(.leading, 2)
|
||||||
}
|
}
|
||||||
Text(viewData.sessionDetails)
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
.font(theme.fonts.caption1)
|
Text(viewData.sessionDetails)
|
||||||
.foregroundColor(theme.colors.secondaryContent)
|
|
||||||
.multilineTextAlignment(.leading)
|
if showsLocationInfo, let ipText = ipText {
|
||||||
|
Text(ipText)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.font(theme.fonts.caption1)
|
||||||
|
.foregroundColor(theme.colors.secondaryContent)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
}
|
}
|
||||||
.padding(.bottom, 16)
|
.padding(.bottom, 16)
|
||||||
.padding(.trailing, 16)
|
.padding(.trailing, 16)
|
||||||
|
@ -68,7 +74,8 @@ struct UserSessionListItem: View {
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.padding(.leading, 16)
|
.padding(.leading, 16)
|
||||||
}.onTapGesture {
|
}
|
||||||
|
.onTapGesture {
|
||||||
onBackgroundTap?(viewData.sessionId)
|
onBackgroundTap?(viewData.sessionId)
|
||||||
}
|
}
|
||||||
.onLongPressGesture {
|
.onLongPressGesture {
|
||||||
|
|
|
@ -27,7 +27,6 @@ struct UserSessionListItemViewData: Identifiable, Hashable {
|
||||||
let sessionId: SessionId
|
let sessionId: SessionId
|
||||||
let sessionName: String
|
let sessionName: String
|
||||||
let sessionDetails: String
|
let sessionDetails: String
|
||||||
let highlightSessionDetails: Bool
|
|
||||||
let deviceAvatarViewData: DeviceAvatarViewData
|
let deviceAvatarViewData: DeviceAvatarViewData
|
||||||
let sessionDetailsIcon: String?
|
let sessionDetailsIcon: String?
|
||||||
let isSelected: Bool
|
let isSelected: Bool
|
||||||
|
|
|
@ -144,11 +144,15 @@ struct UserSessionsOverview: View {
|
||||||
|
|
||||||
private var otherSessionsMenu: some View {
|
private var otherSessionsMenu: some View {
|
||||||
Menu {
|
Menu {
|
||||||
Button { viewModel.showLocationInfo.toggle() } label: {
|
Button {
|
||||||
|
viewModel.showLocationInfo.toggle()
|
||||||
|
} label: {
|
||||||
let text = viewModel.showLocationInfo ? VectorL10n.userSessionsHideLocationInfo : VectorL10n.userSessionsShowLocationInfo
|
let text = viewModel.showLocationInfo ? VectorL10n.userSessionsHideLocationInfo : VectorL10n.userSessionsShowLocationInfo
|
||||||
let image = viewModel.showLocationInfo ? "eye.slash" : "eye"
|
let image = viewModel.showLocationInfo ? "eye.slash" : "eye"
|
||||||
Label(text, systemImage: image)
|
Label(text, systemImage: image)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signOutButton
|
||||||
} label: {
|
} label: {
|
||||||
menuImage
|
menuImage
|
||||||
}
|
}
|
||||||
|
@ -186,7 +190,7 @@ struct UserSessionsOverview: View {
|
||||||
.foregroundColor(theme.colors.secondaryContent)
|
.foregroundColor(theme.colors.secondaryContent)
|
||||||
.padding(.bottom, 8.0)
|
.padding(.bottom, 8.0)
|
||||||
Spacer()
|
Spacer()
|
||||||
optionsMenu
|
otherSessionsMenu
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionInfo)
|
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionInfo)
|
||||||
|
|
Loading…
Reference in a new issue