Refactored creation of UserSessionListItemViewData, added inactive session icon

This commit is contained in:
Aleksandrs Proskurins
2022-10-03 15:45:06 +03:00
parent 97be8fef5a
commit e9c21b5320
10 changed files with 153 additions and 59 deletions
@@ -16,7 +16,7 @@
import SwiftUI
struct UserOtherSessionsHeaderViewData {
struct UserOtherSessionsHeaderViewData: Hashable {
var title: String?
var subtitle: String
var iconName: String?
@@ -24,6 +24,10 @@ struct UserOtherSessionsHeaderViewData {
struct UserOtherSessionsHeaderView: View {
private var backgroundShape: RoundedRectangle {
RoundedRectangle(cornerRadius: 8)
}
@Environment(\.theme) private var theme
let viewData: UserOtherSessionsHeaderViewData
@@ -33,13 +37,15 @@ struct UserOtherSessionsHeaderView: View {
if let iconName = viewData.iconName {
Image(iconName)
.foregroundColor(.red)
.frame(width: 40, height: 40)
.background(theme.colors.background)
.clipShape(backgroundShape)
.shapedBorder(color: theme.colors.quinaryContent, borderWidth: 1.0, shape: backgroundShape)
}
VStack(alignment: .leading, spacing: 0, content: {
if let title = viewData.title {
Text(title)
.font(.callout)
.textCase(.uppercase)
.font(theme.fonts.footnote)
.font(theme.fonts.calloutSB)
.foregroundColor(theme.colors.primaryContent)
.padding(.bottom, 9.0)
}