Files
simplex-chat/apps/ios/Shared/Views/Chat/ChatItem/CIEventView.swift
T
Evgeny Poberezkin d5fc0d7dfc core: update event name, ios: types/api/ui (wip) to switch connection to another address, fix contact/member info view, fix setting multiple servers (#1281)
* core: update event name, ios: types/api/ui (wip) to switch connection to another address, fix contact/member info view, fix setting multiple servers

* fix

* update strings

Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com>
2022-11-01 20:30:53 +00:00

51 lines
1.2 KiB
Swift

//
// CIEventView.swift
// SimpleX (iOS)
//
// Created by JRoberts on 20.07.2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
import SwiftUI
import SimpleXChat
struct CIEventView: View {
var chatItem: ChatItem
var body: some View {
HStack(alignment: .bottom, spacing: 0) {
if let member = chatItem.memberDisplayName {
Text(member)
.font(.caption)
.foregroundColor(.secondary)
.fontWeight(.light)
+ Text(" ")
+ eventText()
} else {
eventText()
}
}
.padding(.leading, 6)
.padding(.bottom, 6)
.textSelection(.disabled)
}
func eventText() -> Text {
Text(chatItem.content.text)
.font(.caption)
.foregroundColor(.secondary)
.fontWeight(.light)
+ Text(" ")
+ chatItem.timestampText
.font(.caption)
.foregroundColor(Color.secondary)
.fontWeight(.light)
}
}
struct CIEventView_Previews: PreviewProvider {
static var previews: some View {
CIEventView(chatItem: ChatItem.getGroupEventSample())
}
}