Align link verification checkmark to link rather than screen edge

Closes #368
This commit is contained in:
Shadowfacts 2023-04-23 14:01:51 -04:00
parent ea5afeeb88
commit a1ffb23f0d
1 changed files with 4 additions and 3 deletions

View File

@ -201,6 +201,7 @@ private class ProfileFieldValueView: UIView {
if field.verifiedAt != nil {
var config = UIButton.Configuration.plain()
config.preferredSymbolConfigurationForImage = UIImage.SymbolConfiguration(scale: .medium)
config.image = UIImage(systemName: "checkmark")
config.baseForegroundColor = .systemGreen
let icon = UIButton(configuration: config)
@ -211,10 +212,10 @@ private class ProfileFieldValueView: UIView {
icon.isPointerInteractionEnabled = true
icon.accessibilityLabel = "Verified link"
addSubview(icon)
textViewTrailingConstraint = textView.trailingAnchor.constraint(equalTo: icon.leadingAnchor, constant: -4)
textViewTrailingConstraint = textView.trailingAnchor.constraint(equalTo: icon.leadingAnchor)
NSLayoutConstraint.activate([
icon.centerYAnchor.constraint(equalTo: centerYAnchor),
icon.trailingAnchor.constraint(equalTo: trailingAnchor),
icon.lastBaselineAnchor.constraint(equalTo: textView.lastBaselineAnchor),
icon.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor),
])
} else {
textViewTrailingConstraint = textView.trailingAnchor.constraint(equalTo: trailingAnchor)