fix link preview text colour

pull/594/head
Ryan Zhao 3 years ago
parent 6bc0177bd4
commit 95797d427c

@ -12,6 +12,7 @@ final class LinkPreviewView : UIView {
let isOutgoing = (viewItem!.interaction.interactionType() == .outgoingMessage) let isOutgoing = (viewItem!.interaction.interactionType() == .outgoingMessage)
switch (isOutgoing, AppModeManager.shared.currentAppMode) { switch (isOutgoing, AppModeManager.shared.currentAppMode) {
case (true, .dark), (false, .light): return .black case (true, .dark), (false, .light): return .black
case (true, .light): return Colors.grey
default: return .white default: return .white
} }
}() }()
@ -133,15 +134,7 @@ final class LinkPreviewView : UIView {
loader.alpha = (image != nil) ? 0 : 1 loader.alpha = (image != nil) ? 0 : 1
if image != nil { loader.stopAnimating() } else { loader.startAnimating() } if image != nil { loader.stopAnimating() } else { loader.startAnimating() }
// Title // Title
let isSent = (linkPreviewState is LinkPreviewSent) titleLabel.textColor = sentLinkPreviewTextColor
let isOutgoing = (viewItem?.interaction.interactionType() == .outgoingMessage)
let textColor: UIColor
if isSent && isOutgoing && isLightMode {
textColor = .white
} else {
textColor = isDarkMode ? .white : .black
}
titleLabel.textColor = textColor
titleLabel.text = linkPreviewState.title() titleLabel.text = linkPreviewState.title()
// Horizontal stack view // Horizontal stack view
switch linkPreviewState { switch linkPreviewState {

Loading…
Cancel
Save