diff --git a/Trust/Transfer/ViewControllers/SendViewController.swift b/Trust/Transfer/ViewControllers/SendViewController.swift index 55ea550a5..4d8872ac7 100644 --- a/Trust/Transfer/ViewControllers/SendViewController.swift +++ b/Trust/Transfer/ViewControllers/SendViewController.swift @@ -233,6 +233,7 @@ class SendViewController: UIViewController { view.backgroundColor = viewModel.backgroundColor + headerViewModel.showAlternativeAmount = viewModel.showAlternativeAmount header.configure(viewModel: headerViewModel) targetAddressTextField.textColor = viewModel.textFieldTextColor diff --git a/Trust/Transfer/ViewModels/SendHeaderViewViewModel.swift b/Trust/Transfer/ViewModels/SendHeaderViewViewModel.swift index 1fd42c7d5..259228d2e 100644 --- a/Trust/Transfer/ViewModels/SendHeaderViewViewModel.swift +++ b/Trust/Transfer/ViewModels/SendHeaderViewViewModel.swift @@ -7,6 +7,7 @@ struct SendHeaderViewViewModel { var ticker: CoinTicker? = nil var currencyAmount: String? = nil var currencyAmountWithoutSymbol: Double? = nil + var showAlternativeAmount = false var issuer: String { return "" diff --git a/Trust/Transfer/Views/SendHeaderView.swift b/Trust/Transfer/Views/SendHeaderView.swift index 2d09bd6e2..17717d207 100644 --- a/Trust/Transfer/Views/SendHeaderView.swift +++ b/Trust/Transfer/Views/SendHeaderView.swift @@ -8,6 +8,8 @@ class SendHeaderView: UIView { let issuerLabel = UILabel() let middleBorder = UIView() + + var footerStackView: UIStackView? let valuePercentageChangeValueLabel = UILabel() let valuePercentageChangePeriodLabel = UILabel() let valueChangeLabel = UILabel() @@ -36,19 +38,19 @@ class SendHeaderView: UIView { let footerNamesStack = [valuePercentageChangePeriodLabel, valueChangeNameLabel, valueNameLabel].asStackView(distribution: .fillEqually, spacing: 15) - let footerStackView = [ - middleBorder, + footerStackView = [ .spacer(height: 14), footerValuesStack, footerNamesStack, ].asStackView(axis: .vertical, perpendicularContentHuggingPriority: .defaultLow) - footerStackView.translatesAutoresizingMaskIntoConstraints = false + footerStackView?.translatesAutoresizingMaskIntoConstraints = false let stackView = [ titleLabel, bottomRowStack, .spacer(height: 7), - footerStackView, + middleBorder, + footerStackView!, ].asStackView(axis: .vertical) stackView.translatesAutoresizingMaskIntoConstraints = false background.addSubview(stackView) @@ -117,5 +119,7 @@ class SendHeaderView: UIView { valueLabel.textColor = viewModel.textColor valueLabel.font = viewModel.textValueFont valueLabel.text = viewModel.value + + footerStackView?.isHidden = !viewModel.showAlternativeAmount } }