Move AlternativeTo/ProductHunt to About

Under "Share" section.
This commit is contained in:
Davide De Rosa 2019-12-02 10:56:03 +01:00
parent d44c8efefe
commit 78b8ed01a1
2 changed files with 17 additions and 23 deletions

View File

@ -44,7 +44,7 @@ class AboutViewController: UITableViewController, StrongTableHost {
model.set([.version, .credits], forSection: .info) model.set([.version, .credits], forSection: .info)
model.set([.readme, .changelog], forSection: .github) model.set([.readme, .changelog], forSection: .github)
model.set([.website, .faq, .disclaimer, .privacyPolicy], forSection: .web) model.set([.website, .faq, .disclaimer, .privacyPolicy], forSection: .web)
model.set([.shareTwitter, .shareGeneric], forSection: .share) model.set([.shareTwitter, .shareGeneric, .visitAlternativeTo, .visitProductHunt], forSection: .share)
return model return model
}() }()
@ -127,6 +127,10 @@ extension AboutViewController {
case shareTwitter case shareTwitter
case shareGeneric case shareGeneric
case visitAlternativeTo
case visitProductHunt
} }
override func numberOfSections(in tableView: UITableView) -> Int { override func numberOfSections(in tableView: UITableView) -> Int {
@ -186,6 +190,12 @@ extension AboutViewController {
case .shareGeneric: case .shareGeneric:
cell.leftText = L10n.Core.About.Cells.ShareGeneric.caption cell.leftText = L10n.Core.About.Cells.ShareGeneric.caption
case .visitAlternativeTo:
cell.leftText = "AlternativeTo"
case .visitProductHunt:
cell.leftText = "ProductHunt"
} }
return cell return cell
} }
@ -221,6 +231,12 @@ extension AboutViewController {
case .shareGeneric: case .shareGeneric:
inviteFriend(sender: tableView.cellForRow(at: indexPath)) inviteFriend(sender: tableView.cellForRow(at: indexPath))
case .visitAlternativeTo:
visitURL(AppConstants.URLs.alternativeTo)
case .visitProductHunt:
visitURL(AppConstants.URLs.productHunt)
} }
tableView.deselectRow(at: indexPath, animated: true) tableView.deselectRow(at: indexPath, animated: true)
} }

View File

@ -76,8 +76,6 @@ class OrganizerViewController: UITableViewController, StrongTableHost {
if ProductManager.shared.isEligibleForFeedback() { if ProductManager.shared.isEligibleForFeedback() {
feedbackRows.append(.writeReview) feedbackRows.append(.writeReview)
} }
feedbackRows.append(.visitAlternativeTo)
feedbackRows.append(.visitProductHunt)
model.set(feedbackRows, forSection: .feedback) model.set(feedbackRows, forSection: .feedback)
model.set([.openAbout], forSection: .about) model.set([.openAbout], forSection: .about)
@ -431,10 +429,6 @@ extension OrganizerViewController {
case writeReview case writeReview
case visitAlternativeTo
case visitProductHunt
case openAbout case openAbout
case uninstall case uninstall
@ -527,16 +521,6 @@ extension OrganizerViewController {
cell.leftText = L10n.Core.Organizer.Cells.WriteReview.caption cell.leftText = L10n.Core.Organizer.Cells.WriteReview.caption
return cell return cell
case .visitAlternativeTo:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = "AlternativeTo"
return cell
case .visitProductHunt:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = "ProductHunt"
return cell
case .openAbout: case .openAbout:
let cell = Cells.setting.dequeue(from: tableView, for: indexPath) let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
cell.leftText = L10n.Core.Organizer.Cells.About.caption(GroupConstants.App.name) cell.leftText = L10n.Core.Organizer.Cells.About.caption(GroupConstants.App.name)
@ -597,12 +581,6 @@ extension OrganizerViewController {
case .writeReview: case .writeReview:
writeReview() writeReview()
case .visitAlternativeTo:
visitURL(AppConstants.URLs.alternativeTo)
case .visitProductHunt:
visitURL(AppConstants.URLs.productHunt)
case .openAbout: case .openAbout:
about() about()