* ios: add context menu to messages * ios: UI for replies with quotes * fix: scrolling crashing in chat * ios: UI for message replies with quotes * android: UI for message replies * android: messages with quotes * android: update imports * android: refactor ChatItemView * remove comments
35 lines
1.1 KiB
Swift
35 lines
1.1 KiB
Swift
//
|
|
// ChatItemView.swift
|
|
// SimpleX
|
|
//
|
|
// Created by Evgeny Poberezkin on 30/01/2022.
|
|
// Copyright © 2022 SimpleX Chat. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ChatItemView: View {
|
|
var chatItem: ChatItem
|
|
|
|
var body: some View {
|
|
if (chatItem.quotedItem == nil && isShortEmoji(chatItem.content.text)) {
|
|
EmojiItemView(chatItem: chatItem)
|
|
} else {
|
|
FramedItemView(chatItem: chatItem)
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ChatItemView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
Group{
|
|
ChatItemView(chatItem: ChatItem.getSample(1, .directSnd, .now, "hello"))
|
|
ChatItemView(chatItem: ChatItem.getSample(2, .directRcv, .now, "hello there too"))
|
|
ChatItemView(chatItem: ChatItem.getSample(1, .directSnd, .now, "🙂"))
|
|
ChatItemView(chatItem: ChatItem.getSample(2, .directRcv, .now, "🙂🙂🙂🙂🙂"))
|
|
ChatItemView(chatItem: ChatItem.getSample(2, .directRcv, .now, "🙂🙂🙂🙂🙂🙂"))
|
|
}
|
|
.previewLayout(.fixed(width: 360, height: 70))
|
|
}
|
|
}
|