mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-26 03:12:15 +00:00
* android, desktop: sharing channel links - types, api, strings * implementation * fix build * improve layout * improve card layouts * better divider * preview image * icon, preview * better icons * bigger icon * darker icons * better icon colors * better layouts * compose preview for chat links * sizes * fix editing --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
43 lines
1.3 KiB
Swift
43 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, 8)
|
|
.padding(.trailing, 12)
|
|
.background(theme.appColors.sentMessage)
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
}
|