feat: add close button on new conversation screens

pull/689/head
Ryan Zhao 3 years ago
parent ec8b9df3bb
commit e7778725a5

@ -82,6 +82,10 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
let customTitleFontSize = Values.largeFontSize
setNavBarTitle("vc_create_closed_group_title".localized(), customFontSize: customTitleFontSize)
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
closeButton.tintColor = Colors.text
navigationItem.rightBarButtonItem = closeButton
// Set up content
setUpViewHierarchy()
}

@ -72,9 +72,11 @@ final class NewDMVC : BaseVC, UIPageViewControllerDataSource, UIPageViewControll
setNavBarTitle(NSLocalizedString("vc_create_private_chat_title", comment: ""))
let navigationBar = navigationController!.navigationBar
// Set up navigation bar buttons
if !shouldShowBackButton {
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
closeButton.tintColor = Colors.text
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
closeButton.tintColor = Colors.text
if shouldShowBackButton {
navigationItem.rightBarButtonItem = closeButton
} else {
navigationItem.leftBarButtonItem = closeButton
}
// Set up page VC

@ -59,6 +59,10 @@ final class JoinOpenGroupVC: BaseVC, UIPageViewControllerDataSource, UIPageViewC
setUpNavBarStyle()
setNavBarTitle("vc_join_public_chat_title".localized())
let closeButton = UIBarButtonItem(image: #imageLiteral(resourceName: "X"), style: .plain, target: self, action: #selector(close))
closeButton.tintColor = Colors.text
navigationItem.rightBarButtonItem = closeButton
// Page VC
let hasCameraAccess = (AVCaptureDevice.authorizationStatus(for: .video) == .authorized)
pages = [ enterURLVC, (hasCameraAccess ? scanQRCodeWrapperVC : scanQRCodePlaceholderVC) ]

Loading…
Cancel
Save