Skip to content

Commit

Permalink
[Bugfix] Cleared Simplex (#126)
Browse files Browse the repository at this point in the history
* Disabled Simplex 
- Was causing crashes when return messages were happening.
- Will update in the next cycle with an updated UI
- Added a Analytics:  DID TAP BUY TAB marker

* Added Coming Soon label to the tableview background view for a temporary sign
- Added all translation for the coming soon message
  • Loading branch information
kcw-grunt committed Oct 15, 2020
1 parent fc7bf04 commit 154eb4f
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 307 deletions.
4 changes: 0 additions & 4 deletions loafwallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
24AF00FE221B331D00FF636F /* WarningConfirmation.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 24AF00FC221B331D00FF636F /* WarningConfirmation.storyboard */; };
24AF0101221B349100FF636F /* WarningConfirmationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24AF00FF221B349100FF636F /* WarningConfirmationViewController.swift */; };
24B523AD238A53DC0030594D /* BIP39Words.plist in Resources */ = {isa = PBXBuildFile; fileRef = 24B523AF238A53DC0030594D /* BIP39Words.plist */; };
24B8FAC12160497C00A155B1 /* BuyCenterTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24B8FAC02160497B00A155B1 /* BuyCenterTableViewController.swift */; };
24B8FAC4216128A000A155B1 /* PartnerData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24B8FAC3216128A000A155B1 /* PartnerData.swift */; };
24B8FAD22162B10200A155B1 /* BuyCenterWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24B8FAD12162B10200A155B1 /* BuyCenterWebViewController.swift */; };
24B8FAD72162B6FB00A155B1 /* bitrefill_index.html in Resources */ = {isa = PBXBuildFile; fileRef = 24B8FAD62162B6FB00A155B1 /* bitrefill_index.html */; };
Expand Down Expand Up @@ -887,7 +886,6 @@
24AF00FF221B349100FF636F /* WarningConfirmationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WarningConfirmationViewController.swift; sourceTree = "<group>"; };
24B523AE238A53DC0030594D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = en; path = en.lproj/BIP39Words.plist; sourceTree = "<group>"; };
24B523B0238A53E40030594D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "zh-Hans"; path = "zh-Hans.lproj/BIP39Words.plist"; sourceTree = "<group>"; };
24B8FAC02160497B00A155B1 /* BuyCenterTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BuyCenterTableViewController.swift; sourceTree = "<group>"; };
24B8FAC3216128A000A155B1 /* PartnerData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerData.swift; sourceTree = "<group>"; };
24B8FAD12162B10200A155B1 /* BuyCenterWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuyCenterWebViewController.swift; sourceTree = "<group>"; };
24B8FAD62162B6FB00A155B1 /* bitrefill_index.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = bitrefill_index.html; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2361,7 +2359,6 @@
24C516502158820E007CE038 /* Buy */ = {
isa = PBXGroup;
children = (
24B8FAC02160497B00A155B1 /* BuyCenterTableViewController.swift */,
24B8FAD12162B10200A155B1 /* BuyCenterWebViewController.swift */,
248BFE2323AAD53700CE1A71 /* BuyTableViewController.swift */,
248BFE2523AB302200CE1A71 /* BuyWKWebViewController.swift */,
Expand Down Expand Up @@ -4507,7 +4504,6 @@
CEC6AA3D1DEE687000EE5AFD /* RadialGradientView.swift in Sources */,
2494038123AF208F00369261 /* PromptModalViewController.swift in Sources */,
CEEC70921E95DA4400EF788E /* GradientSwitch.swift in Sources */,
24B8FAC12160497C00A155B1 /* BuyCenterTableViewController.swift in Sources */,
CE0CD1591DBFBCF5004023DA /* ModalPresenter.swift in Sources */,
CEE20C2F1EA3E5820086F724 /* BlinkingView.swift in Sources */,
CEC6AA441DEFCDE900EE5AFD /* ModalViewController.swift in Sources */,
Expand Down
128 changes: 0 additions & 128 deletions loafwallet/BuyCenterTableViewController.swift

This file was deleted.

42 changes: 17 additions & 25 deletions loafwallet/BuyTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,10 @@

import UIKit

class BuyTableViewController: UITableViewController {

@IBOutlet weak var simplexLogoImageView: UIImageView!
@IBOutlet weak var simplexHeaderLabel: UILabel!
@IBOutlet weak var simplexDetailsLabel: UILabel!
@IBOutlet weak var simplexCellContainerView: UIView!

@IBOutlet weak var chooseFiatLabel: UILabel!
@IBOutlet weak var currencySegmentedControl: UISegmentedControl!
class BuyTableViewController: UITableViewController {

private var currencyCode: String = "USD"

@IBAction func didTapSimplex(_ sender: Any) {

if let vcWKVC = UIStoryboard.init(name: "Buy", bundle: nil).instantiateViewController(withIdentifier: "BuyWKWebViewController") as? BuyWKWebViewController {
Expand All @@ -39,7 +31,7 @@ class BuyTableViewController: UITableViewController {
NSLog("ERROR: Storyboard not initialized")
}
}

var store: Store?
var walletManager: WalletManager?
let mountPoint = ""
Expand All @@ -50,29 +42,29 @@ class BuyTableViewController: UITableViewController {
thinHeaderView.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: 1.0)
thinHeaderView.backgroundColor = .white
tableView.tableHeaderView = thinHeaderView


// TODO: Remove when Simplex or any partner is ready for operations
let comingSoonLabel = UILabel()
comingSoonLabel.textAlignment = .center
comingSoonLabel.textColor = .white
comingSoonLabel.font = UIFont.barlowBold(size: 20)
comingSoonLabel.text = S.BuyCenter.comingSoon

tableView.backgroundView = comingSoonLabel

tableView.tableFooterView = UIView()

currencySegmentedControl.addTarget(self, action: #selector(didChangeCurrency), for: .valueChanged)
currencySegmentedControl.selectedSegmentIndex = PartnerFiatOptions.usd.index
LWAnalytics.logEventWithParameters(itemName: ._20191105_DTBT)
setupData()
}

private func setupData() {
let simplexData = Partner.partnerDataArray()[0]
simplexLogoImageView.image = simplexData.logo
simplexHeaderLabel.text = simplexData.headerTitle
simplexDetailsLabel.text = simplexData.details
simplexCellContainerView.layer.cornerRadius = 6.0
simplexCellContainerView.layer.borderColor = UIColor.white.cgColor
simplexCellContainerView.layer.borderWidth = 1.0
simplexCellContainerView.clipsToBounds = true

chooseFiatLabel.text = S.DefaultCurrency.chooseFiatLabel
}

@objc private func didChangeCurrency() {
if let code = PartnerFiatOptions(rawValue: currencySegmentedControl.selectedSegmentIndex)?.description {
self.currencyCode = code
}

}
}

Loading

0 comments on commit 154eb4f

Please sign in to comment.