Merge pull request #342 from James-Sangalli/show-redeem-info-only-on-mainnet-ticket

Show redeem info button in navigation bar only for ticket on mainnet
pull/343/head
James Sangalli 7 years ago committed by GitHub
commit 7e4f4bccf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Trust/Redeem/ViewControllers/RedeemTicketsQuantitySelectionViewController.swift
  2. 8
      Trust/Redeem/ViewControllers/RedeemTicketsViewController.swift
  3. 4
      Trust/Redeem/ViewControllers/TicketRedemptionViewController.swift
  4. 1
      Trust/Redeem/ViewModels/RedeemTicketsQuantitySelectionViewModel.swift
  5. 1
      Trust/Redeem/ViewModels/TicketRedemptionViewModel.swift
  6. 8
      Trust/Sell/ViewControllers/EnterSellTicketsPriceQuantityViewController.swift
  7. 4
      Trust/Sell/ViewControllers/SellTicketsViewController.swift
  8. 4
      Trust/Sell/ViewControllers/SetSellTicketsExpiryDateViewController.swift
  9. 4
      Trust/Sell/ViewModels/EnterSellTicketsPriceQuantityViewControllerViewModel.swift
  10. 4
      Trust/Sell/ViewModels/SetSellTicketsExpiryDateViewControllerViewModel.swift
  11. 4
      Trust/Tokens/ViewControllers/TicketsViewController.swift
  12. 91
      Trust/Transactions/Coordinators/TicketsCoordinator.swift
  13. 12
      Trust/Transfer/ViewControllers/ChooseTicketTransferModeViewController.swift
  14. 4
      Trust/Transfer/ViewControllers/SetTransferTicketsExpiryDateViewController.swift
  15. 8
      Trust/Transfer/ViewControllers/TransferTicketsQuantitySelectionViewController.swift
  16. 4
      Trust/Transfer/ViewControllers/TransferTicketsViaWalletAddressViewController.swift
  17. 8
      Trust/Transfer/ViewControllers/TransferTicketsViewController.swift
  18. 1
      Trust/Transfer/ViewModels/ChooseTicketTransferModeViewControllerViewModel.swift
  19. 1
      Trust/Transfer/ViewModels/SetTransferTicketsExpiryDateViewControllerViewModel.swift
  20. 1
      Trust/Transfer/ViewModels/TransferTicketsQuantitySelectionViewModel.swift
  21. 1
      Trust/Transfer/ViewModels/TransferTicketsViaWalletAddressViewControllerViewModel.swift

@ -9,7 +9,7 @@
import UIKit
protocol RedeemTicketsQuantitySelectionViewControllerDelegate: class {
func didSelectQuantity(ticketHolder: TicketHolder, in viewController: RedeemTicketsQuantitySelectionViewController)
func didSelectQuantity(token: TokenObject, ticketHolder: TicketHolder, in viewController: RedeemTicketsQuantitySelectionViewController)
func didPressViewInfo(in viewController: RedeemTicketsQuantitySelectionViewController)
}
@ -105,7 +105,7 @@ class RedeemTicketsQuantitySelectionViewController: UIViewController {
viewController: self,
completion: nil)
} else {
delegate?.didSelectQuantity(ticketHolder: getTicketHolderFromQuantity(), in: self)
delegate?.didSelectQuantity(token: viewModel.token, ticketHolder: getTicketHolderFromQuantity(), in: self)
}
}
@ -116,6 +116,10 @@ class RedeemTicketsQuantitySelectionViewController: UIViewController {
func configure(viewModel: RedeemTicketsQuantitySelectionViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -9,7 +9,7 @@
import UIKit
protocol RedeemTicketsViewControllerDelegate: class {
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: RedeemTicketsViewController)
func didSelectTicketHolder(token: TokenObject, ticketHolder: TicketHolder, in viewController: RedeemTicketsViewController)
func didPressViewInfo(in viewController: RedeemTicketsViewController)
}
@ -80,6 +80,10 @@ class RedeemTicketsViewController: UIViewController {
self.viewModel = viewModel
tableView.dataSource = self
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
header.configure(title: viewModel.title)
tableView.tableHeaderView = header
@ -99,7 +103,7 @@ class RedeemTicketsViewController: UIViewController {
viewController: self,
completion: nil)
} else {
self.delegate?.didSelectTicketHolder(ticketHolder: selectedTicketHolders!.first!, in: self)
self.delegate?.didSelectTicketHolder(token: viewModel.token, ticketHolder: selectedTicketHolders!.first!, in: self)
}
}

