Add donation cell in organizer
This commit is contained in:
parent
895c19328e
commit
6f57d3503a
|
@ -61,7 +61,7 @@ class OrganizerViewController: UITableViewController, TableModelHost {
|
||||||
model.set([.siriShortcuts], in: .siri)
|
model.set([.siriShortcuts], in: .siri)
|
||||||
}
|
}
|
||||||
model.setHeader(L10n.Organizer.Sections.Support.header, for: .support)
|
model.setHeader(L10n.Organizer.Sections.Support.header, for: .support)
|
||||||
model.set([.patreon], in: .support)
|
model.set([.donate, .patreon], in: .support)
|
||||||
model.set([.openAbout], in: .about)
|
model.set([.openAbout], in: .about)
|
||||||
model.set([.uninstall], in: .destruction)
|
model.set([.uninstall], in: .destruction)
|
||||||
if AppConstants.Flags.isBeta {
|
if AppConstants.Flags.isBeta {
|
||||||
|
@ -191,6 +191,10 @@ class OrganizerViewController: UITableViewController, TableModelHost {
|
||||||
perform(segue: StoryboardSegue.Organizer.siriShortcutsSegueIdentifier)
|
perform(segue: StoryboardSegue.Organizer.siriShortcutsSegueIdentifier)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func donateToDeveloper() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
private func visitPatreon() {
|
private func visitPatreon() {
|
||||||
UIApplication.shared.open(AppConstants.URLs.patreon, options: [:], completionHandler: nil)
|
UIApplication.shared.open(AppConstants.URLs.patreon, options: [:], completionHandler: nil)
|
||||||
}
|
}
|
||||||
|
@ -308,6 +312,8 @@ extension OrganizerViewController {
|
||||||
|
|
||||||
case siriShortcuts
|
case siriShortcuts
|
||||||
|
|
||||||
|
case donate
|
||||||
|
|
||||||
case patreon
|
case patreon
|
||||||
|
|
||||||
case openAbout
|
case openAbout
|
||||||
|
@ -385,6 +391,11 @@ extension OrganizerViewController {
|
||||||
cell.leftText = L10n.Organizer.Cells.SiriShortcuts.caption
|
cell.leftText = L10n.Organizer.Cells.SiriShortcuts.caption
|
||||||
return cell
|
return cell
|
||||||
|
|
||||||
|
case .donate:
|
||||||
|
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
|
||||||
|
cell.leftText = L10n.Organizer.Cells.Donate.caption
|
||||||
|
return cell
|
||||||
|
|
||||||
case .patreon:
|
case .patreon:
|
||||||
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
|
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
|
||||||
cell.leftText = L10n.Organizer.Cells.Patreon.caption
|
cell.leftText = L10n.Organizer.Cells.Patreon.caption
|
||||||
|
@ -428,6 +439,9 @@ extension OrganizerViewController {
|
||||||
case .siriShortcuts:
|
case .siriShortcuts:
|
||||||
addShortcuts()
|
addShortcuts()
|
||||||
|
|
||||||
|
case .donate:
|
||||||
|
donateToDeveloper()
|
||||||
|
|
||||||
case .patreon:
|
case .patreon:
|
||||||
visitPatreon()
|
visitPatreon()
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
"organizer.cells.add_host.caption" = "Add new host";
|
"organizer.cells.add_host.caption" = "Add new host";
|
||||||
"organizer.cells.siri_shortcuts.caption" = "Manage shortcuts";
|
"organizer.cells.siri_shortcuts.caption" = "Manage shortcuts";
|
||||||
"organizer.cells.about.caption" = "About %@";
|
"organizer.cells.about.caption" = "About %@";
|
||||||
|
"organizer.cells.donate.caption" = "Make a donation";
|
||||||
"organizer.cells.patreon.caption" = "Support me on Patreon";
|
"organizer.cells.patreon.caption" = "Support me on Patreon";
|
||||||
"organizer.cells.uninstall.caption" = "Remove VPN configuration";
|
"organizer.cells.uninstall.caption" = "Remove VPN configuration";
|
||||||
"organizer.alerts.exhausted_providers.message" = "You have created profiles for any available provider.";
|
"organizer.alerts.exhausted_providers.message" = "You have created profiles for any available provider.";
|
||||||
|
|
|
@ -408,6 +408,10 @@ public enum L10n {
|
||||||
/// Add new provider
|
/// Add new provider
|
||||||
public static let caption = L10n.tr("Localizable", "organizer.cells.add_provider.caption")
|
public static let caption = L10n.tr("Localizable", "organizer.cells.add_provider.caption")
|
||||||
}
|
}
|
||||||
|
public enum Donate {
|
||||||
|
/// Make a donation
|
||||||
|
public static let caption = L10n.tr("Localizable", "organizer.cells.donate.caption")
|
||||||
|
}
|
||||||
public enum Patreon {
|
public enum Patreon {
|
||||||
/// Support me on Patreon
|
/// Support me on Patreon
|
||||||
public static let caption = L10n.tr("Localizable", "organizer.cells.patreon.caption")
|
public static let caption = L10n.tr("Localizable", "organizer.cells.patreon.caption")
|
||||||
|
|
Loading…
Reference in New Issue