implement quote view in message info screen

pull/874/head
Ryan ZHAO 8 months ago
parent 0d27bbed00
commit 4353f16694

@ -149,6 +149,7 @@ struct QuoteView_SwiftUI: View {
Text(author) Text(author)
.bold() .bold()
.font(.system(size: Values.smallFontSize)) .font(.system(size: Values.smallFontSize))
.lineLimit(1)
.foregroundColor(themeColor: targetThemeColor) .foregroundColor(themeColor: targetThemeColor)
} }
@ -170,6 +171,7 @@ struct QuoteView_SwiftUI: View {
] ]
) )
) )
.lineLimit(2)
} else { } else {
Text("QUOTED_MESSAGE_NOT_FOUND".localized()) Text("QUOTED_MESSAGE_NOT_FOUND".localized())
.font(.system(size: Values.smallFontSize)) .font(.system(size: Values.smallFontSize))

@ -413,34 +413,27 @@ struct MessageBubble: View {
isOutgoing: (messageViewModel.variant == .standardOutgoing)) isOutgoing: (messageViewModel.variant == .standardOutgoing))
} }
} }
// else { else {
// // Stack view if let quote = messageViewModel.quote {
// let stackView = UIStackView(arrangedSubviews: []) QuoteView_SwiftUI(
// stackView.axis = .vertical info: .init(
// stackView.spacing = 2 mode: .regular,
// authorId: quote.authorId,
// // Quote view quotedText: quote.body,
// if let quote: Quote = messageViewModel.quote { threadVariant: messageViewModel.threadVariant,
// let hInset: CGFloat = 2 currentUserPublicKey: messageViewModel.currentUserPublicKey,
// let quoteView: QuoteView = QuoteView( currentUserBlinded15PublicKey: messageViewModel.currentUserBlinded15PublicKey,
// for: .regular, currentUserBlinded25PublicKey: messageViewModel.currentUserBlinded25PublicKey,
// authorId: quote.authorId, direction: (messageViewModel.variant == .standardOutgoing ? .outgoing : .incoming),
// quotedText: quote.body, attachment: messageViewModel.quoteAttachment
// threadVariant: cellViewModel.threadVariant, )
// currentUserPublicKey: cellViewModel.currentUserPublicKey, )
// currentUserBlinded15PublicKey: cellViewModel.currentUserBlinded15PublicKey, .padding(.top, Self.inset)
// currentUserBlinded25PublicKey: cellViewModel.currentUserBlinded25PublicKey, .padding(.horizontal, Self.inset)
// direction: (cellViewModel.variant == .standardOutgoing ? .padding(.bottom, -Values.smallSpacing)
// .outgoing : }
// .incoming }
// ),
// attachment: cellViewModel.quoteAttachment,
// hInset: hInset,
// maxWidth: maxWidth
// )
// let quoteViewContainer = UIView(wrapping: quoteView, withInsets: UIEdgeInsets(top: 0, leading: hInset, bottom: 0, trailing: hInset))
// stackView.addArrangedSubview(quoteViewContainer)
// }
if let bodyText: NSAttributedString = VisibleMessageCell.getBodyAttributedText( if let bodyText: NSAttributedString = VisibleMessageCell.getBodyAttributedText(
for: messageViewModel, for: messageViewModel,
theme: ThemeManager.currentTheme, theme: ThemeManager.currentTheme,

Loading…
Cancel
Save