mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
38 lines
910 B
Swift
38 lines
910 B
Swift
|
//
|
||
|
// ChatView.swift
|
||
|
// SimpleX
|
||
|
//
|
||
|
// Created by Evgeny Poberezkin on 27/01/2022.
|
||
|
// Copyright © 2022 SimpleX Chat. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
|
||
|
struct ChatView: View {
|
||
|
@EnvironmentObject var chatModel: ChatModel
|
||
|
var chatInfo: ChatInfo
|
||
|
var body: some View {
|
||
|
VStack {
|
||
|
if let chat: Chat = chatModel.chats[chatInfo.id] {
|
||
|
VStack {
|
||
|
ScrollView {
|
||
|
LazyVStack {
|
||
|
ForEach(chat.chatItems) { chatItem in
|
||
|
Text(chatItem.content.text)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
Text("unexpected: chat not found...")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//struct ChatView_Previews: PreviewProvider {
|
||
|
// static var previews: some View {
|
||
|
// ChatView()
|
||
|
// }
|
||
|
//}
|