mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-23 16:46:05 +00:00
* updated text items * update version * fix JSON parsing in CIDirection, refactor data samples * show group member in received messages and chat preview * use profile displayName instead of localDisplayName, do not show fullName if it is the same as displayName
38 lines
981 B
Swift
38 lines
981 B
Swift
//
|
|
// ChatInfoImage.swift
|
|
// SimpleX
|
|
//
|
|
// Created by Evgeny Poberezkin on 05/02/2022.
|
|
// Copyright © 2022 SimpleX Chat. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ChatInfoImage: View {
|
|
@ObservedObject var chat: Chat
|
|
var color = Color(uiColor: .tertiarySystemGroupedBackground)
|
|
|
|
var body: some View {
|
|
var iconName: String
|
|
switch chat.chatInfo {
|
|
case .direct: iconName = "person.crop.circle.fill"
|
|
case .group: iconName = "person.2.circle.fill"
|
|
default: iconName = "circle.fill"
|
|
}
|
|
|
|
return Image(systemName: iconName)
|
|
.resizable()
|
|
.foregroundColor(color)
|
|
}
|
|
}
|
|
|
|
struct ChatInfoImage_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ChatInfoImage(
|
|
chat: Chat(chatInfo: ChatInfo.sampleData.direct, chatItems: [])
|
|
, color: Color(red: 0.9, green: 0.9, blue: 0.9)
|
|
)
|
|
.previewLayout(.fixed(width: 63, height: 63))
|
|
}
|
|
}
|