Various Improvements

This commit is contained in:
Ilya Laktyushin
2021-12-23 13:18:00 +04:00
parent 888e5e1474
commit ed7cf17233
38 changed files with 1506 additions and 265 deletions

View File

@@ -56,6 +56,7 @@ final class ContactsControllerNode: ASDisplayNode {
var requestAddContact: ((String) -> Void)?
var openPeopleNearby: (() -> Void)?
var openInvite: (() -> Void)?
var openQrScan: (() -> Void)?
private var presentationData: PresentationData
private var presentationDataDisposable: Disposable?
@@ -70,8 +71,12 @@ final class ContactsControllerNode: ASDisplayNode {
var addNearbyImpl: (() -> Void)?
var inviteImpl: (() -> Void)?
var qrScanImpl: (() -> Void)?
let options = [ContactListAdditionalOption(title: presentationData.strings.Contacts_AddPeopleNearby, icon: .generic(UIImage(bundleImageName: "Contact List/PeopleNearbyIcon")!), action: {
addNearbyImpl?()
}), ContactListAdditionalOption(title: presentationData.strings.Contacts_ScanQrCode, icon: .generic(UIImage(bundleImageName: "Settings/QrIcon")!), action: {
qrScanImpl?()
}), ContactListAdditionalOption(title: presentationData.strings.Contacts_InviteFriends, icon: .generic(UIImage(bundleImageName: "Contact List/AddMemberIcon")!), action: {
inviteImpl?()
})]
@@ -128,6 +133,12 @@ final class ContactsControllerNode: ASDisplayNode {
}
}
qrScanImpl = { [weak self] in
if let strongSelf = self {
strongSelf.openQrScan?()
}
}
contextAction = { [weak self] peer, node, gesture in
self?.contextAction(peer: peer, node: node, gesture: gesture)
}