UserSessionsOverview: Add text headers to other sessions section.

This commit is contained in:
SBiOSoftWhare
2022-09-05 12:09:26 +02:00
parent 7f11c52ad0
commit 98c272a86c
2 changed files with 27 additions and 9 deletions

View File

@@ -45,16 +45,36 @@ struct UserSessionsOverview: View {
// Other sessions section
if viewModel.viewState.otherSessionsViewData.isEmpty == false {
VStack(spacing: 15) {
ForEach(viewModel.viewState.otherSessionsViewData) { viewData in
UserSessionListItem(viewData: viewData, onBackgroundTap: { sessionId in
viewModel.send(viewAction: .tapUserSession(sessionId))
})
VStack() {
// Section header
VStack(alignment: .leading) {
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionTitle)
.font(theme.fonts.footnote)
.foregroundColor(theme.colors.secondaryContent)
.padding(.bottom, 10)
Text(VectorL10n.userSessionsOverviewOtherSessionsSectionInfo)
.font(theme.fonts.footnote)
.foregroundColor(theme.colors.secondaryContent)
.padding(.bottom, 11)
}
.padding(.horizontal, 16)
// Device list
VStack(spacing: 16) {
ForEach(viewModel.viewState.otherSessionsViewData) { viewData in
UserSessionListItem(viewData: viewData, onBackgroundTap: { sessionId in
viewModel.send(viewAction: .tapUserSession(sessionId))
})
}
}
.padding(.vertical, 16)
.background(theme.colors.background)
}
}
}
.background(theme.colors.background)
.background(theme.colors.system)
.frame(maxHeight: .infinity)
.navigationTitle(VectorL10n.userSessionsOverviewTitle)
.activityIndicator(show: viewModel.viewState.showLoadingIndicator)