Skip to content

Commit

Permalink
Implement swap from balance header cell.
Browse files Browse the repository at this point in the history
Merge token lists for send and swap
  • Loading branch information
ant013 committed Aug 16, 2023
1 parent ab8d989 commit 82e01a2
Show file tree
Hide file tree
Showing 13 changed files with 581 additions and 156 deletions.
60 changes: 33 additions & 27 deletions UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class SwapModule {
viewModel: viewModel,
dataSourceManager: swapDexManager
)

return ThemeNavigationController(rootViewController: viewController)
return viewController
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class SwapViewController: ThemeViewController {
navigationItem.largeTitleDisplayMode = .never
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "button.close".localized, style: .plain, target: self, action: #selector(onClose))
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)

view.addSubview(tableView)
tableView.snp.makeConstraints { maker in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct BalanceViewItem {
let buttons: [WalletModule.Button: ButtonState]?
}

struct SendViewItem {
struct WalletTokenViewItem {
let element: WalletModule.Element

let topViewItem: BalanceTopViewItem
Expand Down Expand Up @@ -135,13 +135,13 @@ extension BalanceViewItem: DiffAware {

}

extension SendViewItem: DiffAware {
extension WalletTokenViewItem: DiffAware {

public var diffId: WalletModule.Element {
element
}

static func compareContent(_ a: SendViewItem, _ b: SendViewItem) -> Bool {
static func compareContent(_ a: WalletTokenViewItem, _ b: WalletTokenViewItem) -> Bool {
a.topViewItem == b.topViewItem
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ThemeKit
import SnapKit
import ComponentKit

class SendCell: UITableViewCell {
class WalletTokenCell: UITableViewCell {
private let topView = BalanceTopView()
private let separatorView = UIView()

Expand Down Expand Up @@ -32,7 +32,7 @@ class SendCell: UITableViewCell {
fatalError("not implemented")
}

func bind(viewItem: SendViewItem, animated: Bool = false, duration: TimeInterval = 0.2, onTap: (() -> ())? = nil, onTapError: (() -> ())?) {
func bind(viewItem: WalletTokenViewItem, animated: Bool = false, duration: TimeInterval = 0.2, onTap: (() -> ())? = nil, onTapError: (() -> ())?) {
topView.bind(viewItem: viewItem.topViewItem, onTapError: onTapError)
topView.layoutIfNeeded()

Expand Down
Loading

0 comments on commit 82e01a2

Please sign in to comment.