blockchainethereumblockchain-walleterc20erc721walletxdaidappdecentralizederc1155erc875iosswifttokens
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.7 KiB
45 lines
1.7 KiB
// Copyright SIX DAY LLC. All rights reserved.
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
struct TransactionAppearance {
|
|
|
|
static func divider(color: UIColor, alpha: Double) -> UIView {
|
|
let view = UIView(frame: .zero)
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
view.heightAnchor.constraint(equalToConstant: 1).isActive = true
|
|
return view
|
|
}
|
|
|
|
static func header(viewModel: TransactionHeaderViewModel) -> UIView {
|
|
let view = TransactionHeaderView(frame: .zero)
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
view.amountLabel.attributedText = viewModel.amountAttributedString
|
|
return view
|
|
}
|
|
|
|
static func item(title: String, subTitle: String) -> UIView {
|
|
let titleLabel = UILabel(frame: .zero)
|
|
titleLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
titleLabel.text = title
|
|
titleLabel.textAlignment = .left
|
|
titleLabel.textColor = Colors.gray
|
|
|
|
let subTitleLabel = UILabel(frame: .zero)
|
|
subTitleLabel.translatesAutoresizingMaskIntoConstraints = false
|
|
subTitleLabel.text = subTitle
|
|
subTitleLabel.textAlignment = .left
|
|
subTitleLabel.textColor = Colors.black
|
|
subTitleLabel.font = UIFont.systemFont(ofSize: 12, weight: UIFontWeightLight)
|
|
subTitleLabel.adjustsFontSizeToFitWidth = true
|
|
|
|
let stackView = UIStackView(arrangedSubviews: [titleLabel, subTitleLabel])
|
|
stackView.translatesAutoresizingMaskIntoConstraints = false
|
|
stackView.axis = .vertical
|
|
stackView.spacing = 10
|
|
stackView.layoutMargins = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
|
|
stackView.isLayoutMarginsRelativeArrangement = true
|
|
return stackView
|
|
}
|
|
}
|
|
|