From 0c8ccd8cc32fe07e2ba9d525ce5f4c5e2dc5e966 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 22 Oct 2019 14:25:29 +0200 Subject: [PATCH] Add FAQ link in Organizer (home) --- .../Organizer/OrganizerViewController.swift | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift index e97defa0..490eab3f 100644 --- a/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/OrganizerViewController.swift @@ -69,7 +69,7 @@ class OrganizerViewController: UITableViewController, StrongTableHost { model.setHeader(L10n.Core.Organizer.Sections.Support.header, forSection: .support) model.setHeader(L10n.Core.Organizer.Sections.Feedback.header, forSection: .feedback) model.set([.connectionStatus], forSection: .vpn) - model.set([.donate, .translate], forSection: .support) + model.set([.donate, .translate, .faq], forSection: .support) model.set([.joinCommunity, .writeReview], forSection: .feedback) model.set([.openAbout], forSection: .about) model.set([.uninstall], forSection: .destruction) @@ -219,10 +219,10 @@ class OrganizerViewController: UITableViewController, StrongTableHost { perform(segue: StoryboardSegue.Organizer.donateSegueIdentifier, sender: nil) } - private func visitPatreon() { - UIApplication.shared.open(AppConstants.URLs.patreon, options: [:], completionHandler: nil) + private func visit(_ url: URL) { + UIApplication.shared.open(url, options: [:], completionHandler: nil) } - + private func offerTranslation() { let V = AppConstants.Translations.Email.self let recipient = V.recipient @@ -386,6 +386,8 @@ extension OrganizerViewController { case translate + case faq + case joinCommunity case writeReview @@ -468,6 +470,11 @@ extension OrganizerViewController { cell.leftText = L10n.Core.Organizer.Cells.Translate.caption return cell + case .faq: + let cell = Cells.setting.dequeue(from: tableView, for: indexPath) + cell.leftText = L10n.Core.About.Cells.Faq.caption + return cell + case .joinCommunity: let cell = Cells.setting.dequeue(from: tableView, for: indexPath) cell.leftText = L10n.Core.Organizer.Cells.JoinCommunity.caption @@ -522,11 +529,14 @@ extension OrganizerViewController { donateToDeveloper() // case .patreon: -// visitPatreon() +// visit(AppConstants.URLs.patreon) case .translate: offerTranslation() + case .faq: + visit(AppConstants.URLs.faq) + case .joinCommunity: subscribeSubreddit()