fix link preview text colour

This commit is contained in:
Ryan Zhao 2022-03-17 10:43:11 +11:00
parent 6bc0177bd4
commit 95797d427c
1 changed files with 2 additions and 9 deletions

View File

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