mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Refactoring [skip ci]
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
swift_library(
|
||||
name = "ChatNavigationButton",
|
||||
module_name = "ChatNavigationButton",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,27 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
public enum ChatNavigationButtonAction: Equatable {
|
||||
case openChatInfo(expandAvatar: Bool)
|
||||
case clearHistory
|
||||
case clearCache
|
||||
case cancelMessageSelection
|
||||
case search
|
||||
case dismiss
|
||||
case toggleInfoPanel
|
||||
case spacer
|
||||
}
|
||||
|
||||
public struct ChatNavigationButton: Equatable {
|
||||
public let action: ChatNavigationButtonAction
|
||||
public let buttonItem: UIBarButtonItem
|
||||
|
||||
public init(action: ChatNavigationButtonAction, buttonItem: UIBarButtonItem) {
|
||||
self.action = action
|
||||
self.buttonItem = buttonItem
|
||||
}
|
||||
|
||||
public static func ==(lhs: ChatNavigationButton, rhs: ChatNavigationButton) -> Bool {
|
||||
return lhs.action == rhs.action && lhs.buttonItem === rhs.buttonItem
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user