Merge branch 'master' into buyFromQueue

pull/86/head
James Sangalli 7 years ago committed by GitHub
commit 27fd5d9210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      Trust.xcodeproj/project.pbxproj
  2. 7
      Trust/AlphaWalletHelp/ViewControllers/HelpContentsViewController.swift
  3. 7
      Trust/AlphaWalletHelp/ViewControllers/HelpViewController.swift
  4. 39
      Trust/AlphaWalletHelp/Views/ContactUsBannerView.swift
  5. 9
      Trust/Localization/en.lproj/Localizable.strings
  6. 2
      Trust/Settings/ViewModels/AdvancedSettingsViewModel.swift
  7. 2
      Trust/Tokens/ViewModels/TicketTokenViewCellViewModel.swift
  8. 2
      Trust/Tokens/ViewModels/TicketsViewControllerHeaderViewModel.swift
  9. 2
      Trust/Transactions/Views/TransactionsFooterView.swift
  10. 2
      Trust/Welcome/ViewModels/WelcomeViewModel.swift

@ -1067,7 +1067,6 @@
76F1D1936604D6A022E9AE90 /* Market */,
76F1D47A29573DA8BD3E4979 /* Redeem */,
5E7C7ACB32FB112CD7D92977 /* AlphaWalletHelp */,
5E7C788AF1C199AC61863B85 /* AlphaWalletProtection */,
);
path = Trust;
sourceTree = "<group>";
@ -2206,14 +2205,6 @@
path = Views;
sourceTree = "<group>";
};
5E7C788AF1C199AC61863B85 /* AlphaWalletProtection */ = {
isa = PBXGroup;
children = (
5E7C7BC8799AC9C84FB6269F /* Coordinators */,
);
path = AlphaWalletProtection;
sourceTree = "<group>";
};
5E7C7ACB32FB112CD7D92977 /* AlphaWalletHelp */ = {
isa = PBXGroup;
children = (
@ -2223,13 +2214,6 @@
path = AlphaWalletHelp;
sourceTree = "<group>";
};
5E7C7BC8799AC9C84FB6269F /* Coordinators */ = {
isa = PBXGroup;
children = (
);
path = Coordinators;
sourceTree = "<group>";
};
615F10571FCBEF6A008A45AF /* Views */ = {
isa = PBXGroup;
children = (

@ -8,6 +8,7 @@ class HelpContentsViewController: StaticHTMLViewController {
override init() {
super.init()
banner.delegate = self
banner.translatesAutoresizingMaskIntoConstraints = false
footer.addSubview(banner)
@ -34,3 +35,9 @@ class HelpContentsViewController: StaticHTMLViewController {
}
}
extension HelpContentsViewController: ContactUsBannerViewDelegate {
func present(_ viewController: UIViewController, for view: ContactUsBannerView) {
present(viewController, animated: true, completion: nil)
}
}

@ -30,6 +30,7 @@ class HelpViewController: UIViewController {
tableView.backgroundColor = Colors.appBackground
view.addSubview(tableView)
banner.delegate = self
banner.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(banner)
@ -81,3 +82,9 @@ extension HelpViewController: UITableViewDataSource {
return rows.count
}
}
extension HelpViewController: ContactUsBannerViewDelegate {
func present(_ viewController: UIViewController, for view: ContactUsBannerView) {
present(viewController, animated: true, completion: nil)
}
}

@ -1,8 +1,14 @@
// Copyright © 2018 Stormbird PTE. LTD.
import UIKit
import MessageUI
protocol ContactUsBannerViewDelegate: class {
func present(_ viewController: UIViewController, for view: ContactUsBannerView)
}
class ContactUsBannerView: UIView {
weak var delegate: ContactUsBannerViewDelegate?
let button = UIButton(type: .system)
let imageView = UIImageView()
let label = UILabel()
@ -51,7 +57,36 @@ class ContactUsBannerView: UIView {
}
@objc func tapped() {
//TODO show help contact options by firing a delegate method
print("Tapped contact us")
sendUsEmail()
}
func sendUsEmail() {
let composerController = MFMailComposeViewController()
composerController.mailComposeDelegate = self
composerController.setToRecipients([Constants.supportEmail])
composerController.setSubject(R.string.localizable.aHelpContactEmailSubject())
composerController.setMessageBody(emailTemplate(), isHTML: false)
if MFMailComposeViewController.canSendMail() {
delegate?.present(composerController, for: self)
}
}
private func emailTemplate() -> String {
return """
\n\n\n
\(R.string.localizable.aHelpContactEmailHelpfulToDevelopers())
\(R.string.localizable.aHelpContactEmailIosVersion(UIDevice.current.systemVersion))
\(R.string.localizable.aHelpContactEmailDeviceModel(UIDevice.current.model))
\(R.string.localizable.aHelpContactEmailAppVersion(Bundle.main.fullVersion))
\(R.string.localizable.aHelpContactEmailLocale(Locale.preferredLanguages.first ?? ""))
"""
}
}
extension ContactUsBannerView: MFMailComposeViewControllerDelegate {
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
controller.dismiss(animated: true, completion: nil)
}
}

@ -188,9 +188,15 @@
"a.wallet.contents.filter.currencyOnly.title" = "CURRENCY";
"a.wallet.contents.filter.assetsOnly.title" = "ASSETS";
"a.wallet.contents.issuer.title" = "Issuer";
"a.wallet.tickets" = "Tickets";
"a.wallet.tickets" = "%@ Tickets";
"a.help.navigation.title" = "Help & FAQs";
"a.help.contact.footer.button.title" = "Still need help? Contact Us";
"a.help.contact.email.subject" = "Help/Feedback for AlphaWallet";
"a.help.contact.email.helpfulToDevelopers" = "Helpful information to developers:";
"a.help.contact.email.iosVersion" = "iOS Version: %@";
"a.help.contact.email.deviceModel" = "Device Model: %@";
"a.help.contact.email.appVersion" = "App Version: %@";
"a.help.contact.email.locale" = "Current locale: %@";
"a.help.contents.whatIsETH" = "What is ETH/Ethereum?";
"a.help.contents.whyETH" = "Why does aWallet use Ethereum?";
"a.help.contents.howDoIGetMyMoney" = "How do I get my money?";
@ -204,6 +210,7 @@
"a.settings.contents.myWalletAddress" = "My Wallet Address";
"a.settings.contents.notificationsSettings" = "Notifications Settings";
"a.settings.contents.logout" = "Log Out";
"a.welcome.navigation.title" = "Welcome";
"a.welcome.onboarding.1" = "Hold all your Crypto assets in one place";
"a.welcome.onboarding.2" = "Powered by blockchain technology, smart tickets, fraud free";
"a.welcome.onboarding.3" = "Buy, sell and transfer your favourite tokens";

@ -5,7 +5,7 @@ import Foundation
struct AdvancedSettingsViewModel {
var title: String {
return NSLocalizedString("settings.preferences.title", value: "Preferences", comment: "")
return R.string.localizable.aSettingsAdvancedLabelTitle()
}
var showTokensTabTitle: String {

@ -23,7 +23,7 @@ struct TicketTokenViewCellViewModel {
var amount: String {
let actualBalance = self.token.balance.filter { $0.balance != 0 }
return actualBalance.count.toString() + " Tickets"
return R.string.localizable.aWalletTickets(actualBalance.count.toString())
}
var issuer: String {

@ -10,7 +10,7 @@ struct TicketsViewControllerHeaderViewModel {
}
var title: String {
return "\(totalValidTicketNumber) \(R.string.localizable.aWalletTickets()) \(tokenObject.title)"
return "\(R.string.localizable.aWalletTickets(totalValidTicketNumber)) \(tokenObject.title)"
}
var issuer: String {

@ -20,7 +20,7 @@ class TransactionsFooterView: UIView {
requestButton.translatesAutoresizingMaskIntoConstraints = false
requestButton.layer.cornerRadius = 6
requestButton.titleLabel?.font = Fonts.semibold(size: Fonts.buttonSize)
requestButton.setTitle(NSLocalizedString("transactions.receive.button.title", value: "Receive", comment: ""), for: .normal)
requestButton.setTitle(R.string.localizable.transactionsReceiveButtonTitle(), for: .normal)
return requestButton
}()

@ -7,7 +7,7 @@ import UIKit
struct WelcomeViewModel {
var title: String {
return "Welcome"
return R.string.localizable.aWelcomeNavigationTitle()
}
var backgroundColor: UIColor {

Loading…
Cancel
Save