1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-17 03:09:19 +01:00

Remove navigation-view on email-confirmation (#690)

This commit is contained in:
Nathan Mattes 2022-12-28 15:53:06 +01:00
parent a935cd83bb
commit 2be1cabca7
3 changed files with 0 additions and 53 deletions

View File

@ -396,7 +396,6 @@
"title": "Check Your Inbox", "title": "Check Your Inbox",
"tap_the_link_we_emailed_to_you_to_verify_your_account": "Tap the link we sent you to verify %@. Well wait right here.", "tap_the_link_we_emailed_to_you_to_verify_your_account": "Tap the link we sent you to verify %@. Well wait right here.",
"button": { "button": {
"open_email_app": "Open Email App",
"resend": "Resend" "resend": "Resend"
}, },
"dont_receive_email": { "dont_receive_email": {

View File

@ -41,13 +41,6 @@ final class MastodonConfirmEmailViewController: UIViewController, NeedsDependenc
imageView.contentMode = .scaleAspectFit imageView.contentMode = .scaleAspectFit
return imageView return imageView
}() }()
let navigationActionView: NavigationActionView = {
let navigationActionView = NavigationActionView()
navigationActionView.backgroundColor = Asset.Scene.Onboarding.background.color
return navigationActionView
}()
} }
extension MastodonConfirmEmailViewController { extension MastodonConfirmEmailViewController {
@ -69,7 +62,6 @@ extension MastodonConfirmEmailViewController {
stackView.addArrangedSubview(emailImageView) stackView.addArrangedSubview(emailImageView)
emailImageView.setContentHuggingPriority(.defaultLow, for: .vertical) emailImageView.setContentHuggingPriority(.defaultLow, for: .vertical)
emailImageView.setContentCompressionResistancePriority(.defaultLow, for: .vertical) emailImageView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
stackView.addArrangedSubview(navigationActionView)
view.addSubview(stackView) view.addSubview(stackView)
stackView.translatesAutoresizingMaskIntoConstraints = false stackView.translatesAutoresizingMaskIntoConstraints = false
@ -121,13 +113,6 @@ extension MastodonConfirmEmailViewController {
} }
.store(in: &self.disposeBag) .store(in: &self.disposeBag)
navigationActionView.backButton.setTitle(L10n.Scene.ConfirmEmail.Button.resend, for: .normal)
navigationActionView.backButton.addTarget(self, action: #selector(MastodonConfirmEmailViewController.resendButtonPressed(_:)), for: .touchUpInside)
navigationActionView.nextButton.setTitle(L10n.Scene.ConfirmEmail.Button.openEmailApp, for: .normal)
navigationActionView.nextButton.addTarget(self, action: #selector(MastodonConfirmEmailViewController.openEmailButtonPressed(_:)), for: .touchUpInside)
title = L10n.Scene.ConfirmEmail.title title = L10n.Scene.ConfirmEmail.title
} }
@ -152,19 +137,6 @@ extension MastodonConfirmEmailViewController {
} }
extension MastodonConfirmEmailViewController { extension MastodonConfirmEmailViewController {
@objc private func openEmailButtonPressed(_ sender: UIButton) {
let alertController = UIAlertController(title: L10n.Scene.ConfirmEmail.OpenEmailApp.title, message: L10n.Scene.ConfirmEmail.OpenEmailApp.description, preferredStyle: .alert)
let openEmailAction = UIAlertAction(title: L10n.Scene.ConfirmEmail.Button.openEmailApp, style: .default) { [weak self] _ in
guard let self = self else { return }
self.showEmailAppAlert()
}
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .cancel, handler: nil)
alertController.addAction(openEmailAction)
alertController.addAction(cancelAction)
alertController.preferredAction = openEmailAction
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
}
@objc private func resendButtonPressed(_ sender: UIButton) { @objc private func resendButtonPressed(_ sender: UIButton) {
let alertController = UIAlertController(title: L10n.Scene.ConfirmEmail.DontReceiveEmail.title, message: L10n.Scene.ConfirmEmail.DontReceiveEmail.description, preferredStyle: .alert) let alertController = UIAlertController(title: L10n.Scene.ConfirmEmail.DontReceiveEmail.title, message: L10n.Scene.ConfirmEmail.DontReceiveEmail.description, preferredStyle: .alert)
let resendAction = UIAlertAction(title: L10n.Scene.ConfirmEmail.DontReceiveEmail.resendEmail, style: .default) { _ in let resendAction = UIAlertAction(title: L10n.Scene.ConfirmEmail.DontReceiveEmail.resendEmail, style: .default) { _ in
@ -178,29 +150,6 @@ extension MastodonConfirmEmailViewController {
alertController.addAction(okAction) alertController.addAction(okAction)
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil)) _ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
} }
func showEmailAppAlert() {
let clients = ThirdPartyMailClient.clients
let availableClients = clients.filter { client -> Bool in
ThirdPartyMailer.isMailClientAvailable(client)
}
let alertController = UIAlertController(title: L10n.Scene.ConfirmEmail.OpenEmailApp.openEmailClient, message: nil, preferredStyle: .alert)
let alertAction = UIAlertAction(title: L10n.Scene.ConfirmEmail.OpenEmailApp.mail, style: .default) { _ in
UIApplication.shared.open(URL(string: "message://")!, options: [:], completionHandler: nil)
}
alertController.addAction(alertAction)
_ = availableClients.compactMap { client -> UIAlertAction in
let alertAction = UIAlertAction(title: client.name, style: .default) { _ in
ThirdPartyMailer.open(client, completionHandler: nil)
}
alertController.addAction(alertAction)
return alertAction
}
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .cancel, handler: nil)
alertController.addAction(cancelAction)
_ = self.coordinator.present(scene: .alertController(alertController: alertController), from: self, transition: .alertController(animated: true, completion: nil))
}
} }
// MARK: - PanPopableViewController // MARK: - PanPopableViewController

View File

@ -224,7 +224,6 @@ uploaded to Mastodon.";
"Scene.Compose.Visibility.Private" = "Followers only"; "Scene.Compose.Visibility.Private" = "Followers only";
"Scene.Compose.Visibility.Public" = "Public"; "Scene.Compose.Visibility.Public" = "Public";
"Scene.Compose.Visibility.Unlisted" = "Unlisted"; "Scene.Compose.Visibility.Unlisted" = "Unlisted";
"Scene.ConfirmEmail.Button.OpenEmailApp" = "Open Email App";
"Scene.ConfirmEmail.Button.Resend" = "Resend"; "Scene.ConfirmEmail.Button.Resend" = "Resend";
"Scene.ConfirmEmail.DontReceiveEmail.Description" = "Check if your email address is correct as well as your junk folder if you havent."; "Scene.ConfirmEmail.DontReceiveEmail.Description" = "Check if your email address is correct as well as your junk folder if you havent.";
"Scene.ConfirmEmail.DontReceiveEmail.ResendEmail" = "Resend Email"; "Scene.ConfirmEmail.DontReceiveEmail.ResendEmail" = "Resend Email";