wrap profile picture view for swiftui
This commit is contained in:
parent
01ee543758
commit
a0ea28234f
|
@ -300,16 +300,28 @@ struct MessageInfoView: View {
|
|||
HStack(
|
||||
spacing: 10
|
||||
) {
|
||||
Circle()
|
||||
let (info, additionalInfo) = ProfilePictureView.getProfilePictureInfo(
|
||||
size: .message,
|
||||
publicKey: messageViewModel.authorId,
|
||||
threadVariant: .contact, // Always show the display picture in 'contact' mode
|
||||
customImageData: nil,
|
||||
profile: messageViewModel.profile,
|
||||
profileIcon: (messageViewModel.isSenderOpenGroupModerator ? .crown : .none)
|
||||
)
|
||||
|
||||
if let info: ProfilePictureView.Info = info {
|
||||
ProfilePictureSwiftUI(
|
||||
size: .list,
|
||||
info: info,
|
||||
additionalInfo: additionalInfo
|
||||
)
|
||||
.frame(
|
||||
width: 46,
|
||||
height: 46,
|
||||
alignment: .topLeading
|
||||
)
|
||||
.foregroundColor(themeColor: .primary)
|
||||
// ProfilePictureSwiftUI(size: .message)
|
||||
|
||||
|
||||
}
|
||||
|
||||
VStack(
|
||||
alignment: .leading,
|
||||
spacing: 4
|
||||
|
|
|
@ -553,8 +553,8 @@ public final class ProfilePictureView: UIView {
|
|||
|
||||
import SwiftUI
|
||||
|
||||
struct ProfilePictureSwiftUI: UIViewRepresentable {
|
||||
typealias UIViewType = ProfilePictureView
|
||||
public struct ProfilePictureSwiftUI: UIViewRepresentable {
|
||||
public typealias UIViewType = ProfilePictureView
|
||||
|
||||
var size: ProfilePictureView.Size
|
||||
var info: ProfilePictureView.Info
|
||||
|
@ -570,11 +570,11 @@ struct ProfilePictureSwiftUI: UIViewRepresentable {
|
|||
self.additionalInfo = additionalInfo
|
||||
}
|
||||
|
||||
func makeUIView(context: Context) -> ProfilePictureView {
|
||||
public func makeUIView(context: Context) -> ProfilePictureView {
|
||||
ProfilePictureView(size: size)
|
||||
}
|
||||
|
||||
func updateUIView(_ profilePictureView: ProfilePictureView, context: Context) {
|
||||
public func updateUIView(_ profilePictureView: ProfilePictureView, context: Context) {
|
||||
profilePictureView.update(
|
||||
info,
|
||||
additionalInfo: additionalInfo
|
||||
|
|
Loading…
Reference in New Issue