Hide followers in preparation for (IOS-20)

This commit is contained in:
Nathan Mattes 2023-10-08 23:14:41 +02:00
parent 8866066266
commit 28792eca4c
1 changed files with 11 additions and 5 deletions

View File

@ -163,7 +163,7 @@ public class CondensedUserView: UIView {
} }
} }
public func configure(with account: Mastodon.Entity.Account) { public func configure(with account: Mastodon.Entity.Account, showFollowers: Bool = true) {
let displayNameMetaContent: MetaContent let displayNameMetaContent: MetaContent
do { do {
let content = MastodonContent(content: account.displayNameWithFallback, emojis: account.emojis?.asDictionary ?? [:]) let content = MastodonContent(content: account.displayNameWithFallback, emojis: account.emojis?.asDictionary ?? [:])
@ -174,10 +174,16 @@ public class CondensedUserView: UIView {
displayNameLabel.configure(content: displayNameMetaContent) displayNameLabel.configure(content: displayNameMetaContent)
acctLabel.text = account.acct acctLabel.text = account.acct
followersLabel.attributedText = NSAttributedString(
format: NSAttributedString(string: L10n.Common.UserList.followersCount("%@"), attributes: [.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .regular))]), if showFollowers {
args: NSAttributedString(string: Self.metricFormatter.string(from: account.followersCount) ?? account.followersCount.formatted(), attributes: [.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .bold))]) followersLabel.attributedText = NSAttributedString(
) format: NSAttributedString(string: L10n.Common.UserList.followersCount("%@"), attributes: [.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .regular))]),
args: NSAttributedString(string: Self.metricFormatter.string(from: account.followersCount) ?? account.followersCount.formatted(), attributes: [.font: UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 15, weight: .bold))])
)
followersLabel.isHidden = false
} else {
followersLabel.isHidden = false
}
avatarImageView.setImage(url: account.avatarImageURL()) avatarImageView.setImage(url: account.avatarImageURL())