-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
170 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/heart_48.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.22 KB
...leWallet/UnstoppableWallet/Assets.xcassets/Icons/heart_48.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.71 KB
...leWallet/UnstoppableWallet/Assets.xcassets/Icons/heart_48.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...oppableWallet/UnstoppableWallet/Modules/Settings/Donate/DonateAddressViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import UIKit | ||
import ActionSheet | ||
import ThemeKit | ||
import SectionsTableView | ||
import ComponentKit | ||
import MarketKit | ||
|
||
class DonateAddressViewController: ThemeViewController { | ||
typealias ViewItem = (String, BlockchainType, String) | ||
private let viewItems: [ViewItem] | ||
|
||
private let tableView = SectionsTableView(style: .grouped) | ||
|
||
override init() { | ||
viewItems = [ | ||
ViewItem("Bitcoin Address", .bitcoin, "bc1qw5tw4cnyt0vxts70ntdzxesn2zzz97t6r29pjj"), | ||
ViewItem("Ethereum Address", .ethereum, "0x8a2Bec907827F496752c3F24F960B3cddc5D311B"), | ||
ViewItem("BNB Smart Chain Address", .binanceSmartChain, "0x8a2Bec907827F496752c3F24F960B3cddc5D311B") | ||
] | ||
|
||
super.init() | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
title = "settings.donate.title".localized | ||
navigationItem.largeTitleDisplayMode = .never | ||
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "button.done".localized, style: .plain, target: self, action: #selector(onTapDoneButton)) | ||
navigationItem.backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) | ||
|
||
view.addSubview(tableView) | ||
tableView.snp.makeConstraints { maker in | ||
maker.left.right.bottom.equalToSuperview() | ||
maker.top.equalToSuperview().offset(CGFloat.margin24) | ||
} | ||
|
||
tableView.registerCell(forClass: MarkdownHeader1Cell.self) | ||
|
||
tableView.sectionDataSource = self | ||
tableView.separatorStyle = .none | ||
tableView.backgroundColor = .clear | ||
|
||
tableView.buildSections() | ||
} | ||
|
||
@objc private func onTapDoneButton() { | ||
dismiss(animated: true) | ||
} | ||
|
||
} | ||
|
||
extension DonateAddressViewController: SectionsDataSource { | ||
|
||
func buildSections() -> [SectionProtocol] { | ||
viewItems.enumerated().map { index, viewItem -> SectionProtocol in | ||
Section( | ||
id: "section-id-\(index)", | ||
headerState: tableView.sectionHeader(text: viewItem.0), | ||
footerState: .margin(height: .margin24), | ||
rows: [ | ||
CellBuilderNew.row( | ||
rootElement: .hStack([ | ||
.image32 { (component: ImageComponent) -> () in | ||
component.setImage( | ||
urlString: viewItem.1.imageUrl, | ||
placeholder: UIImage(named: viewItem.1.placeholderImageName(tokenProtocol: .native)) | ||
) | ||
}, | ||
.text { component in | ||
component.font = .subhead2 | ||
component.textColor = .themeLeah | ||
component.text = viewItem.2 | ||
component.textAlignment = .right | ||
component.numberOfLines = 0 | ||
}, | ||
.secondaryCircleButton { component in | ||
component.button.set(image: UIImage(named: "copy_20")) | ||
component.onTap = { | ||
CopyHelper.copyAndNotify(value: viewItem.2) | ||
} | ||
} | ||
]), | ||
tableView: tableView, | ||
id: "donate-address-\(index)", | ||
hash: "donate-address-hash-\(index)", | ||
height: .heightCell56, | ||
bind: { cell in | ||
cell.set(backgroundStyle: .lawrence, isFirst: true, isLast: true) | ||
} | ||
) | ||
] | ||
) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters