Files
simplex-chat/apps/ios/Shared/Views/Chat/ChatItem/DeletedItemView.swift
T
Evgeny @ SimpleX Chat 56b4ca73cc ios: exact alignment and spacing (#7945)
* ios: exact alignment and spacing

* ios: previews of the views changed for alignment and spacing

* ci: iOS references of exact alignment and spacing

* ios: single check and the time under a received emoji keep their places

* ios: deleted text, link strip text, What's new, app version, QR cards and onion hosts keep master's layout; info headers get more space above the avatar; chat row preview with contact requests

* ci: iOS references of the review round and of chat rows with contact requests

* ios: keep master's tags, requests, group icon, footers, compose strips

* ci: iOS references of the views back on master's layout

* ios: the pull request holds only the agreed changes, without previews of reverted ones

* ios: contact request view as on master
2026-11-01 07:46:07 +00:00

53 lines
1.8 KiB
Swift

//
// DeletedItemView.swift
// SimpleX
//
// Created by JRoberts on 04/02/2022.
// Copyright © 2022 SimpleX Chat. All rights reserved.
//
// Spec: spec/client/chat-view.md
import SwiftUI
import SimpleXChat
// Spec: spec/client/chat-view.md#DeletedItemView
struct DeletedItemView: View {
@EnvironmentObject var theme: AppTheme
@ObservedObject var chat: Chat
var chatItem: ChatItem
var body: some View {
ItemWithMeta {
CIMetaView(chat: chat, chatItem: chatItem, metaColor: theme.colors.secondary)
} content: { inlineMeta in
HStack(alignment: .lastTextBaseline, spacing: 0) {
Text(chatItem.content.text)
.foregroundColor(theme.colors.secondary)
.italic()
if let inlineMeta {
inlineMeta
.padding(.horizontal, 12)
}
}
.padding(.leading, 12)
.padding(.trailing, inlineMeta == nil ? 12 : 0)
.padding(.vertical, 6)
.background(chatItemFrameColor(chatItem, theme))
.if(inlineMeta == nil) { $0.modifier(ChatItemClipped(chatItem, tailVisible: false)) }
.textSelection(.disabled)
}
}
}
struct DeletedItemView_Previews: PreviewProvider {
static var previews: some View {
Group {
let ci1 = ChatItem.getDeletedContentSample(1, previewDate)
DeletedItemView(chat: Chat.sampleData, chatItem: ci1).modifier(ChatItemClipped(ci1, tailVisible: true))
let ci2 = ChatItem.getDeletedContentSample(dir: .groupRcv(groupMember: GroupMember.sampleData), previewDate)
DeletedItemView(chat: Chat.sampleData, chatItem: ci2).modifier(ChatItemClipped(ci2, tailVisible: true))
}
.previewLayout(.fixed(width: 360, height: 200))
}
}