Skip to content

Commit 3d5f3c8

Browse files
committed
Disabled ETH button.
1 parent 7751bca commit 3d5f3c8

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

Adamant/Stories/Account/AccountViewController.swift

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,40 @@ extension AccountViewController: UICollectionViewDelegate, UICollectionViewDataS
466466
}
467467

468468
cell.setSelected(indexPath.row == selectedWalletIndex, animated: false)
469+
470+
if wallet.enabled {
471+
cell.currencyImageView.alpha = 1
472+
cell.currencySymbolLabel.alpha = 1
473+
} else {
474+
cell.currencyImageView.alpha = 0.3
475+
cell.currencySymbolLabel.alpha = 0.3
476+
}
477+
469478
return cell
470479
}
471480

472481
func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {
473-
return true
482+
guard let wallet = wallets?[indexPath.row] else {
483+
return false
484+
}
485+
486+
return wallet.enabled
474487
}
475488

476489
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
477490
selectedWalletIndex = indexPath.row
478-
491+
479492
form.allSections.filter { $0.hidden != nil }.forEach { $0.evaluateHidden() }
493+
494+
if let cell = collectionView.cellForItem(at: indexPath) as? WalletCollectionViewCell {
495+
cell.setSelected(true, animated: true)
496+
}
497+
}
498+
499+
func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
500+
if let cell = collectionView.cellForItem(at: indexPath) as? WalletCollectionViewCell {
501+
cell.setSelected(false, animated: true)
502+
}
480503
}
481504

482505
// Flow delegate

Adamant/Stories/Account/WalletCollectionViewCell.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ class WalletCollectionViewCell: UICollectionViewCell {
2626
}
2727
}
2828

29-
override var isSelected: Bool {
30-
didSet {
31-
setSelected(isSelected, animated: true)
32-
}
33-
}
34-
3529
func setSelected(_ selected: Bool, animated: Bool) {
3630
let width = selected ? frame.width * activeMarkerMultiplier : 0.0
3731
if animated {

0 commit comments

Comments
 (0)