Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backmerge #5244

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy_appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ jobs:
XCCONFIG_PROD_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_PROD_HS_PROVIDER_API_KEY }}
XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY }}
XCCONFIG_PROD_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_PROD_OPEN_SEA_API_KEY }}
XCCONFIG_PROD_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_PROD_TRONGRID_API_KEY }}
1 change: 1 addition & 0 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ jobs:
XCCONFIG_DEV_HS_PROVIDER_API_KEY: ${{ secrets.XCCONFIG_DEV_HS_PROVIDER_API_KEY }}
XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY: ${{ secrets.XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY }}
XCCONFIG_DEV_OPEN_SEA_API_KEY: ${{ secrets.XCCONFIG_DEV_OPEN_SEA_API_KEY }}
XCCONFIG_DEV_TRONGRID_API_KEY: ${{ secrets.XCCONFIG_DEV_TRONGRID_API_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BitcoinFeeRateProvider: IFeeRateProvider {

func feeRates() async throws -> FeeRateProvider.FeeRates {
let rates = try await feeRateProvider.bitcoinFeeRate()
return .init(recommended: rates.economyFee, minimum: rates.minimumFee)
return .init(recommended: rates.halfHourFee, minimum: rates.minimumFee)
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import UIKit
import ComponentKit
import UIKit

class NftAssetButtonCell: UITableViewCell {
private let providerButton = PrimaryButton()
private let sendButton = PrimaryButton()
private let moreButton = PrimaryCircleButton()
private let saveButton = PrimaryButton()
private let shareButton = PrimaryButton()

private let stackView = UIStackView()

private var onTapSend: (() -> ())?
private var onTapProvider: (() -> ())?
private var onTapMore: (() -> ())?
private var onTapShare: (() -> Void)?
private var onTapSave: (() -> Void)?

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
Expand All @@ -25,51 +23,37 @@ class NftAssetButtonCell: UITableViewCell {
maker.height.equalTo(CGFloat.heightButton)
}

stackView.addArrangedSubview(sendButton)
stackView.addArrangedSubview(providerButton)
stackView.addArrangedSubview(moreButton)
stackView.addArrangedSubview(shareButton)
stackView.addArrangedSubview(saveButton)

stackView.spacing = .margin8
stackView.alignment = .fill
stackView.distribution = .fill
stackView.distribution = .fillEqually

sendButton.set(style: .yellow)
sendButton.addTarget(self, action: #selector(onTapSendButton), for: .touchUpInside)
sendButton.setTitle("button.send".localized, for: .normal)
shareButton.set(style: .yellow)
shareButton.addTarget(self, action: #selector(onTapShareButton), for: .touchUpInside)
shareButton.setTitle("button.share".localized, for: .normal)

providerButton.set(style: .gray)
providerButton.addTarget(self, action: #selector(onTapProviderButton), for: .touchUpInside)

moreButton.set(style: .gray)
moreButton.set(image: UIImage(named: "more_24"))
moreButton.addTarget(self, action: #selector(onTapMoreButton), for: .touchUpInside)
saveButton.set(style: .gray)
saveButton.addTarget(self, action: #selector(onTapSaveButton), for: .touchUpInside)
saveButton.setTitle("button.save".localized, for: .normal)
}

required init?(coder aDecoder: NSCoder) {
@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

@objc private func onTapSendButton() {
onTapSend?()
}

@objc private func onTapProviderButton() {
onTapProvider?()
@objc private func onTapSaveButton() {
onTapSave?()
}

@objc private func onTapMoreButton() {
onTapMore?()
@objc private func onTapShareButton() {
onTapShare?()
}

func bind(providerTitle: String?, onTapSend: (() -> ())?, onTapProvider: @escaping () -> (), onTapMore: @escaping () -> ()) {
providerButton.setTitle(providerTitle, for: .normal)

sendButton.isHidden = onTapSend == nil
providerButton.isHidden = onTapSend != nil

self.onTapSend = onTapSend
self.onTapProvider = onTapProvider
self.onTapMore = onTapMore
func bind(onTapShare: @escaping () -> Void, onTapSave: @escaping () -> Void) {
self.onTapShare = onTapShare
self.onTapSave = onTapSave
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -180,35 +180,6 @@ class NftAssetOverviewViewController: ThemeViewController {
urlManager.open(url: url, from: parentNavigationController ?? self)
}

private func openSend() {
guard let viewController = SendNftModule.viewController(nftUid: viewModel.nftUid) else {
return
}

parentNavigationController?.present(viewController, animated: true)
}

private func openOptionsMenu() {
let controller = AlertViewControllerNew.instance(
viewItems: [
.init(text: "button.share".localized),
.init(text: "nft_asset.options.save_to_photos".localized),
// .init(text: "nft_asset.options.set_as_watch_face".localized)
],
reportAfterDismiss: true,
onSelect: { [weak self] index in
switch index {
case 0: self?.handleShare()
case 1: self?.handleSaveToPhotos()
// case 2: self?.handleSetWatchFace()
default: ()
}
}
)

(parentNavigationController ?? self).present(controller, animated: true)
}

private func handleShare() {
if let providerUrl = providerUrl {
openShare(text: providerUrl)
Expand Down Expand Up @@ -319,17 +290,11 @@ extension NftAssetOverviewViewController: SectionsDataSource {
height: .heightButton,
bind: { [weak self] cell, _ in
cell.bind(
providerTitle: self?.viewModel.providerTitle,
onTapSend: sendVisible ? { [weak self] in
self?.openSend()
} : nil,
onTapProvider: {
if let url = self?.providerUrl {
self?.openLink(url: url)
}
onTapShare: { [weak self] in
self?.handleShare()
},
onTapMore: {
self?.openOptionsMenu()
onTapSave: { [weak self] in
self?.handleSaveToPhotos()
}
)
}
Expand Down
4 changes: 4 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ XCCONFIG_DEV_TWITTER_BEARER_TOKEN = ENV["XCCONFIG_DEV_TWITTER_BEARER_TOKEN"]
XCCONFIG_DEV_HS_PROVIDER_API_KEY = ENV["XCCONFIG_DEV_HS_PROVIDER_API_KEY"]
XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY = ENV["XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY"]
XCCONFIG_DEV_OPEN_SEA_API_KEY = ENV["XCCONFIG_DEV_OPEN_SEA_API_KEY"]
XCCONFIG_DEV_TRONGRID_API_KEY = ENV["XCCONFIG_DEV_TRONGRID_API_KEY"]

XCCONFIG_PROD_INFURA_PROJECT_ID = ENV["XCCONFIG_PROD_INFURA_PROJECT_ID"]
XCCONFIG_PROD_INFURA_PROJECT_SECRET = ENV["XCCONFIG_PROD_INFURA_PROJECT_SECRET"]
Expand All @@ -44,6 +45,7 @@ XCCONFIG_PROD_TWITTER_BEARER_TOKEN = ENV["XCCONFIG_PROD_TWITTER_BEARER_TOKEN"]
XCCONFIG_PROD_HS_PROVIDER_API_KEY = ENV["XCCONFIG_PROD_HS_PROVIDER_API_KEY"]
XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY = ENV["XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY"]
XCCONFIG_PROD_OPEN_SEA_API_KEY = ENV["XCCONFIG_PROD_OPEN_SEA_API_KEY"]
XCCONFIG_PROD_TRONGRID_API_KEY = ENV["XCCONFIG_PROD_TRONGRID_API_KEY"]

def delete_temp_keychain(name)
delete_keychain(
Expand Down Expand Up @@ -117,6 +119,7 @@ def apply_dev_xcconfig
update_dev_xcconfig('hs_provider_api_key', XCCONFIG_DEV_HS_PROVIDER_API_KEY)
update_dev_xcconfig('wallet_connect_v2_project_key', XCCONFIG_DEV_WALLET_CONNECT_V2_PROJECT_KEY)
update_dev_xcconfig('open_sea_api_key', XCCONFIG_DEV_OPEN_SEA_API_KEY)
update_dev_xcconfig('trongrid_api_key', XCCONFIG_DEV_TRONGRID_API_KEY)
end

def apply_prod_xcconfig
Expand All @@ -135,6 +138,7 @@ def apply_prod_xcconfig
update_prod_xcconfig('hs_provider_api_key', XCCONFIG_PROD_HS_PROVIDER_API_KEY)
update_prod_xcconfig('wallet_connect_v2_project_key', XCCONFIG_PROD_WALLET_CONNECT_V2_PROJECT_KEY)
update_prod_xcconfig('open_sea_api_key', XCCONFIG_PROD_OPEN_SEA_API_KEY)
update_prod_xcconfig('trongrid_api_key', XCCONFIG_PROD_TRONGRID_API_KEY)
end

def force_update_devices(type, username)
Expand Down
Loading