Avatars and Usernames color change (#1610)

* avatars and username color change

* force a replacement for the notification placeholders

* updated also the plain style

* Update project.yml

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* changelog

* UI tests updated

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-09-01 11:28:28 +02:00
committed by GitHub
parent 6df74aa21a
commit 38d6ffb363
245 changed files with 487 additions and 495 deletions
@@ -33,9 +33,8 @@ struct PlaceholderAvatarImage: View {
// This text's frame doesn't look right when redacted
if redactionReasons != .placeholder {
Text(textForImage)
.padding(geometry.size.width <= 30 ? 0 : 4)
.foregroundColor(.white)
.font(.system(size: 200).weight(.semibold))
.foregroundColor(avatarColor?.foreground ?? .white)
.font(.system(size: geometry.size.width * 0.5625, weight: .semibold))
.minimumScaleFactor(0.001)
.frame(alignment: .center)
}
@@ -55,11 +54,15 @@ struct PlaceholderAvatarImage: View {
return Color(.systemGray4) // matches the default text redaction
}
return avatarColor?.background ?? .compound.iconPrimary
}
private var avatarColor: AvatarColor? {
guard let contentID else {
return .compound.iconPrimary
return nil
}
return .element.avatarBackground(for: contentID)
return Color.compound.avatarColor(for: contentID)
}
}