From 433ef5047014b673cf93d8d75e30960c79cef9f4 Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Tue, 18 Jun 2024 16:53:37 +0100 Subject: [PATCH] - handle displaying new staking operations - update token details baker cell to display "staked" instead of "delegated" when appropriate --- .../xcshareddata/swiftpm/Package.resolved | 2 +- .../TokenDetailsBalanceAndBakerCell.swift | 9 +++++++- .../TokenDetailsBalanceAndBakerCell_baker.xib | 5 +++-- ...okenDetailsBalanceAndBakerCell_nobaker.xib | 17 +++++++------- .../Account/TokenDetailsViewModel.swift | 15 +++++++------ .../Activity/Cells/ActivityItemCell.swift | 22 +++++++++++++++++++ Kukai Mobile/Services/ActivityService.swift | 13 +++++++++-- 7 files changed, 62 insertions(+), 21 deletions(-) diff --git a/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e3308cdc..8eb44ee9 100644 --- a/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Kukai Mobile.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -70,7 +70,7 @@ "location" : "https://github.com/kukai-wallet/kukai-core-swift", "state" : { "branch" : "develop", - "revision" : "b3297211ac399e2a4ef6238f571e8146fb66ac7c" + "revision" : "8ad6dac35574b37170d2aaa05d536e8787c72c0e" } }, { diff --git a/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell.swift b/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell.swift index 733e1102..7283b135 100644 --- a/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell.swift +++ b/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell.swift @@ -12,10 +12,11 @@ class TokenDetailsBalanceAndBakerCell: UITableViewCell { @IBOutlet weak var tokenIcon: UIImageView! @IBOutlet weak var balance: UILabel! @IBOutlet weak var value: UILabel! + @IBOutlet weak var bakerHeading: UILabel? @IBOutlet weak var bakerButton: CustomisableButton? func setup(data: TokenDetailsBalanceAndBakerData) { - if data.isStaked { + if data.isDelegated { bakerButton?.customButtonType = .none bakerButton?.setTitle(data.bakerName + " ", for: .normal) bakerButton?.setTitleColor(.colorNamed("Txt6"), for: .normal) @@ -24,6 +25,12 @@ class TokenDetailsBalanceAndBakerCell: UITableViewCell { bakerButton?.customButtonType = .secondary } + if data.isStaked { + bakerHeading?.text = "Staked" + } else { + bakerHeading?.text = data.isDelegated ? "Delegated" : "Not Delegated" + } + balance.text = data.balance balance.accessibilityIdentifier = "token-detials-balance" value.text = data.value diff --git a/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_baker.xib b/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_baker.xib index a1c18f03..ed16dca0 100644 --- a/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_baker.xib +++ b/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_baker.xib @@ -1,9 +1,9 @@ - + - + @@ -104,6 +104,7 @@ + diff --git a/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_nobaker.xib b/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_nobaker.xib index 907fe8e1..e9da62b7 100644 --- a/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_nobaker.xib +++ b/Kukai Mobile/Modules/Account/Cells/TokenDetailsBalanceAndBakerCell_nobaker.xib @@ -1,9 +1,9 @@ - + - + @@ -26,31 +26,31 @@