Show milestone and pull request states
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user