@ -135,6 +135,10 @@ class TicketRedemptionViewController: UIViewController {
func configure(viewModel: TicketRedemptionViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
titleLabel.textAlignment = .center

@ -11,6 +11,7 @@ import UIKit
struct RedeemTicketsQuantitySelectionViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var headerTitle: String {

@ -10,6 +10,7 @@ import Foundation
import UIKit
struct TicketRedemptionViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var headerTitle: String {

@ -3,7 +3,7 @@
import UIKit
protocol EnterSellTicketsPriceQuantityViewControllerDelegate: class {
func didEnterSellTicketsPriceQuantity(ticketHolder: TicketHolder, ethCost: String, in viewController: EnterSellTicketsPriceQuantityViewController)
func didEnterSellTicketsPriceQuantity(token: TokenObject, ticketHolder: TicketHolder, ethCost: String, in viewController: EnterSellTicketsPriceQuantityViewController)
func didPressViewInfo(in viewController: EnterSellTicketsPriceQuantityViewController)
}
@ -225,7 +225,7 @@ class EnterSellTicketsPriceQuantityViewController: UIViewController {
return
}
delegate?.didEnterSellTicketsPriceQuantity(ticketHolder: getTicketHolderFromQuantity(), ethCost: String(totalEthCost), in: self)
delegate?.didEnterSellTicketsPriceQuantity(token: viewModel.token, ticketHolder: getTicketHolderFromQuantity(), ethCost: String(totalEthCost), in: self)
}
@objc func quantityChanged() {
@ -245,6 +245,10 @@ class EnterSellTicketsPriceQuantityViewController: UIViewController {
func configure(viewModel: EnterSellTicketsPriceQuantityViewControllerViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -76,6 +76,10 @@ class SellTicketsViewController: UIViewController {
self.viewModel = viewModel
tableView.dataSource = self
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
header.configure(title: viewModel.title)
tableView.tableHeaderView = header

@ -228,6 +228,10 @@ class SetSellTicketsExpiryDateViewController: UIViewController {
func configure(viewModel: SetSellTicketsExpiryDateViewControllerViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -5,6 +5,7 @@ import UIKit
struct EnterSellTicketsPriceQuantityViewControllerViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var ethCost: String = "0"
var dollarCost: String = ""
@ -149,7 +150,8 @@ struct EnterSellTicketsPriceQuantityViewControllerViewModel {
return dollarCost.trimmed.isEmpty
}
init(ticketHolder: TicketHolder) {
init(token: TokenObject, ticketHolder: TicketHolder) {
self.token = token
self.ticketHolder = ticketHolder
}
}

@ -5,6 +5,7 @@ import UIKit
struct SetSellTicketsExpiryDateViewControllerViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var ethCost: String = "0"
@ -149,7 +150,8 @@ struct SetSellTicketsExpiryDateViewControllerViewModel {
return ticketHolder.count
}
init(ticketHolder: TicketHolder, ethCost: String) {
init(token: TokenObject, ticketHolder: TicketHolder, ethCost: String) {
self.token = token
self.ticketHolder = ticketHolder
self.ethCost = ethCost
}

@ -121,6 +121,10 @@ class TicketsViewController: UIViewController {
self.viewModel = viewModel
tableView.dataSource = self
if let tokenObject = tokenObject, tokenObject.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
if let tokenObject = tokenObject {
header.configure(viewModel: .init(config: tokensStorage.config, tokenObject: tokenObject))
tableView.tableHeaderView = header

@ -93,9 +93,10 @@ class TicketsCoordinator: NSObject, Coordinator {
navigationController.pushViewController(transferViewController, animated: true)
}
private func showChooseTicketTransferModeViewController(for ticketHolder: TicketHolder,
private func showChooseTicketTransferModeViewController(token: TokenObject,
for ticketHolder: TicketHolder,
in viewController: TransferTicketsQuantitySelectionViewController) {
let vc = makeChooseTicketTransferModeViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow)
let vc = makeChooseTicketTransferModeViewController(token: token, for: ticketHolder, paymentFlow: viewController.paymentFlow)
viewController.navigationController?.pushViewController(vc, animated: true)
}
@ -146,28 +147,31 @@ class TicketsCoordinator: NSObject, Coordinator {
return vc
}
private func showEnterSellTicketsExpiryDateViewController(for ticketHolder: TicketHolder,
ethCost: String,
in viewController: EnterSellTicketsPriceQuantityViewController) {
let vc = makeEnterSellTicketsExpiryDateViewController(for: ticketHolder, ethCost: ethCost, paymentFlow: viewController.paymentFlow)
private func showEnterSellTicketsExpiryDateViewController(token: TokenObject,
for ticketHolder: TicketHolder,
ethCost: String,
in viewController: EnterSellTicketsPriceQuantityViewController) {
let vc = makeEnterSellTicketsExpiryDateViewController(token: token, for: ticketHolder, ethCost: ethCost, paymentFlow: viewController.paymentFlow)
viewController.navigationController?.pushViewController(vc, animated: true)
}
private func showEnterQuantityViewController(for ticketHolder: TicketHolder,
private func showEnterQuantityViewController(token: TokenObject,
for ticketHolder: TicketHolder,
in viewController: RedeemTicketsViewController) {
let quantityViewController = makeRedeemTicketsQuantitySelectionViewController(for: ticketHolder)
let quantityViewController = makeRedeemTicketsQuantitySelectionViewController(token: token, for: ticketHolder)
viewController.navigationController?.pushViewController(quantityViewController, animated: true)
}
private func showEnterPriceQuantityViewController(for ticketHolder: TicketHolder,
in viewController: SellTicketsViewController) {
let vc = makeEnterSellTicketsPriceQuantityViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow)
let vc = makeEnterSellTicketsPriceQuantityViewController(token: token, for: ticketHolder, paymentFlow: viewController.paymentFlow)
viewController.navigationController?.pushViewController(vc, animated: true)
}
private func showTicketRedemptionViewController(for ticketHolder: TicketHolder,
private func showTicketRedemptionViewController(token: TokenObject,
for ticketHolder: TicketHolder,
in viewController: UIViewController) {
let quantityViewController = makeTicketRedemptionViewController(for: ticketHolder)
let quantityViewController = makeTicketRedemptionViewController(token: token, for: ticketHolder)
viewController.navigationController?.pushViewController(quantityViewController, animated: true)
}
@ -187,49 +191,49 @@ class TicketsCoordinator: NSObject, Coordinator {
return controller
}
private func makeRedeemTicketsQuantitySelectionViewController(for ticketHolder: TicketHolder) -> RedeemTicketsQuantitySelectionViewController {
private func makeRedeemTicketsQuantitySelectionViewController(token: TokenObject, for ticketHolder: TicketHolder) -> RedeemTicketsQuantitySelectionViewController {
let controller = RedeemTicketsQuantitySelectionViewController()
let viewModel = RedeemTicketsQuantitySelectionViewModel(ticketHolder: ticketHolder)
let viewModel = RedeemTicketsQuantitySelectionViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
}
private func makeEnterSellTicketsPriceQuantityViewController(for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> EnterSellTicketsPriceQuantityViewController {
private func makeEnterSellTicketsPriceQuantityViewController(token: TokenObject, for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> EnterSellTicketsPriceQuantityViewController {
let controller = EnterSellTicketsPriceQuantityViewController(storage: tokensStorage, paymentFlow: paymentFlow, ethPrice: ethPrice)
let viewModel = EnterSellTicketsPriceQuantityViewControllerViewModel(ticketHolder: ticketHolder)
let viewModel = EnterSellTicketsPriceQuantityViewControllerViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
}
private func makeEnterTransferTicketsExpiryDateViewController(for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> SetTransferTicketsExpiryDateViewController {
private func makeEnterTransferTicketsExpiryDateViewController(token: TokenObject, for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> SetTransferTicketsExpiryDateViewController {
let controller = SetTransferTicketsExpiryDateViewController(ticketHolder: ticketHolder, paymentFlow: paymentFlow)
let viewModel = SetTransferTicketsExpiryDateViewControllerViewModel(ticketHolder: ticketHolder)
let viewModel = SetTransferTicketsExpiryDateViewControllerViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
}
private func makeTransferTicketsViaWalletAddressViewController(for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> TransferTicketsViaWalletAddressViewController {
private func makeTransferTicketsViaWalletAddressViewController(token: TokenObject, for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> TransferTicketsViaWalletAddressViewController {
let controller = TransferTicketsViaWalletAddressViewController(ticketHolder: ticketHolder, paymentFlow: paymentFlow)
let viewModel = TransferTicketsViaWalletAddressViewControllerViewModel(ticketHolder: ticketHolder)
let viewModel = TransferTicketsViaWalletAddressViewControllerViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
}
private func makeEnterSellTicketsExpiryDateViewController(for ticketHolder: TicketHolder, ethCost: String, paymentFlow: PaymentFlow) -> SetSellTicketsExpiryDateViewController {
private func makeEnterSellTicketsExpiryDateViewController(token: TokenObject, for ticketHolder: TicketHolder, ethCost: String, paymentFlow: PaymentFlow) -> SetSellTicketsExpiryDateViewController {
let controller = SetSellTicketsExpiryDateViewController(storage: tokensStorage, paymentFlow: paymentFlow, ticketHolder: ticketHolder, ethCost: ethCost)
let viewModel = SetSellTicketsExpiryDateViewControllerViewModel(ticketHolder: ticketHolder, ethCost: ethCost)
let viewModel = SetSellTicketsExpiryDateViewControllerViewModel(token: token, ticketHolder: ticketHolder, ethCost: ethCost)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
}
private func makeTicketRedemptionViewController(for ticketHolder: TicketHolder) -> TicketRedemptionViewController {
private func makeTicketRedemptionViewController(token: TokenObject, for ticketHolder: TicketHolder) -> TicketRedemptionViewController {
let controller = TicketRedemptionViewController(session: session)
let viewModel = TicketRedemptionViewModel(ticketHolder: ticketHolder)
let viewModel = TicketRedemptionViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
return controller
}
@ -242,23 +246,24 @@ class TicketsCoordinator: NSObject, Coordinator {
return controller
}
private func showEnterQuantityViewController(for ticketHolder: TicketHolder,
private func showEnterQuantityViewController(token: TokenObject,
for ticketHolder: TicketHolder,
in viewController: TransferTicketsViewController) {
let quantityViewController = makeTransferTicketsQuantitySelectionViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow)
let quantityViewController = makeTransferTicketsQuantitySelectionViewController(token: token, for: ticketHolder, paymentFlow: viewController.paymentFlow)
viewController.navigationController?.pushViewController(quantityViewController, animated: true)
}
private func makeTransferTicketsQuantitySelectionViewController(for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> TransferTicketsQuantitySelectionViewController {
private func makeTransferTicketsQuantitySelectionViewController(token: TokenObject, for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> TransferTicketsQuantitySelectionViewController {
let controller = TransferTicketsQuantitySelectionViewController(paymentFlow: paymentFlow)
let viewModel = TransferTicketsQuantitySelectionViewModel(ticketHolder: ticketHolder)
let viewModel = TransferTicketsQuantitySelectionViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
}
private func makeChooseTicketTransferModeViewController(for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> ChooseTicketTransferModeViewController {
private func makeChooseTicketTransferModeViewController(token: TokenObject, for ticketHolder: TicketHolder, paymentFlow: PaymentFlow) -> ChooseTicketTransferModeViewController {
let controller = ChooseTicketTransferModeViewController(ticketHolder: ticketHolder, paymentFlow: paymentFlow)
let viewModel = ChooseTicketTransferModeViewControllerViewModel(ticketHolder: ticketHolder)
let viewModel = ChooseTicketTransferModeViewControllerViewModel(token: token, ticketHolder: ticketHolder)
controller.configure(viewModel: viewModel)
controller.delegate = self
return controller
@ -365,8 +370,8 @@ extension TicketsCoordinator: TicketsViewControllerDelegate {
}
extension TicketsCoordinator: RedeemTicketsViewControllerDelegate {
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: RedeemTicketsViewController) {
showEnterQuantityViewController(for: ticketHolder, in: viewController)
func didSelectTicketHolder(token: TokenObject, ticketHolder: TicketHolder, in viewController: RedeemTicketsViewController) {
showEnterQuantityViewController(token: token, for: ticketHolder, in: viewController)
}
func didPressViewInfo(in viewController: RedeemTicketsViewController) {
@ -375,8 +380,8 @@ extension TicketsCoordinator: RedeemTicketsViewControllerDelegate {
}
extension TicketsCoordinator: RedeemTicketsQuantitySelectionViewControllerDelegate {
func didSelectQuantity(ticketHolder: TicketHolder, in viewController: RedeemTicketsQuantitySelectionViewController) {
showTicketRedemptionViewController(for: ticketHolder, in: viewController)
func didSelectQuantity(token: TokenObject, ticketHolder: TicketHolder, in viewController: RedeemTicketsQuantitySelectionViewController) {
showTicketRedemptionViewController(token: token, for: ticketHolder, in: viewController)
}
func didPressViewInfo(in viewController: RedeemTicketsQuantitySelectionViewController) {
@ -395,8 +400,8 @@ extension TicketsCoordinator: SellTicketsViewControllerDelegate {
}
extension TicketsCoordinator: TransferTicketsQuantitySelectionViewControllerDelegate {
func didSelectQuantity(ticketHolder: TicketHolder, in viewController: TransferTicketsQuantitySelectionViewController) {
showChooseTicketTransferModeViewController(for: ticketHolder, in: viewController)
func didSelectQuantity(token: TokenObject, ticketHolder: TicketHolder, in viewController: TransferTicketsQuantitySelectionViewController) {
showChooseTicketTransferModeViewController(token: token, for: ticketHolder, in: viewController)
}
func didPressViewInfo(in viewController: TransferTicketsQuantitySelectionViewController) {
@ -405,8 +410,8 @@ extension TicketsCoordinator: TransferTicketsQuantitySelectionViewControllerDele
}
extension TicketsCoordinator: EnterSellTicketsPriceQuantityViewControllerDelegate {
func didEnterSellTicketsPriceQuantity(ticketHolder: TicketHolder, ethCost: String, in viewController: EnterSellTicketsPriceQuantityViewController) {
showEnterSellTicketsExpiryDateViewController(for: ticketHolder, ethCost: ethCost, in: viewController)
func didEnterSellTicketsPriceQuantity(token: TokenObject, ticketHolder: TicketHolder, ethCost: String, in viewController: EnterSellTicketsPriceQuantityViewController) {
showEnterSellTicketsExpiryDateViewController(token: token, for: ticketHolder, ethCost: ethCost, in: viewController)
}
func didPressViewInfo(in viewController: EnterSellTicketsPriceQuantityViewController) {
@ -425,8 +430,8 @@ extension TicketsCoordinator: SetSellTicketsExpiryDateViewControllerDelegate {
}
extension TicketsCoordinator: TransferTicketsViewControllerDelegate {
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: TransferTicketsViewController) {
showEnterQuantityViewController(for: ticketHolder, in: viewController)
func didSelectTicketHolder(token: TokenObject, ticketHolder: TicketHolder, in viewController: TransferTicketsViewController) {
showEnterQuantityViewController(token: token, for: ticketHolder, in: viewController)
}
func didPressViewInfo(in viewController: TransferTicketsViewController) {
@ -464,13 +469,13 @@ extension TicketsCoordinator: GenerateSellMagicLinkViewControllerDelegate {
}
extension TicketsCoordinator: ChooseTicketTransferModeViewControllerDelegate {
func didChooseTransferViaMagicLink(ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController) {
let vc = makeEnterTransferTicketsExpiryDateViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow)
func didChooseTransferViaMagicLink(token: TokenObject, ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController) {
let vc = makeEnterTransferTicketsExpiryDateViewController(token: token, for: ticketHolder, paymentFlow: viewController.paymentFlow)
viewController.navigationController?.pushViewController(vc, animated: true)
}
func didChooseTransferNow(ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController) {
let vc = makeTransferTicketsViaWalletAddressViewController(for: ticketHolder, paymentFlow: viewController.paymentFlow)
func didChooseTransferNow(token: TokenObject, ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController) {
let vc = makeTransferTicketsViaWalletAddressViewController(token: token, for: ticketHolder, paymentFlow: viewController.paymentFlow)
viewController.navigationController?.pushViewController(vc, animated: true)
}

@ -3,8 +3,8 @@
import UIKit
protocol ChooseTicketTransferModeViewControllerDelegate: class {
func didChooseTransferViaMagicLink(ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController)
func didChooseTransferNow(ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController)
func didChooseTransferViaMagicLink(token: TokenObject, ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController)
func didChooseTransferNow(token: TokenObject, ticketHolder: TicketHolder, in viewController: ChooseTicketTransferModeViewController)
func didPressViewInfo(in viewController: ChooseTicketTransferModeViewController)
}
@ -96,11 +96,11 @@ class ChooseTicketTransferModeViewController: UIViewController {
}
@objc func generateMagicLinkTapped() {
delegate?.didChooseTransferViaMagicLink(ticketHolder: ticketHolder, in: self)
delegate?.didChooseTransferViaMagicLink(token: viewModel.token, ticketHolder: ticketHolder, in: self)
}
@objc func transferNowTapped() {
delegate?.didChooseTransferNow(ticketHolder: ticketHolder, in: self)
delegate?.didChooseTransferNow(token: viewModel.token, ticketHolder: ticketHolder, in: self)
}
@objc func showInfo() {
@ -110,6 +110,10 @@ class ChooseTicketTransferModeViewController: UIViewController {
func configure(viewModel: ChooseTicketTransferModeViewControllerViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -225,6 +225,10 @@ class SetTransferTicketsExpiryDateViewController: UIViewController {
func configure(viewModel: SetTransferTicketsExpiryDateViewControllerViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -3,7 +3,7 @@
import UIKit
protocol TransferTicketsQuantitySelectionViewControllerDelegate: class {
func didSelectQuantity(ticketHolder: TicketHolder, in viewController: TransferTicketsQuantitySelectionViewController)
func didSelectQuantity(token: TokenObject, ticketHolder: TicketHolder, in viewController: TransferTicketsQuantitySelectionViewController)
func didPressViewInfo(in viewController: TransferTicketsQuantitySelectionViewController)
}
@ -101,7 +101,7 @@ class TransferTicketsQuantitySelectionViewController: UIViewController {
viewController: self,
completion: nil)
} else {
delegate?.didSelectQuantity(ticketHolder: getTicketHolderFromQuantity(), in: self)
delegate?.didSelectQuantity(token: viewModel.token, ticketHolder: getTicketHolderFromQuantity(), in: self)
}
}
@ -112,6 +112,10 @@ class TransferTicketsQuantitySelectionViewController: UIViewController {
func configure(viewModel: TransferTicketsQuantitySelectionViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -105,6 +105,10 @@ class TransferTicketsViaWalletAddressViewController: UIViewController {
func configure(viewModel: TransferTicketsViaWalletAddressViewControllerViewModel) {
self.viewModel = viewModel
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
view.backgroundColor = viewModel.backgroundColor
header.configure(title: viewModel.headerTitle)

@ -3,7 +3,7 @@
import UIKit
protocol TransferTicketsViewControllerDelegate: class {
func didSelectTicketHolder(ticketHolder: TicketHolder, in viewController: TransferTicketsViewController)
func didSelectTicketHolder(token: TokenObject, ticketHolder: TicketHolder, in viewController: TransferTicketsViewController)
func didPressViewInfo(in viewController: TransferTicketsViewController)
}
@ -76,6 +76,10 @@ class TransferTicketsViewController: UIViewController {
self.viewModel = viewModel
tableView.dataSource = self
if viewModel.token.contract != Constants.ticketContractAddress {
navigationItem.rightBarButtonItem = nil
}
header.configure(title: viewModel.title)
tableView.tableHeaderView = header
@ -95,7 +99,7 @@ class TransferTicketsViewController: UIViewController {
viewController: self,
completion: nil)
} else {
self.delegate?.didSelectTicketHolder(ticketHolder: selectedTicketHolders!.first!, in: self)
self.delegate?.didSelectTicketHolder(token: viewModel.token, ticketHolder: selectedTicketHolders!.first!, in: self)
}
}

@ -5,6 +5,7 @@ import UIKit
struct ChooseTicketTransferModeViewControllerViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var headerTitle: String {

@ -5,6 +5,7 @@ import UIKit
struct SetTransferTicketsExpiryDateViewControllerViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var headerTitle: String {

@ -5,6 +5,7 @@ import UIKit
struct TransferTicketsQuantitySelectionViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var headerTitle: String {

@ -5,6 +5,7 @@ import UIKit
struct TransferTicketsViaWalletAddressViewControllerViewModel {
var token: TokenObject
var ticketHolder: TicketHolder
var headerTitle: String {

Loading…
Cancel
Save