Show visibility levels on reblog button

This commit is contained in:
Justin Mazzocchi 2021-02-07 09:55:56 -08:00
parent a1d43e8c5f
commit b7f792a7d7
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -683,9 +683,23 @@ private extension StatusView {
} }
func setButtonImages(scale: UIImage.SymbolScale) { func setButtonImages(scale: UIImage.SymbolScale) {
let visibility = statusConfiguration.viewModel.visibility
let reblogSystemImageName: String
if statusConfiguration.viewModel.configuration.isContextParent {
reblogSystemImageName = "arrow.2.squarepath"
} else {
switch visibility {
case .public, .unlisted:
reblogSystemImageName = "arrow.2.squarepath"
default:
reblogSystemImageName = visibility.systemImageName
}
}
replyButton.setImage(UIImage(systemName: "bubble.right", replyButton.setImage(UIImage(systemName: "bubble.right",
withConfiguration: UIImage.SymbolConfiguration(scale: scale)), for: .normal) withConfiguration: UIImage.SymbolConfiguration(scale: scale)), for: .normal)
reblogButton.setImage(UIImage(systemName: "arrow.2.squarepath", reblogButton.setImage(UIImage(systemName: reblogSystemImageName,
withConfiguration: UIImage.SymbolConfiguration(scale: scale)), for: .normal) withConfiguration: UIImage.SymbolConfiguration(scale: scale)), for: .normal)
favoriteButton.setImage(UIImage(systemName: statusConfiguration.viewModel.favorited ? "star.fill" : "star", favoriteButton.setImage(UIImage(systemName: statusConfiguration.viewModel.favorited ? "star.fill" : "star",
withConfiguration: UIImage.SymbolConfiguration(scale: scale)), for: .normal) withConfiguration: UIImage.SymbolConfiguration(scale: scale)), for: .normal)