Files
simplex-chat/apps/ios/Shared/Views/Chat/ComposeMessage/ComposeChatLinkView.swift
T
Evgeny f49d985119 ios: sharing channel links/cards (#6821)
* ios: sharing channel links/cards

* update nix shas

* improve

* fix preview

* change condition

* move button for owner

* refactor

* refactor 2

* fix sheets

* MsgChatLink JSON encoding

* correct default icon when editing group profile

* drop link from card

* card layout

* strip link from text

* remove file ref

* share via chat when created

* rename file, do not show text when there is no text

* better card layout

* padding, info string

* add log

* padding

* text layout

* warning emoji if signature verification failed

* chat link preview in chat list

* description

* alert information

* tappable preview

* better

* conditional border color

* sending and forwarding views

* small link icons for forwarding

* strip link in one place

* forwarded context

* quote view for chat links

* reduce diff, remove unnecessary changes

* simplify

* trim description

* diff

---------

Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
2026-04-17 21:10:00 +01:00

44 lines
1.3 KiB
Swift

import SwiftUI
import SimpleXChat
struct ComposeChatLinkView: View {
@EnvironmentObject var theme: AppTheme
var chatLink: MsgChatLink
var cancelPreview: () -> Void
let cancelEnabled: Bool
var body: some View {
HStack(alignment: .center, spacing: 8) {
ProfileImage(
imageStr: chatLink.image,
iconName: chatLink.iconName,
size: 44
)
.padding(.leading, 12)
VStack(alignment: .leading, spacing: 2) {
Text(chatLink.displayName)
.font(.headline)
.lineLimit(1)
if let descr = chatLink.shortDescription {
Text(descr)
.font(.caption)
.foregroundColor(theme.colors.secondary)
.lineLimit(1)
}
}
.padding(.vertical, 5)
Spacer()
if cancelEnabled {
Button { cancelPreview() } label: {
Image(systemName: "multiply")
}
}
}
.padding(.vertical, 1)
.padding(.trailing, 12)
.background(theme.appColors.sentMessage)
.frame(minHeight: 54)
.frame(maxWidth: .infinity)
}
}