mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Refactored creation of UserSessionListItemViewData, added inactive session icon
This commit is contained in:
+10
-4
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user