Show milestone and pull request states

This commit is contained in:
Georg Bauer
2026-07-31 18:39:10 +02:00
parent acf2c839ad
commit 128be97e20
6 changed files with 148 additions and 33 deletions

View File

@@ -267,17 +267,32 @@ func configureIssueStateIcon(
_ icon: UIImageView,
state: String,
textStyle: UIFont.TextStyle
) {
configureOpenClosedStateIcon(icon, state: state, subject: "issue", textStyle: textStyle)
}
func configureOpenClosedStateIcon(
_ icon: UIImageView,
state: String,
subject: String,
textStyle: UIFont.TextStyle
) {
let symbol: String
let color: UIColor
let accessibilityLabel: String
switch state {
case "open":
(symbol, color, accessibilityLabel) = ("exclamationmark.circle.fill", .systemGreen, "Open issue")
(symbol, color, accessibilityLabel) = (
"exclamationmark.circle.fill", .systemGreen, "Open \(subject)"
)
case "closed":
(symbol, color, accessibilityLabel) = ("checkmark.circle.fill", .systemPurple, "Closed issue")
(symbol, color, accessibilityLabel) = (
"checkmark.circle.fill", .systemPurple, "Closed \(subject)"
)
default:
(symbol, color, accessibilityLabel) = ("questionmark.circle.fill", .systemGray, "Unknown issue state")
(symbol, color, accessibilityLabel) = (
"questionmark.circle.fill", .systemGray, "Unknown \(subject) state"
)
}
icon.image = UIImage(systemName: symbol)
icon.tintColor = color