* mobile: message delete * ios * android api * meta * android * new ios libs * bug fixes * adjust alert * fix deleted item upsert * change border color for ios * format * android - red button * ios: deleted item design * android: deleted item design * android alert msg Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
41 lines
1.4 KiB
Swift
41 lines
1.4 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 showMember = false
|
|
|
|
var body: some View {
|
|
if chatItem.isMsgContent() {
|
|
if (chatItem.quotedItem == nil && isShortEmoji(chatItem.content.text)) {
|
|
EmojiItemView(chatItem: chatItem)
|
|
} else {
|
|
FramedItemView(chatItem: chatItem, showMember: showMember)
|
|
}
|
|
} else if chatItem.isDeletedContent() {
|
|
DeletedItemView(chatItem: chatItem, showMember: showMember)
|
|
}
|
|
}
|
|
}
|
|
|
|
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, "🙂🙂🙂🙂🙂🙂"))
|
|
ChatItemView(chatItem: ChatItem.getDeletedContentSample())
|
|
}
|
|
.previewLayout(.fixed(width: 360, height: 70))
|
|
}
|
|
}
|