Add ability to press missing token

pull/2/head
Miachel Scoff 7 years ago
parent b02134c5a3
commit ff278663dc
  1. 4
      Trust/Tokens/Coordinators/TokensCoordinator.swift
  2. 9
      Trust/Tokens/ViewControllers/TokensViewController.swift
  3. 2
      Trust/Tokens/ViewModels/TokensViewModel.swift

@ -100,6 +100,10 @@ extension TokensCoordinator: TokensViewControllerDelegate {
storage.delete(tokens: [token])
tokensViewController.fetch()
}
func didPressAddToken(in viewController: UIViewController) {
addToken()
}
}
extension TokensCoordinator: PaymentCoordinatorDelegate {

@ -6,6 +6,7 @@ import StatefulViewController
import Result
protocol TokensViewControllerDelegate: class {
func didPressAddToken( in viewController: UIViewController)
func didSelect(token: TokenObject, in viewController: UIViewController)
func didDelete(token: TokenObject, in viewController: UIViewController)
}
@ -102,8 +103,16 @@ class TokensViewController: UIViewController {
footer.textLabel.textColor = viewModel.footerTextColor
footer.frame.size = header.systemLayoutSizeFitting(UILayoutFittingExpandedSize)
footer.addGestureRecognizer(
UITapGestureRecognizer(target: self, action: #selector(missingToken))
)
tableView.tableFooterView = footer
}
@objc func missingToken() {
delegate?.didPressAddToken(in: self)
}
}
extension TokensViewController: StatefulViewController {

@ -81,7 +81,7 @@ struct TokensViewModel {
}
var footerTitle: String {
return NSLocalizedString("tokens.footer.label.title", value: "If you have missing tokens, feel free to add them to see the balance", comment: "")
return NSLocalizedString("tokens.footer.label.title", value: "Missing token?", comment: "")
}
var footerTextColor: UIColor {

Loading…
Cancel
Save