Swap out sent open group invitation icon
This commit is contained in:
parent
4eff61595a
commit
00300afecb
|
@ -3,6 +3,7 @@ final class OpenGroupInvitationView : UIView {
|
|||
private let name: String
|
||||
private let rawURL: String
|
||||
private let textColor: UIColor
|
||||
private let isOutgoing: Bool
|
||||
|
||||
private lazy var url: String = {
|
||||
if let range = rawURL.range(of: "?public_key=") {
|
||||
|
@ -17,10 +18,11 @@ final class OpenGroupInvitationView : UIView {
|
|||
private static let iconImageViewSize: CGFloat = 48
|
||||
|
||||
// MARK: Lifecycle
|
||||
init(name: String, url: String, textColor: UIColor) {
|
||||
init(name: String, url: String, textColor: UIColor, isOutgoing: Bool) {
|
||||
self.name = name
|
||||
self.rawURL = url
|
||||
self.textColor = textColor
|
||||
self.isOutgoing = isOutgoing
|
||||
super.init(frame: CGRect.zero)
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
@ -58,7 +60,8 @@ final class OpenGroupInvitationView : UIView {
|
|||
labelStackView.axis = .vertical
|
||||
// Icon
|
||||
let iconSize = OpenGroupInvitationView.iconSize
|
||||
let icon = UIImage(named: "Plus")?.withTint(.white)?.resizedImage(to: CGSize(width: iconSize, height: iconSize))
|
||||
let iconName = isOutgoing ? "Globe" : "Plus"
|
||||
let icon = UIImage(named: iconName)?.withTint(.white)?.resizedImage(to: CGSize(width: iconSize, height: iconSize))
|
||||
let iconImageViewSize = OpenGroupInvitationView.iconImageViewSize
|
||||
let iconImageView = UIImageView(image: icon)
|
||||
iconImageView.contentMode = .center
|
||||
|
|
|
@ -321,7 +321,7 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate {
|
|||
snContentView.addSubview(linkPreviewView)
|
||||
linkPreviewView.pin(to: snContentView)
|
||||
} else if let openGroupInvitationName = message.openGroupInvitationName, let openGroupInvitationURL = message.openGroupInvitationURL {
|
||||
let openGroupInvitationView = OpenGroupInvitationView(name: openGroupInvitationName, url: openGroupInvitationURL, textColor: bodyLabelTextColor)
|
||||
let openGroupInvitationView = OpenGroupInvitationView(name: openGroupInvitationName, url: openGroupInvitationURL, textColor: bodyLabelTextColor, isOutgoing: isOutgoing)
|
||||
snContentView.addSubview(openGroupInvitationView)
|
||||
openGroupInvitationView.pin(to: snContentView)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue