Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Move lock #2206

Merged
merged 3 commits into from
Sep 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Classes/Issues/IssueManagingContextController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,29 @@ final class IssueManagingContextController: NSObject, ContextMenuDelegate {
iconName = "x"
}

// Lock always has the divider above it assuming you're a collaborator.
// If you aren't a collaborator (Lock does not show), close has the divider above it.
let separator: Bool
switch action {
case .reopen, .close: separator = true
case .lock, .unlock: separator = true
case .reopen, .close: separator = permissions != .collaborator
default: separator = false
}

let iconColor: UIColor
switch action {
case .lock: iconColor = Styles.Colors.Gray.light.color
case .close: iconColor = Styles.Colors.Red.medium.color
default: iconColor = Styles.Colors.Blue.medium.color
}

return ContrastContextMenuItem(title: title, iconName: iconName, iconColor: iconColor,
separator: separator, action: actionBlock(action))
return ContrastContextMenuItem(
title: title,
iconName: iconName,
iconColor: iconColor,
separator: separator,
action: actionBlock(action)
)

}

Expand Down