Merge branch 'master' into supportURLChange

pull/297/head
James Sangalli 7 years ago committed by GitHub
commit e95f404ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Trust/Localization/en.lproj/Localizable.strings
  2. 2
      Trust/Localization/es.lproj/Localizable.strings
  3. 2
      Trust/Tokens/ViewControllers/TicketsViewController.swift
  4. 4
      Trust/Tokens/ViewControllers/TokensViewController.swift
  5. 17
      Trust/Tokens/ViewModels/TicketTokenViewCellViewModel.swift
  6. 18
      Trust/Tokens/ViewModels/TicketsViewControllerHeaderViewModel.swift
  7. 2
      Trust/Tokens/Views/TicketTokenViewCell.swift
  8. 7
      Trust/Tokens/Views/TicketsViewControllerHeader.swift

@ -268,7 +268,7 @@
"Balance" = "Balance";
"confirmSignMessage" = "Confirm signing this message:";
"blockchain.ethereum" = "Ethereum Blockchain";
"ticket.issuer" = "Shengkai";
"ticket.issuer" = "Shankai";
"touch.id" = "Touch ID";
"face.id" = "Face ID";
"undefined.error" = "Undefined error";

@ -268,7 +268,7 @@
"Balance" = "Balance";
"confirmSignMessage" = "Confirm signing this message:";
"blockchain.ethereum" = "Ethereum Blockchain";
"ticket.issuer" = "Shengkai";
"ticket.issuer" = "Shankai";
"touch.id" = "Touch ID";
"face.id" = "Face ID";
"undefined.error" = "Undefined error";

@ -122,7 +122,7 @@ class TicketsViewController: UIViewController {
tableView.dataSource = self
if let tokenObject = tokenObject {
header.configure(viewModel: .init(tokenObject: tokenObject))
header.configure(viewModel: .init(config: tokensStorage.config, tokenObject: tokenObject))
tableView.tableHeaderView = header
}

@ -247,12 +247,14 @@ extension TokensViewController: UITableViewDelegate {
return cellViewModel.cellHeight
case .stormBird:
let cellViewModel = TicketTokenViewCellViewModel(
config: dataStore.config,
token: token,
ticker: viewModel.ticker(for: token)
)
return cellViewModel.cellHeight
case .stormBirdOrder:
let cellViewModel = TicketTokenViewCellViewModel(
config: dataStore.config,
token: token,
ticker: viewModel.ticker(for: token)
)
@ -319,6 +321,7 @@ extension TokensViewController: UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: TicketTokenViewCell.identifier, for: indexPath) as! TicketTokenViewCell
cell.configure(
viewModel: .init(
config: dataStore.config,
token: token,
ticker: viewModel.ticker(for: token)
)
@ -329,6 +332,7 @@ extension TokensViewController: UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: TicketTokenViewCell.identifier, for: indexPath) as! TicketTokenViewCell
cell.configure(
viewModel: .init(
config: dataStore.config,
token: token,
ticker: viewModel.ticker(for: token)
)

@ -8,12 +8,15 @@ struct TicketTokenViewCellViewModel {
private let shortFormatter = EtherNumberFormatter.short
private let token: TokenObject
let config: Config
let ticker: CoinTicker?
init(
config: Config,
token: TokenObject,
ticker: CoinTicker?
) {
self.config = config
self.token = token
self.ticker = ticker
}
@ -28,7 +31,19 @@ struct TicketTokenViewCellViewModel {
}
var issuer: String {
return "\(R.string.localizable.aWalletContentsIssuerTitle()): \(R.string.localizable.ticketIssuer())"
if config.server == .main {
return "\(R.string.localizable.aWalletContentsIssuerTitle()): \(R.string.localizable.ticketIssuer())"
} else {
return ""
}
}
var issuerSeparator: String {
if issuer.isEmpty {
return ""
} else {
return "|"
}
}
var blockChainName: String {

@ -4,9 +4,11 @@ import UIKit
import BigInt
struct TicketsViewControllerHeaderViewModel {
let config: Config
private let tokenObject: TokenObject
init(tokenObject: TokenObject) {
init(config: Config, tokenObject: TokenObject) {
self.config = config
self.tokenObject = tokenObject
}
@ -15,7 +17,19 @@ struct TicketsViewControllerHeaderViewModel {
}
var issuer: String {
return "\(R.string.localizable.aWalletContentsIssuerTitle()): \(R.string.localizable.ticketIssuer())"
if config.server == .main {
return "\(R.string.localizable.aWalletContentsIssuerTitle()): \(R.string.localizable.ticketIssuer())"
} else {
return ""
}
}
var issuerSeparator: String {
if issuer.isEmpty {
return ""
} else {
return "|"
}
}
var blockChainName: String {

@ -72,6 +72,6 @@ class TicketTokenViewCell: UITableViewCell {
separator.textColor = viewModel.subtitleColor
separator.font = viewModel.subtitleFont
separator.text = "|"
separator.text = viewModel.issuerSeparator
}
}

@ -63,11 +63,10 @@ class TicketsViewControllerHeader: UIView {
if issuer.isEmpty {
issuerLabel.text = ""
} else {
issuerLabel.text = "\(R.string.localizable.aWalletContentsIssuerTitle()): \(issuer)"
issuerLabel.text = issuer
}
separator.textColor = viewModel.subtitleColor
separator.font = viewModel.subtitleFont
separator.text = "|"
separator.text = viewModel.issuerSeparator
}
}
}

Loading…
Cancel
Save